New line characters in json

I have a json file that holds strings

I am using the variables that holds these string to send email
I need to insert \n after each sentence

For eg: in json
“Dear User, Please check for errors.Please add correct format”

Expected output

Dear User,
Please check for errors.
Please add correct format.

Tried Using like below,but not working

“Dear User,”+vbCrLf+vbCrLf+“Please check for errors.”

1 Like

@Teenu,

I don’t understand it completely , sorry for that.

Can you try sending hot key enter in the string wherever you want, so that it will enter the data into new line…

1 Like

json file has:
“attachmentNotes”:“Dear User,No Attachment(s) found.Please provide attachment”,

And am using the string attachmentNotes while sending an email in the body
In the email it should come as:
Dear User,
No Attachment(s) found. Please provide attachment

So, if you are getting directly from JSON activities in studio, then we don’t have any chance to do that…

But if your string will have the same format, then you can do that by splitting.

  1. Use two variables … Assume str1 and str2
  2. assign str1 = entirestring.split(","c).First()
  3. str2 = entirestring.split(","c).Last()
  4. Then in the email enter the string as str1 [k(enter)] str2

Hope this helps @Teenu

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.