How to make a request containing an array of objects in a Data Action

Hi,

I would like to create the following request in Data Action.

{
"offset":"0",
"count":"1",
"data":[
{
"mainContractNumber":"${input.mainContractNumber}",
"customerNumber":"${input.customerNumber}",
"targetContract":[{
** "vaultContractNumber":"${input.vaultContractNumber}",**
** "contractPromiseAmount":"${input.contractPromiseAmount}",**
** "contractClaimAmount":"${input.contractClaimAmount}",**
** "contractOverdueCharges":"${input.contractOverdueCharges}",**
** "contractAnnualFee":"${input.contractAnnualFee}"**
** }]**
}
]
}

The request is intended to convey the following

{
"offset":"0",
"count":"1",
"data":[
{
"mainContractNumber":"1234567890",
"customerNumber":"X234567890",
"targetContract":[{
** "vaultContractNumber":"9876543210",**
** "contractPromiseAmount":"9876543210",**
** "contractClaimAmount":"1000000",**
** "contractOverdueCharges":"5000",**
** "contractAnnualFee":"0"**
** },**
** {**
** "vaultContractNumber":"7654321098",**
** "contractPromiseAmount":"X654321098",**
** "contractClaimAmount":"5000000",**
** "contractOverdueCharges":"5000",**
** "contractAnnualFee":"0"**
** }]**
}
]
}

To achieve this, I set it in Input Contract, but an error occurs when saving.(I attach a capture of the error)
Can someone please tell me how to set this up in a valid way?
I think "STRING" in "targetContract" is supposed to be "ARRAY", but I can't set it.

Kind Regards,

Input contracts can only be simple key:value pairs using primitive JSON types like string, boolean, and number. Objects and arrays are not supported in the input contract.

If the endpoint that you are calling needs to have an object in the body then you will need to setup the body in the request template and then insert the variables from the input values into the right places.

--Jason

Hi Jason_Mathison-san,

Thanks for getting back to me so quickly.
I understand that arrays cannot be used for Input Contract. Is it possible to get advice on how to define dynamically changing array elements in the request body?

Regards,

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