Powered by
Troubleshooting Strings Variable Reset Issues
# 🤝help
e
early-shoe-82728
07/16/2024, 3:46 PM
Hi, I'm currently facing a problem for which I have no solution at the moment. I am using a Single Choice Card with the option "Skip if variable is already filled." Let's say workflow.scPriceRangeSelection has been set in the All Variables panel. The problem arises when it works the first time, but if the user doesn't finish the flow (for any reason, which is not important here) and I move them back to the start to make the selection again, it skips the Single Choice card. To address this, I decided to create a node that resets all variables, but I can't find a way to reset strings. Here are the methods I've tried and the errors I encountered: 1- I can't use null; I get the error: Type 'null' is not assignable to type 'string'. workflow.scPriceRangeSelection = null 2- I can't use undefined; I get the error: Type 'undefined' is not assignable to type 'string'. workflow.scPriceRangeSelection = undefined 3- I can't use an empty string ''; the system thinks the variable is filled and moves forward without posing the question to the user. workflow.scPriceRangeSelection = '' 4- I can't use 'let' to redeclare the string; I get this error: Cannot redeclare block-scoped variable 'workflow'. let workflow.scPriceRangeSelection Do you have any ideas on how to reset it so that when the user reaches the Single Choice Card, it doesn't skip over and asks the question as intended?
https://cdn.discordapp.com/attachments/1262797396669104220/1262797397172682803/Screenshot_2024-07-16_at_11.42.43_AM.png?ex=6697e739&is=669695b9&hm=6e2cdf89d8aba5fb21ffb184614ba3ed7dd0a2a7d6c2d609e0fb9fce0f8c1c0b&
https://cdn.discordapp.com/attachments/1262797396669104220/1262797397386461265/Screenshot_2024-07-16_at_11.43.45_AM.png?ex=6697e739&is=669695b9&hm=8b59d585558e106f48979ff97f550bd49fc8c2be95990911618dbb42f197c5aa&
https://cdn.discordapp.com/attachments/1262797396669104220/1262797397772210176/Screenshot_2024-07-16_at_11.43.59_AM.png?ex=6697e739&is=669695b9&hm=34ea7102f58b30be1d16123d3cea61413659f156425523affd2fba30c23cdcf9&
s
shy-restaurant-12733
08/01/2024, 4:17 PM
what I did is create extra variable called emptystring. I never assign any value to this and whever I want to reset I execute code workflow.variableIwantToReset=workflow.emptyString
Previous
Next