Randomizing Grids

**PsychoPy version: 2022.1.4


I am trying to create a task in which participants are presented with an English letter on a grid. We have white letters with a dark background and dark letters with a white background. I want these grids to be assigned randomly. But in the next step, where the stimuli are going to be presented on the randomly chosen grid, I need to present the participants with the very type of grid that was randomly presented in the previous trial. So, let us suppose that the type #1 grid was randomly presented in the first trial; now the second trial should look at the first trial to see which type of grid was presented and choose the same type for the second trial as well.
How can I make the second trial align with the randomized types of grids that were presented in the first trial?

If both routines are within the same loop then the row chosen will persist across them.