Present image from Excel file if condition is met

OS: Win10
PsychoPy version: 2020.2.5
**Standard Standalone?: Yes
What are you trying to achieve?:

I am trying to display an image from my conditions file if a condition is met. Basically, I am programming an experiment that runs through sequences of numbers, 1-10, randomly, or according to a pattern. I have 10 images in my conditions files, one corresponding with each number. When number 4 is on screen, for example, I want to display the 4th image in my conditions file. When number 9 is on screen, I want to display the 9th image, etc.

What did you try to make it work?:

I tried adding index numbers to the conditions file with all the image paths and then using if statements in code components to try and call a specific image if the condition in the if statement was met (that number is displayed on screen).

What specifically went wrong when you tried that?:

The images are being called randomly and are not associated with the index numbers in the adjacent column in the conditions file.

You just need one column in the conditions file for the numbers, and another for their paired images. No code is necessary: Builder knows that values in each row of a conditions file are associated with each other. Use the loop dialog settings to present the rows randomly or sequentially as required.

This is the way Builder is designed to work. If you aren’t getting that result, then you must be fighting against it in some way, presumably with the custom code you mention.