Extra spaces and line break after inserting snippets

I am extracting information from google sheet and using these info as dropdown. However, when I select the options and execute it, it comes with extra spaces and extra line break.

  1. I have kept trim function but still extra spaces.

  2. While executing snippet. If you see, there is space between word and comma, which is not required.
    image

  3. Output with extra space and line-break. Cursor is coming in next line.
    image

I am not really sure whether this is because of google sheet urlload command or I am not doing trim properly. @Cedric_Debono_Blaze Thanks

Sometimes this happens with Snippets my teams and I use in Salesforce Lightning. The solution I implemented was to put a {key:backspace} command to get rid of the line break. Sometimes we need to get a little creative and combine it with an arrow key command or 2 to get it to work how it must in a particular field. Salesforce is notorious for fields behaving differently despite them looking the same on the surface.

Hope this idea helps spark a solution for you!
-Brad

2 Likes

Thanks Brad, that's really creative thinking. I never had a thought like that.

1 Like

Before your {endnote}, can you add this:

{current_options_trimmed = map(current_options, x -> trim(x))}

Basically, this trims each item in the list manually. Then use current_options_trimmed in your formmenu. Hopefully this will work.

3 Likes

Thank you Gaurang, that worked. One last thing, there is extra line-break before the sentence as well? how do I remove it? E.g. above Anxiety worsening....

Might be due to the snippet layout itself. Try putting the chips in the snippet consecutive to each other (next to each other on same line) or try putting trim=yes in some of them that are near the line break.

2 Likes

Thanks. That's what I thought and it worked. Thank you for all your help.

2 Likes

You are welcome, glad I was able to help :slight_smile:

1 Like