Hi All,
I have requirement which i need to convert below mentioned JSON format to..
{ "requestId": "221a0000-faff-00e3-ac11-dbe6ebd00d00", "sourceSystemName": "ABCD", "requestDateTime": "2023-08-23T15:03:31.919Z", "requestInitiator": "App Name", "context": "/fetchData", "data": { "kind": "fetchDataRequest", "items": [ { "item": { "key": "ID", "value": [ "1234567890" ] } }, { "item": { "key": "CRITERIA", "value": [ "EMPLOYEEDETAILS", "INCLUDEIDDETAILS" ] } } ] } }
.. this string format:
"{ ""requestId"": ""221a0000-faff-00e3-ac11-dbe6ebd00d00"", ""sourceSystemName"": ""ABCD"", ""requestDateTime"": ""2023-08-23T15:03:31.919Z"", ""requestInitiator"": ""App Name"", ""context"": ""/fetchData"", ""data"": { ""kind"": ""fetchDataRequest"", ""items"": [ { ""item"": { ""key"": ""ID"", ""value"": [ ""1234567890"" ] } }, { ""item"": { ""key"": ""CRITERIA"", ""value"": [ ""EMPLOYEEDETAILS"", ""INCLUDEIDDETAILS"" ] } } ] } }"
How to achieve this? After converting i need to pass in Request Body of integration to get data.
Regards,Sandeep
Discussion posts and replies are publicly visible
hi Sandeep You can use a!fromJson() function check please, click on the link for more details regarding that function, Please let me know if it is working
Thanks Abhishek,
Tried to wrap entire JSON format in a!fromJson() function getting below mentioned syntax error:Expression evaluation error: Syntax error. Details: Expression evaluation error at function a!fromJson parameter 1 [line 9]: Invalid symbol found (open_bracket)Screenshot for reference:Test screenshot.docxRegards,Sandeep
Hi Sandeep could you try this code, This code converts json data to string
touniformstring( a!fromJson( " { ""requestId"": ""221a0000-faff-00e3-ac11-dbe6ebd00d00"", ""sourceSystemName"": ""ABCD"", ""requestDateTime"": ""2023-08-23T15:03:31.919Z"", ""requestInitiator"": ""App Name"", ""context"": ""/fetchData"", ""data"": { ""kind"": ""fetchDataRequest"", ""items"": [ { ""item"": { ""key"": ""ID"", ""value"": ""1234567890"" } }, { ""item"": { ""key"": ""CRITERIA"", ""value"": [""EMPLOYEEDETAILS"", ""INCLUDEIDDETAILS""] } } ] } } " ))
Yes Abhishek this will convert JSON to String, but i don't want to convert the format which i was expecting the format to be.
If you see my query in starting of conversation, i need to convert below mentioned format to...Continuation...
...Continuation...this format (Expecting format):
Not sure why you want to double the quotes, but couldn't you just use the substitute function?
docs.appian.com/.../fnc_text_substitute.htm
Could you share your full code please?
Hi David,
Please refer to this code, this is same which i have shared in above conversation.I need to dynamically create below mentioned parameters values which are:1. Create UUID for requestId parameter.2. ID need to pass dynamicallyLater that this entire JSON code i need to convert as String in order to pass in Request body for getting Coverage data.
Hi Drouin,
I need to convert as String with double the quotes which i need to to pass in Request body for getting Coverage data.
If possible share here any sample example for substitue function, so that i will try to configure for the above JSON.