Data filename not saving properly in online experiements

Hi all!

Just to preface - I know this question has been posted here before, but I tried all the proposed solutions and none of them worked for me, so I’m wondering if anyone has any other ideas for what seems to be a unique spin on a common problem! Details:

Problem: I’m running a study in pavlovia that was initial built via the builder ~1 year ago, but has been heavily edited (directly in the js script) since then. My data files are saving in a generic format (e.g., PARTICIPANT_expName_2023-06-15_15h59.22.137.csv) instead of with the subject ID.

Attempted solution: I noticed that the psychoJS.experiment.dataFileName function was missing all together (not sure how it was saving the files at all…), so I added the following lines of code in the update info function (that’s where it seemed to be located in my other tasks):


psychoJS.experiment.dataFileName = ((“.” + “/”) + data/${expInfo['a' ]}_${expInfo[ 's' ]}_${expName}_${expInfo["date"]});

The data is still just saving with the generic “PARTICIPANT” name, which is strange because the word participant isn’t present at all in the js file. I know the “a” and “s” variables (these are the participant ID and session number) are saving correctly because they appear correctly within the data file and when I have the console log them.

Any ideas for other things to try? The script seems to have multiple update functions (it’s a long, messy task…) so I tried inserting the same two lines pasted above in in multiple places but none seem to work. There are no other lines of code that should influence the filename elsewhere in the script, at least that I’m aware of. Is there a function other than psychoJS.experiment.dataFileName that could be overriding the file naming? TIA!


AFAIK, PARTICIPANT is used when you disable or rename the participant field in the info dialogue at the start of the experiment.

Best wishes Jens

1 Like

Hi Jens,

Thanks, that makes sense! I did change my experiment info to:
let expInfo = {‘a’ : ‘’, ‘s’ : ‘’};

But I thought that adding the new data filename line of code in the post above with those new variables would solve the problem… Any idea why they new line of code I added wouldn’t change the file naming at all?


No, I have no idea. I usually add the variables I need via the Experiment info screen.

Best wishes Jens