Hi,
How can I convert the below dictionary-
Discussion posts and replies are publicly visible
What is your use case?
If you really need to do that, you can do a toJson() followed by a substitute() call to replace " with \".
Feels like you want to escape a JSON string. For this you would need to escape more characters.
docs.microsoft.com/.../how-for-json-escapes-special-characters-and-control-characters-sql-server
Yes I want to escape the quotes in json string. Will the substitute function will help achieve this?
The information helped. Thanks Stefan.
Hi Vivek
Please try the below code which is closer to your output.
a!localVariables( local!data:{ {name:"Vivek", place:"XYZ"}} ,local!final:substitute(insertkeyval("name",local!data["name"],"\","\"),"=","\:\"),local!final2:substitute(insertkeyval("place",local!data["place"],"\","\"),"=","\:\"),local!data2:concat(local!final,",",local!final2),local!data2
)
sample output "\name\:\Vivek\,\place\:\XYZ\"