Skip to main content
Question

Boolean variables within variables not working as planned

  • April 29, 2024
  • 1 reply
  • 188 views

gabr.polly

Hello everyone, I’m currently facing some difficulties with handling variables and I’ve run out of options. Here’s the scenario:

I have three variables, each in a different collection. The first variable is named ‘Category’, and its value depends on another variable called ‘Type,’ which can be either ‘Normal’ or ‘Queue’. When ‘Type’ is set to ‘Normal’, its value is true. When ‘Type’ is ‘Queue’, it references another variable called ‘Waiting Queue’, which defaults to false.

Moving forward, I created a base component named ‘base_card’ and another component from ‘base_card’ called ‘cards’ with two variants: ‘A’ and ‘B.’ Both are linked to the ‘Category’ variable. However, variant ‘A’ is set to Auto Mode, and variant ‘B’ is set to the ‘Queue’ mode of the ‘Type’ variable.

Additionally, I created two buttons: ‘Filter’ and ‘Toggle’. I linked the ‘Filter’ button to the ‘Category’ variable and the ‘Toggle’ button to the ‘Waiting Queue’ variable.

Upon starting the prototype, the components and variables function as intended: card ‘A’ is visible, and card ‘B’ is disabled. When I click ‘Toggle’, card ‘B’ becomes visible and then disappears when clicked again. However, when I press ‘Filter’, both cards disappear, even if ‘Toggle’ is active and this is intended. Moreover, once I reactivate ‘Filter’ the ‘Toggle’ button no longer functions correctly: card ‘B’ will always appear. Does anyone have any insights into what might be happening?

P.S.: I also tried linking the visibility of ‘cards’ to the ‘Category’ and linking the nested ‘base_card’ to ‘Waiting Queue.’ This approach works, but the container for card ‘B’ still exists, leaving an empty slot in an auto layout, which I want to avoid.

This topic has been closed for replies.

1 reply

y_toku
Figmate
  • Community Support
  • 2490 replies
  • May 1, 2024

Hi there,

Thanks for reaching out. I’m trying to replicate the issue, but probably I’m not fully understanding how you set up the variable and components.

So, would you be able to share the file link with access to support-share@figma.com? It won’t affect your billing. I hope I can investigate it further.

Thanks!
Toku


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