Answered

unique code for each submission?


Hi, Is it possible to assign a unique code for each submission? Thanks

icon

Best answer by Liz 5 April 2021, 22:22

View original

21 replies

Userlevel 7
Badge +5

Hi @rambd this is a great question! We do automatically create a Response ID, which you can see when you export the results through a CSV file. Would that work for you?

Hi @rambd this is a great question! We do automatically create a Response ID, which you can see when you export the results through a CSV file. Would that work for you?

 

Hi Liz, 

Would it be possible to use the Response ID as a hidden field? Would like to capture unique IDs on a redirect page. 

 

Userlevel 7
Badge +5

Hi @Yi Xuan It isn’t currently possible to pass the Response ID out of the form through hidden fields since it isn’t generated until the submit button is clicked. :( Though, I can share this feedback with product!

Hi, 

I would like to know if it is possible to generate a code for people who answer a survey so that these people can indicate that they have answered the survey..

Thank you very much, 

Alba

Userlevel 7
Badge +5

Hi @Alba. Happy Thursday! 

 

I moved your question here where the answer is. Let us know if you have any other questions =)

Ok perfect, thank you @Mariana ! 

Alba

Userlevel 5
Badge +2

Hi,

Has anyone managed to figure out solution for this one? Really need one

Userlevel 7
Badge +5

Hi all! @ValdemarQ 

Here’s a workaround (and interactive demo) that I’ve created.

To be clear, the unique code being generated here is NOT the same as the respondent ID that’s generated upon submission of the typeform. This is also designed to only work with embedded typeforms.

However, this solution will generate a unique code that you can use as a hidden field and in your redirect URL.

Userlevel 7
Badge +5

Thanks, @andrew_videoask ! Let us know how this goes for you, @ValdemarQ !

I am doing an anonymous survey, and it is in stages so I need to give an identifier  (numeric or alphanumeric) to each user so that they can fill it in the later follow-ups of the survey. Is there any way to do that ?

Userlevel 7
Badge +5

Hi @Farishhta I’ve added your post here where we have the answer! One thing to note - the form won’t save responses until the respondent clicks the submit button. So, if you have a form that has multiple stages, I would suggest splitting up the form and tying them together like this

Hi all! @ValdemarQ 

Here’s a workaround (and interactive demo) that I’ve created.

To be clear, the unique code being generated here is NOT the same as the respondent ID that’s generated upon submission of the typeform. This is also designed to only work with embedded typeforms.

However, this solution will generate a unique code that you can use as a hidden field and in your redirect URL.

Hi @andrew_videoask  - I can’t figure out where to put this code in the survey. Help please!

Hi, Is it possible to assign a unique code for each submission? Thanks

Here’s a workaround:

  1. Create a hidden variable in your typeform (e.g. tf_user_id)
  2. Generate a random user ID on the page that embeds your typeform
  3. Pass the random ID into your typeform
  4. (Optional) Redirect a user to a URL that includes the hidden variable as a parameter, in case you need to use it later

The code below should do the trick.

<div id="typeform-div"></div>
<script src="//embed.typeform.com/next/embed.js"></script>
<script>
  // Generate a random ID
  const timestamp = new Date().getTime();
  const randomNum = Math.floor(Math.random() * 1000000000);
  const randomId = `${randomNum}`;

  // Create a new div element with the random ID
  const divElement = document.createElement('div');
  divElement.setAttribute('id', randomId);
  divElement.setAttribute('data-tf-widget', 'YOUR_TYPEFORM_ID_HERE');
  divElement.setAttribute('data-tf-opacity', '100');
  divElement.setAttribute('data-tf-iframe-props', 'title=Your Typeform Title');
  divElement.setAttribute('data-tf-medium', 'snippet');
  divElement.setAttribute('data-tf-hidden', 'tf_user_id=' + randomId);
  divElement.setAttribute('style', 'width:100%;height:500px;');
  

  // Append the div to the "typeform-div" div
  const typeformDiv = document.querySelector('#typeform-div');
  typeformDiv.appendChild(divElement);
</script>

 

Userlevel 7
Badge +5

Thank you so much, @mintacademy !

Userlevel 1
Badge +2

@Liz 
I hope you are well.
I have seen an answer from 2 years ago to the question if its possible to have a "unique code for each submission?". So in the responding email that a submission gets they can have a unique number showing.
Do you know if this is possible yet?
Best
Ian

Userlevel 7
Badge +5

Hi @winch I’ve moved your post here where we have an existing conversation about this. No updates in the near future, but if that changes, we’ll post about it here. 😀

@Liz 
I hope you are well.
I have seen an answer from 2 years ago to the question if its possible to have a "unique code for each submission?". So in the responding email that a submission gets they can have a unique number showing.
Do you know if this is possible yet?
Best
Ian

I’m also looking for this solution.

Hi,

Is there any update on this?

Typeform is essentially useless for our needs without this.

Thanks

Userlevel 7
Badge +5

Hi @CArnold Thanks for stopping by! Have you tried accessing the Response ID yet? 

Hi @rambd this is a great question! We do automatically create a Response ID, which you can see when you export the results through a CSV file. Would that work for you?

 

Hi @CArnold Thanks for stopping by! Have you tried accessing the Response ID yet? 

Hi @rambd this is a great question! We do automatically create a Response ID, which you can see when you export the results through a CSV file. Would that work for you?

 

Hi,

thanks for the reply.

No this wouldn’t work. We need a unique number that is shown to participants upon completing the survey so they can remain anonymous but can also choose to withdraw their data at a later date if desired by submitting their unique ID to the researchers. 
 

Userlevel 7
Badge +5

Ah got it, @CArnold . I’m afraid we don’t have a feature like this (or one coming in the near future), but it might be worth giving this workaround a try:

Hi, Is it possible to assign a unique code for each submission? Thanks

Here’s a workaround:

  1. Create a hidden variable in your typeform (e.g. tf_user_id)
  2. Generate a random user ID on the page that embeds your typeform
  3. Pass the random ID into your typeform
  4. (Optional) Redirect a user to a URL that includes the hidden variable as a parameter, in case you need to use it later

The code below should do the trick.

<div id="typeform-div"></div>
<script src="//embed.typeform.com/next/embed.js"></script>
<script>
  // Generate a random ID
  const timestamp = new Date().getTime();
  const randomNum = Math.floor(Math.random() * 1000000000);
  const randomId = `${randomNum}`;

  // Create a new div element with the random ID
  const divElement = document.createElement('div');
  divElement.setAttribute('id', randomId);
  divElement.setAttribute('data-tf-widget', 'YOUR_TYPEFORM_ID_HERE');
  divElement.setAttribute('data-tf-opacity', '100');
  divElement.setAttribute('data-tf-iframe-props', 'title=Your Typeform Title');
  divElement.setAttribute('data-tf-medium', 'snippet');
  divElement.setAttribute('data-tf-hidden', 'tf_user_id=' + randomId);
  divElement.setAttribute('style', 'width:100%;height:500px;');
  

  // Append the div to the "typeform-div" div
  const typeformDiv = document.querySelector('#typeform-div');
  typeformDiv.appendChild(divElement);
</script>

 

 

Reply