Retaining JSON Output in String

Hi All,

I am making an API call to get a value, this value is the HTML Body of an email containing a couple links.

My problem is when I get the item successfully, and output as string (to manipulate later) it removes '\' character, which causes subsequent issues in the next call I am using after changing this string to a new body API Call.

EG:

</p><p><br></p><p>Please respond to this email or contact us <b><a href=\"https://hello.com/app/contact_us?launchMessenger=Category=unauth-123123\" target=\"_blank\" rel=\"noreferrer\">via messenger</a></b>

The above is what I want, but when I get as a string I get the below:

</p><p><br></p><p>Please respond to this email or contact us <b><a href="https://hello.com/app/contact_us?launchMessenger=Category=unauth-123123\" target="_blank\" rel="noreferrer">via messenger</a></b>"

Without the \

Any idea how I retain these in the string?

Thanks!

What you get is correct HTML.
You want it to be quoted, so use this function:

1 Like

Thanks for that @moenk - although it now adds in backslashes for each word, and the backslash where I need it is still missing. I don’t think I’m using the method correctly, Regex.Escape(item(“value”).ToString) is what I’m using… Any further thoughts?