Creating auto generated job numbers

My app allows Users to create jobs relating to their customers. Each job is unique as it has a title and customer name. But, to avoid any chance of two jobs having the same title AND same customer name (could happen!) I was thinking of assigning an auto generated job number which I can reference. Anyone know the best way to do this?

You can either generate a sequential job number by searching job numbers highest number+1, or do a random string, and check that it doesn’t match a number already.

Thank you, I think this is a nice solution. I can’t see where to add a random string?

Insert Dynamic Data > Calculate > Random string

Is this where I would insert the job ID?

Oh wait, I think I understand, I need to insert the info on the page first so I can reference it. Doh!

I only have the option Calculate formula. I don’t see how to achieve your solution?

Sure.

But have you thought that you can still have 2 different jobs with the same name and title, every record has a unique bubble ID already. Still not a bad idea to have friendly Job IDs

Yes, its under calculate formula

Ah yes, found it. Thank you very much.

That is true but I think that displaying a unique job ID gives Users some comfort!

The random job ID shows up on the page perfectly (displayed as text), but when I try and save that data to the DB it is not available? I have a Job ID field of text.

Sounds like you have done it as a text element, it needs to be an input field to store it. You could put a custom state on the text element and use that to save it. I would just generate it as part of the workflow as otherwise, you could end up with multiple of the same job number as it needs to be created and then saved at the same time.

That’s perfect, thank you.