unique code for each submission? | Community
Skip to main content
Answered

unique code for each submission?


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

Best answer by Liz

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?

View original

21 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14903 replies
  • Answer
  • April 5, 2021

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?


  • Navigating the Land
  • 1 reply
  • April 30, 2021
Liz wrote:

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. 

 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14903 replies
  • April 30, 2021

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!


  • Explorer
  • 2 replies
  • June 17, 2021

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


Mariana
Ex–Typefomer
Forum|alt.badge.img+5
  • Ex–Typefomer
  • 679 replies
  • June 17, 2021

Hi @Alba. Happy Thursday! 

 

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


  • Explorer
  • 2 replies
  • June 21, 2021

Ok perfect, thank you @Mariana ! 

Alba


Forum|alt.badge.img+2
  • Sharing wisdom
  • 57 replies
  • April 28, 2022

Hi,

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


andrew_videoask
Typeform
Forum|alt.badge.img+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.


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14903 replies
  • May 9, 2022

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


  • Navigating the Land
  • 1 reply
  • June 7, 2022

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 ?


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14903 replies
  • June 7, 2022

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


  • Navigating the Land
  • 1 reply
  • November 7, 2022
andrew_videoask wrote:

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!


mintacademy
  • Navigating the Land
  • 2 replies
  • March 17, 2023
rambd wrote:

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>

 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14903 replies
  • March 17, 2023

Thank you so much, @mintacademy !


Forum|alt.badge.img+2
  • Socializer
  • 19 replies
  • October 18, 2023

@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


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14903 replies
  • October 18, 2023

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. 😀


  • Navigating the Land
  • 1 reply
  • February 28, 2024
winch wrote:

@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.


  • Navigating the Land
  • 4 replies
  • April 3, 2024

Hi,

Is there any update on this?

Typeform is essentially useless for our needs without this.

Thanks


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14903 replies
  • April 3, 2024

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

Liz wrote:

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?

 


  • Navigating the Land
  • 4 replies
  • April 4, 2024
Liz wrote:

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

Liz wrote:

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. 
 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14903 replies
  • April 4, 2024

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:

mintacademy wrote:
rambd wrote:

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