I’m building out a support ticketing system and need to create a unique, 9-digit number to use as part of each ticket’s unique ID. Initially, I leveraged the Row ID and used an ITE column to compile [currentYear][username][truncated Row ID] into a unique ID like:
2024_Gannon_p9C8JZo4T-
However, the end result is a little clunky should a customer call in and need to read back their ticket number for reference.
Just know that “random” does not equal “unique”. By using random you still have a small chance of ending up with the same number sometime in the future. I recommend having a look at this thread. Making a 12 digit random number
To answer your question about having the same number in each row, the javascript will only run when necessary. You are not giving it any parameters that are unique to each row, so it only needs to run once and place the same value in each row. To fix that, add a p1 parameter that points to RowID. You shouldn’t need to use it in your code, but it will provide a seed to trigger the javascript to run for each row.
Also, make sure to write that generated number to a basic column. You don’t want a new number generating in each row every time someone opens the app. In fact, I’d probably have that number generating as part of the form process in one single row instead of several rows. Then use a unique ID or timestamp as the trigger.
Whenever you need a new number, update a column with a Unique ID or Timestamp. The javascript will see that value change, causing it to run again and generate a new number. Then take that new value, write it to a basic column, and make it part of you ticket ID.
Hey @Jeff_Hager. As always, I really appreciate the insight and recommendations. I understand what you’re saying about not really being unique but more random and the increase in digits to avoid possible duplicates.
After some consideration, I’ve passed in a Unique ID and combined it with the current year and username to create what I need. I like that the unique ID is all lowercase and doesn’t include punctuation like the Row IDs – makes the end result nice and clean.
Thanks again for taking the time to share your knowledge, it is always appreciated!