Skip to main content
Question

Set variable value for specific mode


Chris_Petzny

Hello,

my prototype contains a set of three cards representing three scenarios. Each has a string variable for label, description, type and ID and there is a mode for each scenario. They also all contain two other string variables which can be changed by selecting values from a dropdown, but the same value is shown all three modes.

For some reason those variables can only be changed for the default mode. So I was wondering if I can set them for the other modes somehow?

Or is that not how modes are supposed to be used?

Cheers,
Chris.

10 replies

Brian1
  • 3 replies
  • July 18, 2023

I am having the same issue. I want to set a variable for a specific mode with a prototype trigger and it doesn’t appear to be possible to select a variable from a mode to set.

You can set the default value to a mode variable value but you can’t select a mode variable to set.


Bruno_Mattelet1

I tried to do the same and can’t find a way for the moment…

I also try to implement some variables from modes in condition etc but you can’t target a variable from a specific mode at the moment 🥲

It’s not planned in the features improvements for now but let’s trust FIgma and wait for a while 💜

Figma Help Center

Richard_Doyle1

Same problem, you can set a variable from the current mode to the value in another mode, but can’t set the value in another mode. Boo.


Natalie_Mae
  • New Member
  • 10 replies
  • November 25, 2023

Facing the same issue. I can’t figure out on what conditions can I specify the mode of the variable! So right now even with the same 3 scenario modes, my prototype only allows me to select ‘ExistingPlan’ but I cant specify to change it for a specific mode, so not sure which toggle is being switched or if they’re all being switched.


Sofie
  • 12 replies
  • May 29, 2024

I am also having this issue. How is this not fixed? 😕


Jay-TGG
  • New Member
  • 2 replies
  • February 18, 2025

I’m having the same issue a year later. I’ve created a component that uses variables and modes like in Figma’s shopping cart examples, and if I have a ‘status’ indicator within the component, I can’t set the status value for a specific mode using a prototype interaction 😢


Jay_Flaxman
  • New Member
  • 3 replies
  • February 18, 2025

I’m having the same issue a year later. I’ve created a component that uses variables and modes like in Figma’s shopping cart examples, and if I have a ‘status’ indicator within the component, I can’t set the status value for a specific mode using a prototype interaction 😢


dvaliao
Figmate
  • Community Support
  • 4664 replies
  • February 21, 2025

Hey All, thanks for the feedback! 

Right now, this is expected behavior. You currently cannot set a variable value for a specific mode. In Figma, especially when using interactive components or prototyping features, you can't perform multiple actions (like setting a variable and changing the variable mode) in a single interaction (e.g. "On Click") natively within one step.
 
Here's why:

  • Setting a variable: In Figma prototypes, you can set a variable (like updating the value of a text variable or changing a state).
  • Setting variable mode: Changing the mode (essentially switching between different states or appearances of a component) is a separate action.


Currently, Figma requires separate actions or interactions to handle each behavior independently. You would need to work around this by chaining interactions (i.e. using multiple triggers like "On Click" → Set Variable, then using a subsequent interaction to change the variable mode). The workaround we'd suggest here is to set multiple interactions: Split the desired action into multiple interactions (one for setting the variable and another for changing the mode).

That said, we’ve updated this topic into a feature request for our Prototyping team and Variables team to consider for future improvement. 


Bauke_Schildt
  • Active Member
  • 57 replies
  • February 24, 2025

Another (hacky) way of making this work is storing your States in a separate collection (Without Modes):
 

Name Value
StateOne On
StateTwo Off
StateThree Off



And in your Collection with Modes call the alias for the corresponding state:
 

Name Mode1 Mode2 Mode3
State [T] StateOne [T] StateTwo [T] StateThree



 


Jay-TGG
  • New Member
  • 2 replies
  • February 28, 2025

Thanks ​@dvaliao. I personally didn’t need to change mode, just set the variable of the specific mode. Just like you can check the variable of a specific mode with a conditional interaction by selecting the variable and then keying back to it and selecting the specific mode. I was thinking the UI of setting the variable in a specific mode would work in the same way.

@Bauke_Schildt I’m pretty sure I did exactly that as my workaround, but thanks so much for the suggestion, very kind.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings