Snippet formatting, trim function isn't working as I'd hoped

Hi all,

I have created a snippet but I am having trouble with the formatting for the user.

Thanks for raising a ticket through the self service portal.

{formtoggle: name=Did you call?}{endformtoggle}
{if: `Did you call?` == "yes"}We have tried to phone you and {formmenu: have left a voicemail; default=have been unable to get through; have left a message with a store colleague} regarding this incident.{endif}

Based on your detailed description we need some more information about your {formmenu: default=Hardware; Software; name=steps} issue.

If the "Did you call?" toggle is off it will leave a gap in the inserted text
textblaze gap

Adding the trim to the commands doesn't format the popup as nicely as this:
textblaze popup

Any ideas how I can keep it looking nice but without the gap?

Copying the snippet didn't keep the '' around the Did you call? but it definitely works.

Hi @OllieJS ,
You can add contents inside {formtoggle} directly and avoid {if}. This should resolve the white space too. Please let me know if this works

Thanks for raising a ticket through the self service portal.

{formtoggle: name=Did you call?}We have tried to phone you and {formmenu: have left a voicemail; default=have been unable to get through; have left a message with a store colleague} regarding this incident.{endformtoggle}

Based on your detailed description we need some more information about your {formmenu: default=Hardware; Software; name=steps} issue.

Hi Vinod,

Sadly not. If I didn't call the store and then insert into a ticket it still leaves a 3 line break in the message :frowning:

Can you please add a screenshot of the expected behavior from this snippet?

The first screenshot in this message is what I am getting.

The expected outcome would be a single line between the top and bottom sentences, not three to five.

hey Oliver,
Is this what you are looking for ?

Thanks for raising a ticket through the self service portal.
{formtoggle: name=Did you call?}We have tried to phone you and {formmenu: have left a voicemail; default=have been unable to get through; have left a message with a store colleague} regarding this incident.{endformtoggle}{note}
{endnote}Based on your detailed description we need some more information about your {formmenu: default=Hardware; Software; name=steps} issue.

If not, please provide expected screenshots for both Did you call? turned on and turned off.

Here's a screenshot of the outcome I would like if we don't select the "Did you call?" option:
did you call - no

When we select the "Did you call?" button the desired output would be:
did you call - yes


Unsure if this formatting is available with Text Blaze currently but this isn't what I'm expecting:

did you call - formatting

Hi @OllieJS ,

Thanks for raising a ticket through the self service portal.{note}
{endnote}{formtoggle: name=Did you call?}

We have tried to phone you and {formmenu: have left a voicemail; default=have been unable to get through; have left a message with a store colleague} regarding this incident.{endformtoggle}

Based on your detailed description we need some more information about your {formmenu: default=Hardware; Software; name=steps} issue.

I believe this is what you want!
Used {note} for a new line so you can have better way while filling form.
Inserting second line with new lines only when needed.

Hi! I believe you were close in your original snippet, but I did a small edit (also removed endtoggle as it's not needed for this, and edited the toggle name due to error).

Thanks for raising a ticket through the self service portal.
{formtoggle: name=Did}{if: did == "yes"}
We have tried to phone you and {formmenu: have left a voicemail; default=have been unable to get through; have left a message with a store colleague} regarding this incident.
{endif}
Based on your detailed description we need some more information about your {formmenu: default=Hardware; Software; name=steps} issue.

Almost there!

The output of the toggle appears in the snippet whether it's selected or not.

Just need to be able to turn this off?

Hi Oliver,

Did you see Vinod's most recent response? I believe he solved the issue with this snippet:

Thanks for raising a ticket through the self service portal.{note}
{endnote}{formtoggle: name=Did you call?}

We have tried to phone you and {formmenu: have left a voicemail; default=have been unable to get through; have left a message with a store colleague} regarding this incident.{endformtoggle}

Based on your detailed description we need some more information about your {formmenu: default=Hardware; Software; name=steps} issue.

If the toggle field is not selected, there is only 1 line of space between the first and last items. If it is selected, there is 1 line between each of the three.

Please let us know if that's what you're looking for.

I missed his update!

Yes this is working as intended, amazing work! Thank you

1 Like