Set a string variable to the currently set value (not the default) + another string

Hi,

Does anyone know if the following is possible:

Set a string variable to the currently set value (not the default) + another string.

For example. I have a frame and text, the text is chained to a variable and it has a default value=What do you want? Then I have two buttons that when pressed will set some string to that variable, button 1=ice cream , button 2=coke. I want to check and if the variable string equals the default value of “What do you want?” either button to set the corresponding string value, else to append the string value to what is currently set?

Thank you

Hi there,

Thanks for reaching out. I made a sample prototype to see if I am understanding correctly.

It seems we currently doesn’t support interactive variables or conditional logic in the way Unfortunately, it seems Figma currently does not support interactive variables or conditional logic in the exact manner you described. However, I attempted to create a workaround. As shown in the prototype, you can add some strings to the variable in this manner.

Please note that the item count is in a separate frame, allowing me to apply a different logic to it.

I hope it helps but please let me know if my understanding is correct or not and add some important missing points!

Thanks,
Toku

Thank you @y_toku , hopefully this will be added to variables, in the meantime I will try to find a workaround.