cancel
Showing results for 
Search instead for 
Did you mean: 

Looping through array of key value pair and mapping to Data model

Prachi_chakke
Deputy Chef I
Deputy Chef I

Hello Everyone, 

In recipe I am calling API endpoint which returns Json output. which contain the array of key value pair. I want to iterate through array and map the value to data model. At this moment, I can see value array, list index, list size.

How can I pass key value to map to datamodel .

Prachi_chakke_0-1709176704732.png

 

 

2 REPLIES 2

chris-wiechmann
Workato employee
Workato employee

Hi @Prachi_chakke, I surprised to see values just as an Array without any properties/fields underneath. Can you perhaps share the original JSON-Structure you get back from the HTTP-Endpoint?

Prachi_chakke
Deputy Chef I
Deputy Chef I

{
"url": "",
"data": [
{
"cbr": "filter",
"report": "ACCRUAL_BALANCE",
"showtranslation": "S",
"detnumber": "000001",
"detnumber_trn": "Burns C M A",
"laccurend": "558.30601153",
"laccurach": "23.67213192",
"laccuracd": "3.11475420",
"laccurenh": "4243.12568760",
"laclvetype": "ANN",
"laclvetype_trn": "ANNUAL LEAVE",
"laclastent": "1995-12-01",
"sequence": "1",
"attachments": "",
"accesslevel": "enquire"
},
{
"cbr": "filter",
"report": "ACCRUAL_BALANCE",
"showtranslation": "S",
"detnumber": "000001",
"detnumber_trn": "Burns C M A",
"laccurend": "64.63196346",
"laccurach": "0.00000000",
"laccuracd": "0.00000000",
"laccurenh": "491.20292227",
"laclvetype": "LSL",
"laclvetype_trn": "LONG SERVICE LEAVE",
"laclastent": "1982-12-01",
"sequence": "2",
"attachments": "",
"accesslevel": "enquire"
},
{
"cbr": "filter",
"report": "ACCRUAL_BALANCE",
"showtranslation": "S",
"detnumber": "000001",
"detnumber_trn": "Burns C M A",
"laccurend": "0.00000000",
"laccurach": "0.00000000",
"laccuracd": "0.00000000",
"laccurenh": "0.00000000",
"laclvetype": "REC",
"laclvetype_trn": "RECREATIONAL LEAVE",
"laclastent": "1968-01-01",
"sequence": "3",
"attachments": "",
"accesslevel": "enquire"
},
{
"cbr": "filter",
"report": "ACCRUAL_BALANCE",
"showtranslation": "S",
"detnumber": "000001",
"detnumber_trn": "Burns C M A",
"laccurend": "277.32240311",
"laccurach": "0.00000000",
"laccuracd": "0.00000000",
"laccurenh": "2107.65026365",
"laclvetype": "SIC",
"laclvetype_trn": "SICK LEAVE",
"laclastent": "1995-12-01",
"sequence": "4",
"attachments": "",
"accesslevel": "enquire"
}],
"query": "",
"action": 3,
"status": "ok",
"messages": [],
"timeStamp": ""
}