Hello community,
Have a SetVar shapedata for custom text input shape and need in the background to add an extra character.
The user will only type <user input> but the SetVar should set the variable to example: # <user input>
Tried: SetVar - <variable name>:# <user input>
Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 14th July 2023
Hi Sergio,
I see two options here:
- Session variables are typically used in other shape data by using a '[var:MyVariable]' placeholder. You can directly add the prefix in the shape data: '#[var:MyVariable]'. This means your session variable itself does not have the prefix but the shape data where that variable is used will have it.
- Use approach #1 and save it in another session variable (see docs).
Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 14th July 2023
Indeed, you could use the ‘RegexReplace’ functionality to replace a single hashtag (^#$) with an empty string as a workaround for that.
Hi Sebastiaan,
Thanks for the trick.
I tested and indeed #1 and #2 worked.
Have just an edge case, if user does not reopen the card and instead clears the text box, the prefix will not be removed on the new variable.