Generate random number / shorter submission ID

I’m looking for an easy way to generate an order number.
I tried the submission ID but it’s too long.
Something around 7 to 10 characters.

I read that this can be done via Zapier and other connector tools but that is too much effort. I’m sure you guys can easily add such feature and it adds tremendous value!
Other forms have this feature - Aidaform and Questionscout but most of my forms are in Paperform so I have no plans of moving. Please make this happen!

1 Like

Hey.

The best way to make this happen currently is to take the current time and format it to either seconds or milliseconds since epoch (00:00 UTC on January 1, 1970). This will give you a number that is ten or thirteen digits.

The way you’d do this is by using a calculation question:

dateformat(now(), "X"); // seconds, 10 digits
dateformat(now(), "x"); // milliseconds, 13 digits

However, keep in mind that submissions submitted in the same second or millisecond, depending on which option is chosen, will have the same number, so it is not guaranteed to be unique.

This one works perfect. I just added a text and used concatenate to differentiate the reference numbers based on the answers.

Problem solved! Thank you so much

1 Like

Note to Danny’s reply if you use this for more than one activity i.e. submission page and email - the number will change as the system will recalculate the now() each time it is run. Therefore until Paperform fix this the only data that can be used and will remain static is that entered on the form - this risks duplication.

That is correct. We calculate now() on the client and then on the server. The server is the authoritative source and is the value sent to emails, webhooks, and integrations.

We are currently looking looking into getting the server’s answer to the success page so that there is consistency among all after submission values.