- Posts: 1
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Generate Random 4-digit Participant ID
- SochillScienz
-
Topic Author
- Offline
- New Member
-
Less
More
1 week 6 days ago #243738
by SochillScienz
Generate Random 4-digit Participant ID was created by SochillScienz
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.28.57
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi Everyone!
I am designing a pre- and post- LimeSurvey and want to design the pre-survey so that it automatically generates a unique, randomly generated 4-digit Participant ID. I then want this Participant ID to be emailed to them when I sent out invitations to complete the post-survey. Then, for the post-survey I want them to use this same generated ID to be able to log in and complete the post- survey.
However, I am quite new to LimeSurvey and am having difficulty trying to do this. Any advice or alternatives would be greatly appreciated! Also if this has already been asked if you could provide a link to the article that would also be great.
Thank you!
Your LimeSurvey version: 3.28.57
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi Everyone!
I am designing a pre- and post- LimeSurvey and want to design the pre-survey so that it automatically generates a unique, randomly generated 4-digit Participant ID. I then want this Participant ID to be emailed to them when I sent out invitations to complete the post-survey. Then, for the post-survey I want them to use this same generated ID to be able to log in and complete the post- survey.
However, I am quite new to LimeSurvey and am having difficulty trying to do this. Any advice or alternatives would be greatly appreciated! Also if this has already been asked if you could provide a link to the article that would also be great.
Thank you!
Please Log in to join the conversation.
1 week 5 days ago #243766
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Generate Random 4-digit Participant ID
The problem with random 4 digit IDs is, that they are random, and not exclusive.
You could quite easily generate a 4 digit number like this:
{rand(1000,9999)}.
However, there is a chance that this process might generate the same 4 digit number more than once and you can't control it.
So what I recommend is to generate a random number and join it with the SAVEDID, which for a survey is always unique.
For the follow up survey you can then use the generated code as the token in a closed survey.
You could quite easily generate a 4 digit number like this:
{rand(1000,9999)}.
However, there is a chance that this process might generate the same 4 digit number more than once and you can't control it.
So what I recommend is to generate a random number and join it with the SAVEDID, which for a survey is always unique.
For the follow up survey you can then use the generated code as the token in a closed survey.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 13146
- Thank you received: 2423
1 week 5 days ago #243770
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Generate Random 4-digit Participant ID
What is your exact need ?
maybe something like that: gitlab.com/SondagesPro/SurveyAccess/surveyChaining
maybe something like that: gitlab.com/SondagesPro/SurveyAccess/surveyChaining
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Please Log in to join the conversation.