Editing a .json property value (adding in json escape \ chars to property value)?
Hi,
I have a REST GET request that returns the following .json from the CRM (below .json is for 1 record - the GET retrieves multiple records)
{ "@odata.type": "#Microsoft.Dynamics.CRM.whatever", "@odata.id": "https://XXXX.dynamics.com/api/data/v8.2/whatever(a038fae4-ef43-e811-811f-5065f38b03d1)", "@odata.etag": "W/"3859692"", "@odata.editLink": "whatever(a038fae4-ef43-e811-811f-5065f38b03d1)", "activityid@odata.type": "#Guid", "activityid": "a038fae4-ef43-e811-811f-5065f38b03d1" }
Now I need to grab the attribute values and submit them in a subsequent POST request via a property transfer - I have a property created for each .json attribute.
The problem is the "@odata.etag" value. I need to alter thee value because it has double quote characters (e.g. ") in the value - so I need to escape the double quote chars using a \ symbol
So "W/"3859692"" needs to be altered to "W/\"3859692\""
I'm at a bit of a loss how to do this - the value is currently stored in a property as "W/"3859692"" - I just have no idea how I'd go about inserting the escape characters into the property value.
Any ideas?
As always - thanks to all for any advice, guidance, tips, help that anyone can give me!
Cheers,
richie