I am trying to use the if, else function with results as text but get the error that the it cannot be converted to a number. Any clues?
Hi @tonyd,
Please share your snippet after redacting any confidential information.
Sorry, I’ve undone the change I made so can’t. Just wondered if there were any specific requirements you needed to get text output. Thanks
Sorry, but I'm not able to understand your use case.
Please share what you're trying to accomplish so I can assist you.
You can also refer to the documentation on if-else here.
I had a drop-down menu of three items. The if statement asks if the chosen item contains “24”. If Yes, output some text Else output other text
I have created a snippet. Let me know if it serves your purpose.
{note}{formmenu: 12; default=24; 48; name=item}{endnote}
{if: item=24}You selected 24.{else}You selected something other than 24.{endif}
Thank you but the menu options are three strings of text, one of which is blank and another which CONTAINS “24”
Is it something like this? I used our contains function to check if a string contains another string as a substring.
{note}{formmenu: ; default=some text 24; 48; name=item}{endnote}
{if: contains(item, "24")}You selected string containing 24.{else}You selected string not containing 24.{endif}
How can I view the code behind the snippet above
Sorry, I believe I didn't fully understand your question.
You can find our documentation here: Text Blaze | Using Dynamic Commands.
Please feel free to contact our support team at support@blaze.today or post your questions in our community forum: https://community.blaze.today/.
Sorry, the documentation doesn't state if I can view the code behind the snippets e.g. {formmenu: ; default=Royal Mail Tracked 48 @ £3.55; Royal Mail Tracked 24 @ £4.45; name=options} {if: contains(options, "24")}"It should arrive tomorrow" {else}"It should arrive in 2 or 3 days" {endif}
Hi @tonyd,
You can view the contents of any command within your snippet by uncollapsing it – simply double-click the command. For instance, I've double-clicked the formmenu command here.
Thank you
