Completion code strategy / shelf value to index list

Hi all, I have a long list of unique completion codes in a csv file. I was hoping to use a shelf participant counter variable to index this list at the end of the experiment and retrieve a code to pass along to the exit URL. Does anyone know the best way to index a csv list in this manner? I’m open to alternative methods as well if this isn’t feasible. Many thanks.

You could use search and replace in a suitable editor to turn your csv file into a list and then paste that into the shelf entry. You can then access the list and read the correct entry using a participant counter.

If the list doesn’t change then you could store the list in the experiment itself and only use the shelf (or one of my tools) to set the participant number

Great–the list doesn’t change and although I think it might be too long to paste into the experiment script it seems to work when adding it directly to a new shelf list record.

So if I have one integer shelf counter for completed sessions, could I use it to directly index into the list shelf element in a single line, or would I first use psychoJS.shelf.getListValue to retrieve the entire list and then index the single value subsequently within the code component (I think that’s what is happening in the ‘players’ example on the shelf page?)? It’s potentially a fairly long list of codes for a large study.

Thanks for the suggestion.