Skip to main content
Question

"Navigate To" is not working inside of a conditional interaction


I want an if statement where two booleans are true, in order to navigate to another artwork, when a button is clicked.

In my design, when the user clicks “match file” I want my prototype to check first if two of the booleans are true, before it takes me to another artwork.

so, inside of my component, I created a conditional interaction:|

if boolean1 === true and boolean2 === true
navigate to “flowerror”
else
navigate to “home”

when i copy and paste this component in my art work and click on play to see the prototype, it doesnt work. what am I doing wrong? please advice.

7 replies

Nate_G
  • Power Member
  • 180 replies
  • October 5, 2023

For “equal to” make sure you are using “==“ vs “===“.


  • Author
  • 5 replies
  • October 5, 2023

yes, sorry it is “==” but it’s still not working 😦
image


Nate_G
  • Power Member
  • 180 replies
  • October 5, 2023

When and where are you setting the booleans to true or false? It could be one of those booleans is not being set to true before the on click is called.


  • Author
  • 5 replies
  • October 5, 2023

So, first I set them to either true or false when clicking a checkbox:
image
image

then, when I click a button on a dropdown menu, I want to check if two of those variables are true:
image

then I copy the dropdown component into my artwork (the checkboxes are already there) and when I test it in the prototype, it doesn’t work 🤷‍♀️


Nate_G
  • Power Member
  • 180 replies
  • October 5, 2023

Thanks for sharing. In your example, I see row1 being set, but where do you set the variable “row2” do you use another checkbox for that? If you share the file view only, I could dig in more to see what’s up.


  • Author
  • 5 replies
  • October 5, 2023

yes, I created two separate checkboxes and gave them each a boolean variable. checkbox1 has row1 boolean and checkbox2 has row2 boolean.
Let me recreate the problem on another Figma prototype so I can share it since this one in particular has proprietary info.


Nate_G
  • Power Member
  • 180 replies
  • October 5, 2023

Here is a rough example based on what you showed. Hope it helps.

View Prototype
View File


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