Variable to read in csv in loop

URL of experiment:

Description of the problem:
Are you no longer able to use $csv_variable in the loop conditions box to specify which csv to read in? It used to work, but now I cant get it to work even in simple scripts designed to test it (it works fine if i put the csv direct name in there though)

thanks for reply, but I’ve tried that and that’s not the issue (also the $ isn’t in the conditions box).

Are other people able to do import a csv in loop via a variable??

I use variables to import Excel files in 2020.2.10. Please could you check Excel in case it’s a CSV issue ?

tried. No luck :frowning:

practfile = “PracticeBlock_Neutral.xlsx”;
and then $practfile in conditions. Same error (I’ve also tried moving the code to earlier in experiment/start of experiment.

works perfect when I put the filename in directly

Yes I found importing with variables used to work. Seems No longer in PsychoPy 2021.1.2

Try 2021.1.3 which I know has a lot of bug fixes.

Personally I’m waiting until 2021.1.4 before I upgrade from 2020.

ok cheers. Really does seem like a major issue as its the best way to counterbalance.

Actually your issue may be that you simply need to add the files in Experiment Settings / Online. I was probably too quick to point the finger at the version.

oh interesting - to “additional resources needed”? will try in morning, thank you

couldn’t wait till morning. It works!
I never had to use that box before and forgot it existed.
You’re a legend, thanks a lot

1 Like

This solved my issues. My nested loops were runnig ok in Psychopy but not online - when I deleted dollar sign in inner loop (field nReps$) it is runnig OK also online. Thanks!