REST OUTBOUND MESSAGE JSON FORMAT - ESCAPE CHARACTER BACKSLASH

levino
Giga Guru

Hi There

REST OUTBOUND MESSAGE JSON FORMAT to mid server to runbook

 

i am trying to pass a 

value parameter FolderPath = G:\ak\shared18

it works if the user type in

G:\\ak\\shared18

i still want the user to  type in G:\ak\shared18, is there a way around this

 

do i modify the outbound message to pass thru a escape character

 

Thanks

Levino

1 ACCEPTED SOLUTION

levino
Giga Guru

all sorted , i have used a onload script

View solution in original post

30 REPLIES 30

amaradiswamy
Kilo Sage

Can you post a snippet of how are you passing? . you may use escape character to print black slash in javascript string variable.

https://www.w3schools.com/js/tryit.asp?filename=tryjs_string_escape_backslash

levino
Giga Guru

{
"Name": "Folder Path (e.g. 'G:\\ak\\Shared01'",
"Value": "${FolderPath}"
},

If I understood correctly, you want the user to type only single back slash, but you wanted to pass double black slashes from script?. If this is the requirement then you need to use string manipulation methods.

Example:

var str = 'value_entered_by_user';  

var res = str.replace(/\//gi, "\\\\");

 

thanks , thats correct