Skip to main content
Solved

Conditionals with Variables not working

  • October 16, 2023
  • 1 reply
  • 792 views

Keitel_Oliver

Hey everyone,

I’m currently trying to control different frames using conditional statements in Figma. To do this, I’ve created a variable named “Beleg count.” The idea is that in another part of the prototype, I want to set the variable to a fixed value (1, 2, or 3) using a button, and depending on the variable’s value, I want to navigate to a different window here. My issue is that the “Default” (Explorer 0 DUo) frame is always being opened, and the entire set of if conditions never seem to work. Have I done something wrong?

Best answer by uxcal

Hi there,
Your last conditional reads if “Belege Count” is 3 then swap overlay… else swap overlay to “Explorer 0 DUo”.
This means that if “Belege Count” is any other number but 3, then the overlay will be “Explorer 0 DUo”. I think since it is declared last, that conditional will overwrite the other conditionals above. Because code is typically read from top to bottom.

View original
This topic has been closed for replies.

1 reply

uxcal
  • New Participant
  • 34 replies
  • Answer
  • October 16, 2023

Hi there,
Your last conditional reads if “Belege Count” is 3 then swap overlay… else swap overlay to “Explorer 0 DUo”.
This means that if “Belege Count” is any other number but 3, then the overlay will be “Explorer 0 DUo”. I think since it is declared last, that conditional will overwrite the other conditionals above. Because code is typically read from top to bottom.


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