API with multiple result values

Hi, API retuns two claim IDs as below ,how to capture return both.

{
"claimID": "202409315407",
"supplierID": "1447337548",
"serviceStartDate": "2024-03-01",
"serviceEndDate": "2024-03-01",

},
{
"claimID": "202412400731",
"supplierID": "1447337548",
"serviceStartDate": "2024-03-01",
"serviceEndDate": "2024-03-01",
}
]

My output contact is below

How to differentiate same name variables having different values and capture both variables values.

Below is my configration

{
"translationMap": {
"claimID": "$[0].claimID",
"claimID2": "$[1].claimID",
"amountBilled": "$[0].amountBilled"
},
"translationMapDefaults": {
"claimID": ""UNKNOWN"",
"claimID2": ""UNKNOWN"",
"amountBilled": ""UNKNOWN""
},
"successTemplate": "{\n "claimID":${claimID}\n, \n "amountBilled":${amountBilled}\n, \n "claimID":${claimID2}\n }"
}

but in output claimID2 is empty. Any ideas please

Hi,
Your output contract only has claimID and you are mapping two values to claimID in your successTemplate.

You will need to add another output contract claimID2 and then in your successTemplate change "claimID":${claimID2} to "claimID2":${claimID2}

Alternatively, you can change the output contract claimID from String to Array and in your Translation map change "claimID": "$[0].claimID" to "claimID": $[*].claimID and get rid of claimID2

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.