Skip to main content
Mar 28, 2024 3:58 AM UTC
Solved

Cycling TextStrings using Modes and a Single Action Button

So I built some conditional variables to cycle through some text strings. My example is switching languages. English to French to German, and finally to Spanish, and then it is supposed to cycle back to English.

Everything is working except when I want the text to circle back to English. The number values seem to circle back to 1 but not the Modes. I don’t understand what I am doing wrong. Can someone help?

The link to the test is below.

Figma – 26 Mar 24
This topic has been closed for replies.
nikolasklein
nikolaskleinSolution
Figmate
Apr 4, 2024 5:08 PM UTC

Hey Charles!
Thanks for these videos! Two things I wanted to share…

  1. Doing something like Set language to language:Mode2 just sets the value of language in Mode 1 (cause that’s the Mode that your prototype is in) to the value of Mode 2.

e.g., the values of your variables are
Mode 1 — Language: English
Mode 2 — Language: French

After executing Set language to language:Mode 2, you will get:
Mode 1 — Language: French (cause you replaced this value with language:Mode 2
Mode 2 — Language: French

So in your case it wouldn’t actually help to have e.g., color:Mode2 as that would do the same thing; override the value of the variable in the Mode of the Prototype.

–

  1. That being said the way to fix this would be to have an action that switches the Mode of the prototype to a different Mode. That’s something we’re working on!

The setup would then be sth like this…

  • If val == 2
    • Set Mode: Mode 2
  • If val == 3
    • Set Mode: Mode 3
      …

The behavior would then be that the prototype changes into this other Mode, making all variables that relate to that change their value. — It’s the equivalent of changing the mode on the page between Mode 1, 2, or 3…

We don’t know yet, when that will land exactly, but yeah, we’re working on that as the solution for your problem.

11 replies

Apr 4, 2024 5:50 PM UTC

@nikolasklein, Yeah! That would be totally what I would want in this feature! If you are building this that is extremely useful!! I can’t wait to see this feature. Excited to see this!