Different workflows on collection bound items

Hello,

I have these different activities in Divs with a text and emoji as shown. These are all bound to a Xano collection that changes when I load the page (what changes is the text and emojis but not the number of “divs” which is 15).


My question is can I change each workflow individually to make them change color when of the options is selected ? Right now they all change when I click one. Is there a workaround for this use case ?
When clicked:

Because the number is fixed, I know I can just create duplicate to 15 divs and only bind their emoji and text 15 times and then assign them each variables. But in case I wanted to know if there was an easier way to do it?
The answer could be “no” :slight_smile: thank you for helping!

Elliot

of course you can, you just need to keep track of what is selected in a variable. You can use an object or an array, and handle the value update with a workflow on click. this example shows how you can do it with an array, it uses checkboxes, but it’s the same logic, on click check if the value is present or not and remove/add the value from the variable. My preferred method is using an object in a way similar to this example, it uses forms and inputs but you can get how it works. You need an unique id for every button and on click you set yourvariable[id] to not(yourvariable[id]), now if yourvariable[id] is true the button is selected.
The important thing is that your condition needs to be bound to something unique that identifies the button

1 Like

Thanks for your answer !

1 Like