Expand my Community achievements bar.

SOLVED

Auto-Generated Unique Document Number

Avatar

Former Community Member

Hello,

I would like to have some sort of function on my document that creates a unique number for each submitted form.

The form is both submitted by .xml and .pdf.

is there a way to do something like this?

Cheers,

Wes

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Wes,

I don't know how familiar you are with scripting/Javascript, but too have such a function you could have 2 different ideas based on what you want to do :

1. You can have a string generator which could be based on some information inserted in some fields from the user.

     e.g.: You can use the substring function to get some partial information from different fields in the form and concatenate them together to create a unique "ID" of the form.

     Unfortunately this could have some IDs which could be the same if a form is filled more than once by a user, and or (rare) some information could be almost equal to others...

2. There is the option where can use the date and time of the form when it is submitted. Using this method is almost perfect to never have 2 identical unique IDs. You could also use a random string generator to concatenate the date/time with it.

The best option you could have is to have all the answers above. Unique ID would start with partial information in the form  + date/time of the form submitted or vice-versa.

If you would like to have more than those 3 options above, you can also add a random string generator in the process. Here is some help for random string generator, you can modify it as you wish...

random password generator?

Mag

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Hi Wes,

I don't know how familiar you are with scripting/Javascript, but too have such a function you could have 2 different ideas based on what you want to do :

1. You can have a string generator which could be based on some information inserted in some fields from the user.

     e.g.: You can use the substring function to get some partial information from different fields in the form and concatenate them together to create a unique "ID" of the form.

     Unfortunately this could have some IDs which could be the same if a form is filled more than once by a user, and or (rare) some information could be almost equal to others...

2. There is the option where can use the date and time of the form when it is submitted. Using this method is almost perfect to never have 2 identical unique IDs. You could also use a random string generator to concatenate the date/time with it.

The best option you could have is to have all the answers above. Unique ID would start with partial information in the form  + date/time of the form submitted or vice-versa.

If you would like to have more than those 3 options above, you can also add a random string generator in the process. Here is some help for random string generator, you can modify it as you wish...

random password generator?

Mag