| Reference | Downloads | Github

How to assign a new ID to each participant?

Initially, participants are asked to enter their participant’s ID in the box as soon as the experiment is launched. But how can I assign ID automatically in the beginning of the experiment? Can I ad a line of code which generates and ID in Experiment info?

Assign Consecutive Participant IDs

I have written a web app. which can be used for Pavlovia experiments:

The page takes four parameters: folder, experiment, id and researcher.

folder (required) is your Pavlovia username

experiment (required) is your experiment name as formatted for the study link

id (optional) is a unique code which you could assign, for example as a random number in Qualtrics, so you can link your PsychoPy data back. It is passed to Pavlovia unchanged

researcher (optional) is also passed to Pavlovia unchanged. I am using it to ensure that participants start in Qualtrics where they can view the participant information sheet, not Pavlovia.

participant is assigned by my app. as a consecutive number. You could use a modulus of participant in order to assign participants to conditions. The number increments whether or not the participant finishes. It would be considerably more complicated to re-assign aborted participant numbers.

Example URL:

Best wishes,


@wakecarter I have the opposite question to the above.
I am doing a study where the same participants will complete three sessions at different time points and I need to link their responses between the sessions. Therefore, participants are coming up with their own unique IDs based on a number of security questions. This hopefully will help them to recall or reconstruct the ID each time they participate. But this means that participant IDs cannot be randomly generated and they are dependent on the participant themselves. Is there a way to use the participant ID, which they input as an answer to a question at the start of the Qualtrics form, to feed it into Pavlovia and then feed it back? As far as I understand the instructions for using the web app - it is only for random ID assignment right?

I think I already have what you want. assigns a consecutive number to participant.

However, I have coded it (for someone else) so that if participant already exists the consecutive number is assigned to id instead.

There was an initial bug which meant that every participant was assigned to id2 (because the value for folder kept changing). However, I fixed that by only storing folder up to the ?.

Best wishes,


1 Like

Hi @wakecarter, thank you for this quick response.
I am sorry but I am not very savvy with html/JS so I might struggle with this a little.

Here is the link to my Pavlovia study:

And this is my Qualtrics form:

Participants generate their ID in Question 2 in Qualtrics.
The Pavlovia link is provided to participants in Question 21.

I do not quite understand how Pavlolvia will pick up the answer to Question 2 to use it as the PI.

When I use the following link (with the pilot token) it still asks me for participant ID

You need to use piped text in Qualtrics to put the ID you’ve generated into the Pavlovia link.

In Pavlovia have you changed the expInfo box so participant (the default) is now called something else? If so, I’d recommend that you change it back to participant.

Best wishes,


I am nearly there! I have set up the piped text so it inputs the ID of the participant into the link. Here is an example (together with the pilot token) taken straight from Qualtrics:

I have changed the participant field in expInfo and the participant ID box does not show up any more once the experiment starts. However, participant IDs are being assigned consecutive numbers rather than the ID specified in the link.

As soon as I input the link and press enter, it changes to the one below:

The “participant” number goes up every time.

Thank you for your help!

The problem is with the piloting variables _pilotToken and _oauthToken. Ypu also haven’t put anything in front of participant so it’s seen as part of the _oauthToken.

Try the following:
1 Like

I just assigned credits to the project and tried to run it and you are right, it was the piloting mode that made it all funny. It works! I am quite amazed, thank you so much, this will make the procedure so much easier for the participants now!

1 Like


I tried your app but I always get the error message that the file is not found. User name is jens.boelte and experiment is emowoerter. The pavolovia link to the experiment is

Any idea Jens

Please could you add the link that you’re trying so I can see where it’s going wrong?


I tried

Best Jens


1 Like



first of all thank you for developing the webapp.

I used it to assign consecutive participants n° in Pavlovia via prolific recruitment. The problem I have now is that I can’t match prolific ID with the results, since it seem to only show the consecutive number.

Is there a way to find prolific ID somewhere else in the results?

thanks for your patience, I am a newby in the environment.

Did you send the prolific ID to my web app?

Inputs id, session and researcher are optional but can be used to transfer a non-consecutive participant id and a variable that could be used as a password to access the experiment (to ensure that the participant information sheet has been viewed).

If you sent the prolific ID as id, session or researcher and then had the matching variable in the expInfo dialogue box in Pavlovia then the id will be saved to your data files.

I changed the PROLIFIC PID default parameter in prolific to “participant” and used it to choose conditions in Pavlovia but did not assign any id to the web app.
To use it correclty, should I leave prolific default parameters as they are and just send it to the web app?
Thank you

I’m slightly confused here.

Did you use Prolific to send a value of participant directly to Pavlovia or via my web app?

My web app sets a consecutive value for participant and therefore a different variable name should be used for anything you want to to pass through unchanged.

I gave the same name (‘participant’) to the PROLIFIC PID parameter. I guess it was a mistake.

Sorry, yes.

I’ve just tested and the link

gets forwarded to

losing the value xxx originally given to participant.

If you have the order that the Prolific participants started then that should map onto the order of the participant numbers.