Different condition file in one loop

Hello,

OS (e.g. Win10): W10
PsychoPy version (e.g. 1.84.x): 2023.2.3
Standard Standalone? (y/n) y
**What are you trying to achieve?: try to load different condition file in one loop

**What did you try to make it work?: I try to define a condition file depending the loop number with trials.thisN variable in the script condition_choice (see image) and i specify my variable in the trials properties condition (see image).


**What specifically went wrong when you tried that?:Here is the error message:
trialList=data.importConditions(‘conditions/’+conditionFile),
UnboundLocalError: local variable ‘conditionFile’ referenced before assignment
################ Experiment ended with exit code 1 [pid:14924] #################
5250.7414 WARNING duplicate variable name(s) changed in loadFromXML: condition_choice

Thanks for yout help!

You can’t change the spreadsheet once the loop has started.

You can change which column you are interested in, for example:

thisImage = Congruent
if trials.thisN % 2 == 1:
     thisImage = Incongruent

Hello Wakecarter,
Ok, thanks, i 'll implement in one spreadsheet.
Best,