Where to trim to remove duplicate empty lines

Hi,

I'm having trouble getting trimming to work in the way I want. I don't want 3 lines of white text using the AWC -> Caller_had_to_go option.

I appreciate this is a bit of a long one and I could have used the import tool, but I want to get this fixed first.

Good {if: {time: H} < 12}morning{elseif: {time: H} < 17}afternoon{else}evening{endif} {data=catch(catch({=extractregex({site: text; page=https://specsavers.service-now.com/; select=ifneeded; selector=macroponent-f51912f4c700201072b211d4d8c26010 |> iframe |> #incident\.u_store_user_name}, "(\w+)")}, {=extractregex({site: text; page=https://specsavers.service-now.com/; select=ifneeded; selector=#incident\.u_store_user_name}, "(\w+)")}), "failed")}{=data},

{note: trim=right}{formtoggle: name=AWC1; trim=yes}{endformtoggle}{formtoggle: name=AWC2; trim=yes}{endformtoggle}{formtoggle: name=AWC3; trim=yes}{endformtoggle}{formtoggle: name=Store_closed; trim=yes}{endformtoggle}{formtoggle: name=RAC; trim=yes}{endformtoggle}

{values=[awc1,awc2,awc3, Store_closed, RAC]; trim=yes}
{numberOfSelectedToggles=count(filter(values, value -> value = yes)); trim=yes}

{if: numberofselectedtoggles > 1}
{error: You can only select one option. Please deselect either AWC1, AWC2, AWC3 or Store Closed.; block=yes; trim=yes}
{endif: trim=right}{endnote: trim=no}

{if: AWC1 == "yes"; trim=right}{formtoggle: name=Caller_had_to_go; default=no; trim=no}{endformtoggle: trim=yes}{formtoggle: name=Backlog; default=no; trim=yes}{endformtoggle: trim=yes}
{if: caller_had_to_go="Yes"; trim=yes}Unfortunately, whilst discussing the issue regarding your {cursor}, the call has disconnected.

The incident will be set to awaiting customer and we will try to make contact again after a minimum of 24 hours has passed to give you an opportunity to respond.

Please follow the below link for your preferred contact method:
Sign in to your account

Kind Regards,
IT Service Desk{endif: trim=yes}{if: backlog="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.

The incident will be set to awaiting customer and we will try to make contact again after a minimum of 24 hours has passed to give you an opportunity to respond.

Please follow the below link for your preferred contact method:
Sign in to your account

Kind Regards,
IT Service Desk{endif: trim=yes}{endif}{if: AWC2 == "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.

This is the second time we have attempted to make contact with you and we will try to contact you again after a minimum of 24 hours has passed to give you an opportunity to respond.

Please follow the below link for your preferred contact method:
Sign in to your account

Kind Regards,
IT Service Desk{endif}{if: AWC3 == "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.

This is the third time we have attempted to make contact with you. We will try to contact you once more after a minimum of 24 hours has passed to give you an opportunity to respond. If we are unable to make contact with you after this further attempt the ticket will be marked as resolved awaiting customer.

Please follow the below link for your preferred contact method:
Sign in to your account

Kind Regards,
IT Service Desk{endif}{if: Store_Closed == "yes"}We have tried to phone you and have been unable to get through to you regarding this incident as your store is closed.

We are contacting you as we need to gather more information to assist with resolving your issue.

Please reference this ticket number if you need to contact us and follow the below link for your preferred contact method:
Sign in to your account

Kind Regards,
IT Service Desk{endif}{if: RAC == "yes"}We have attempted to contact you on three occasions regarding this open incident. This incident will therefore be updated to resolved awaiting customer.

If the issue still remains please contact the ITSD within 5 days or the ticket will be closed.

Please follow the below link for your preferred contact method:
Sign in to your account

Kind Regards,
IT Service Desk{endif}

image

This is where the gaps appear

HI Ollie,

It looks like you have an untrimmed gap between your {note} and {if}:

image

Adding trimming on the right of the end of the note, or the left of the start of the if should help.

You could also add trimming near the start of your snippet at the left of the start of the note:

image

Let me know if that helps.

Hi,

this does have the desired effect but the formatting in the initial pop up isn't that pretty.
But the output is technically more important.

Thank you