Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Replace '\' with '\\'

Cindy Sim
Tera Expert

I need to replace '\' with '\\'. How can we do it? Currently I am using :

replace("\", "\\"));
10 REPLIES 10

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Where do you want to apply this?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

I am using it in json payload

 

Where?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

"{\"firstName\":\"John\",\"lastName\":\"Doe\",
\"executiveSummary\":\"Below, you will find a proposal, etc. etc.\",
\"products\":[{\"name\":\"test product\",\"quantity\":5,\"price\":10,\"total\":50},
{\"name\":\"Creatice Name\",\"quantity\":10,\"price\":20,\"total\":200}]}",
}