Passing an embeded variable from Qualtrics to Pavlovia

I am trying to connect Qualtrics with Pavlovia to collect some information about participants in Qualtrics and then direct them to the test in Pavlovia. However, I am having trouble passing embedded data from Qualtrics to a variable that then I can use in my PsychoJS experiment in Pavlovia.

I ma using the following URL to pass infomration form Qualtrics to Pavlovia.

https://run.pavlovia.org/myUserName/myProject/?participant=${e://Field/id?format=urlencode}&stimuliList=${e://Field/List?format=urlencode}

The URL above correctly parse the embedded fields in Qualtrics because the URL gets correctly translated when the experiment in Pavlovia starts. Both variables (ā€œparticipantā€ and ā€œstimuliListā€) are assigned a value in the URL (as you can see below).

https://run.pavlovia.org/myUserName/myProject/?participant=Miguel&stimuliList=A

However, only the variable for ā€œparticipantā€ seems to be doing its job. Its information is correctly written in the CSV file of the experiment. However, I cannot use the variable ā€œstimuliListā€. Using it in the code below results in an error because the value of the variable is Undefined, when supposedly it has taken the value of ā€œAā€ in the URL.

stimuliFile = "stimuli List " + stimuliList + ".xlsx";

I guess I am doing something wrong when retrieving the value of the variable. I have already spent 10 pavlovia credits trying to figure this out :S

Any ideas on how to make things work? And on how to test the integration between qualtrics/prolific and pavlovia without spending credits?

Best,
Miguel

Have you added stimuliList to the expInfo dialogue box in PsychoPy?

If you turn off save incomplete data and add a final routine that never ends you can test without spending credits.

No, I didnā€™t. However, it turns our that I can access the variables passed from Quatrics with expInfo as in the code below. I seems it is not needed to specify these variables within expInfo in the PsychoPy code.

stimuliFile = "stimuli List " + expInfo['stimuliList'] + ".xlsx";

Thanks for the tip!

Miguel

Hi @wakecarter,
Do you know if the embedded variables being pased into pavlovia from qualtrics HAVE to be added to the expInfo dialogue box?
Could I embed them in the url and then call them using ā€œexpInfo[ā€˜variableā€™]ā€ without having them appear in the dialogue box at the begining?

Best
Elle

Participants donā€™t see expInfo variables in the dialogue box if they have already been set in the URL.

Please could you test to see if a variable can be called by expInfo from the URL if it hasnā€™t been set in the dialogue box?

1 Like

Ohh I see, I didnā€™t realise that, thanks!
I will test it out now to see if a variable from the URL can be called if it hasnt been set in the diaglogue box (I expect not)

@EJJ

Any variables that you pass from Qaultrics to Pavlovia through the URL will be available in the PsychoJS experiment. The only thing you need to do is use expInfo as in the example that I provided above.

Cheers,
Miguel

Great thanks for the info :slight_smile:

When I ommited the variable from the experiment info dialogue box it caused an unidentified Java error. But now I realise that the participant cant see or edit this embedded data it isnt a problem to add the fields to the box!

Elle

1 Like