cancel
Showing results for 
Search instead for 
Did you mean: 

How to get value from JSON object ?

0 Kudos
1,232

Dear SAP Community,

In SAP IRPA Cloud Studio,

How to output JSON object from web service to local variable ?

I have some complex JSON output from web service and I want to get some value from it.

Normally I write the value to Log Message task.

For this object , I can write log only Object.Status to get DONE value

But I want to get the value like Object.Data.HeaderFields.recieverName, the Cloud Studio not allow me to select the child value.

Example JSON below.

{

"Status": "DONE",

"Data": {

"headerFields": [ {

"name": "receiverName",

"category": "receiver",

"value": "Domestic US Supplier 1",

"rawValue": "Domestic US Supplier 1",

"type": "string", "page": 1,

"confidence": 0.594381934667335,

"coordinates": { "x": 0.120831698705375, "y": 0.338484848484848, "w": 0.168693605335426, "h": 0.0121212121212121 }

},

{

"name": "deliveryDate",

"category": "shipTo",

"value": "2019-08-27",

"rawValue": "27.08.2019",

"type": "date", "page": 1,

"confidence": 0.681329280611068,

"coordinates": { "x": 0.697136131816399, "y": 0.198787878787879, "w": 0.0835621812475481, "h": 0.0103030303030303 }

},

]

}

}

When I tried to access this object, the Cloud studio allow me to get only Data or Status, no more deeper child.

How can I get the child value and log this value as string ?

(This example webservice is from Extract data from document using Document Information Extraction service from SAP IRPA store.)

Thank you.

Chankitti

View Entire Topic
former_member661358
Participant
0 Kudos

Hi,

Create a list and push the header details into the list. Loop the list and write condition to get your required value.

Regards,

Chenna

chenna.

0 Kudos

Dear Mr.Reddy,

Thank you for your suggestion, I will try and update you soon.

Chankitti.