Iterate through elements on the page

I have 63 similar elements on page (buttons). I’m using recurring elements to show them. These buttons each open a popup to show user some information (like a table).

The problem is, I would like to disable a big bunch of them depending on a parameter of the user viewing the page. Let’s say this parameter is called “allowed to open 4th to 7th column”. This parameter gets changed elsewhere, so I need to mark 36 buttons available or not (depending the state of that parameter).

It feels really tedious to create 36 identical workflows for these buttons, the only thing differing would be the particular button I’m allowing or disallowing. Plus if I need to change anything, I would have to do it 36 times every time.

Could it be possible to loop through these 36 items somehow and just change the target element?

Can you show it with an example… From the question, i think it can be achieved by creating conditions for buttons with index of cell