Multiple Boolean Variables and Modes

I’m unclear on how I’m supposed to properly utilize multiple booleans combined with modes to manage visibility states for multiple component instances.

I have a list of 4 rows (which are mapped to 4 modes). These rows exist on a shopping cart summary page and are hidden by default. As I press buttons in another part of the app, I want to add them to the shopping cart page and toggle their visibility.

I can get this to work by making a separate collection called “List Row Visibility” using one mode with 4 unique boolean variable names, but I feel like this is messy and I would rather have all my row visibility variable definitions tied to the list row collection and its 4 modes that I already set up.

Inside conditional statements, Figma does offer a way to target specific variable modes when setting variable values, but it doesn’t seem to work the way I think it should. At least not for booleans anyway…

Click on any variable name that you’ve used in the interaction.
From the Modes dropdown menu, select a specific mode of that variable.
Once you’ve selected a mode, the variable is represented with both the variable name and mode name:
Select mode definitions in prototype actions

However, when I try to set the boolean of a particular mode from false to true, it only works for the first mode and none of the subsequent modes that follow. (modes 2-4)

What am I missing? Am I using this feature wrong?

CleanShot 2023-07-18 at 01.29.08

CleanShot 2023-07-18 at 01.16.14

1 Like

I am also having the same problem. Would like to target different columns with different mode from the Conditional Logic.


I also need this, but also just wanted to say that even if it was possible the way you are going about it would not work.

What you are doing here is setting “isHidden” that is connected to the mode of the button, to the state of “isHidden: Item 1”. Not sure how the final part actually works but either you are saying that “only if isHidden: Item 1 is true”, the set it equal to the variable, or it’s just setting it to true regardless and that entire statement i essentially equal to “Set variable: isHidden == true”

In any case, here the first variable is always what you want to change and the second is what you want to change it to. No matter what variables you place in the second part they won’t have any effect on those variables used there, only the one placed in the first part of the expression

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.