Hi All,
Can any one please help me on this .I want to add new line to my JSON Response txt file .
For example something like this
Hi All,
Can any one please help me on this .I want to add new line to my JSON Response txt file .
For example something like this
You have to deserialize the JSON into a JSON object, use JSON methods to add/edit the child objects, then .ToString it to get it back into a string
Donât treat it as a text file. Itâs JSON. Install the UiPath.WebAPI.Activites package. Use Deserialize JSON to convert the text to a JObject (make sure to set this in the pulldown). Then use an Assign to change the value of yourJSONObjVar(âQuote_Order_from_Discrepancies__câ) to whatever you want just like youâd do with any other variable. If you need it back as a string after that you can use yourJSONObjVar.ToString
No.
1- HTTP Request gets the response in a variable quoteResponseData_source as a string
2- Deserialize JSON (make sure to set it to JObject) converts quoteResponseData_source into a JSON object and puts it into a variable (letâs call it quoteResponseJObj). That object has properties. In your example, thereâs just one property Quote_Order_from_Discrepancies__c.
3- Assign quoteResponseJObj = quoteResponseJObj(âQuote_Order_from_Discrepancies__câ).ToString + VbCrLf + âthe text you want to addâ
The âthe text you want to addâ could also be a string variable instead of a literal.
Then yourJObj.ToString will spit the whole thing back out as a string. This only needs to be done depending upon your needs. If you want to get the value of just the Quote_Order_from_Discrepancies__c property, you use quoteResponseJObj(âQuote_Order_from_Discrepancies__câ).ToString
Hello - What are these JSON methods to add/edit the child objects? I am trying to add a new key and value inside existing json brackets.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.