I need to make a webservice call with nested jsons in the parameters. Has anyone successfully done it? I tried using a!toJson within another a!toJson with no success.
a!toJson( {"name":"Document C", "type": a!toJson({"fields": a!toJson({"name":"Bob","type":"identification", "subtype":"FULLNAME"}), "role":"user", "id":"xxx"}), "id":"xxxxx", "extract":true})
result:
"{"name":"Document C","type":"{\"fields\":\"{\\\"name\\\":\\\"Bob\\\",\\\"type\\\":\\\"identification\\\",\\\"subtype\\\":\\\"FULLNAME\\\"}\",\"role\":\"user\",\"id\":\"xxx\"}","id":"xxxxx","extract":true}"
The "\"s are showstoppers.
Discussion posts and replies are publicly visible
Are the slashes the only issue? If so, you could use the stripwith() function to remove them.
{"name":"Document C","type":{"fields":{"name":"Bob","type":"identification","subtype":"FULLNAME"},"role":"user","id":"xxx"},"id":"xxxxx","extract":true}
a!toJson( { "name": "Document C", "type": { "fields": { "name": "Bob", "type": "identification", "subtype": "FULLNAME" } , "role": "user", "id": "xxx" } , "id": "xxxxx", "extract": true } )
the result will be this :
"{"name":"Document C","type":{"fields":{"name":"Bob","type":"identification","subtype":"FULLNAME"},"role":"user","id":"xxx"},"id":"xxxxx","extract":true}"
In case you have tried this without success please let me know more about the scenario
Best regards
Jose Perez