Community Groups are officially here!
We've released Groups, a new feature that enables us to connect community members of similar industries and interests in a shared, private space. You can check out all of the details here, including information about who can join, how to join, and what Groups are currently offered. Please leave your feedback through this Community Groups Feedback Survey.

More details needed to generate random number with no repeats. Any solution yet?

twray Providence, RICommunity Member, Qualtrics Brand Admin Qubie ✭

Hi all - Thanks for reading!

I know this question has been asked several times already (e.g.,, but thought I'd check in again about this to see if someone could provide a more specific answer, since this has to be a need that many people have.

I want to assign a random 6-digit number as a respondent enters a survey, but it's essential that there be no repeats. I know Qualtrics' random number generator can do this, but can't guarantee it won't repeat. So, several others have suggested setting up a web service or library to do this. But can anyone provide more details about exactly how to do this?

There has to be a solution out there, and I think it'd be really helpful to a lot of people to post it here.


Best Answers

  • MohammedAli_Rajapkar
    MohammedAli_Rajapkar Mumbai - IndiaCommunity Member, Qualtrics Brand Admin Wizard ✭✭✭✭✭
    Accepted Answer

    Just checking, cant we use "ResponseID" embedded data which always unique for each survey record.
    However, this won't be 6 digit number... ResponseID is alphanumeric and always unique for each record in a survey.

  • TomG
    TomG Raleigh, NCCommunity Member, Qualtrics Brand Admin Wizard ✭✭✭✭✭
    Accepted Answer


    You need to keep track of which numbers have been used. It would be best to use a web service for that. For example, you could:
    1. Set up a one field database table with the numbers 100000 through 999999 as records.
    2. Have your web service script grab a random record, delete the record it just grabbed, and output the number it grabbed in a json string.


  • PeeyushBansal
    PeeyushBansal IndiaCommunity Member, XMPN Member, Qualtrics Brand Admin Wizard ✭✭✭✭✭

    If you are distributing via contact list , let add one extra column say number, for each contact set any random number with excel random number generator.

    Create embedded variable in survey say randnum and set it like 100000+number piped from your contact list.

  • twray
    twray Providence, RICommunity Member, Qualtrics Brand Admin Qubie ✭

    We are not distributing via contact list. This would be to assign a random, unique ID number to respondents who arrive at the survey via a URL in advertisements, etc.

  • twray
    twray Providence, RICommunity Member, Qualtrics Brand Admin Qubie ✭

    Ah, that may be a good solution for many, if it's indeed unique. We could really use a 6-digit integer, though.