Home > Forum > Actions > Rest API Collections, Objects

Rest API Collections, Objects
0

Hello,
How to get information from one specific body line to a given field on the form?
I tried this way but it doesn't work, for example I want to download information only from decisions -> type -> and code content

Part code of body :

"decisions": [
{
"id": 111111,
"type": {
"id": 0001,
"code": "APPROVAL" <------- this part i would like to get in specifit field
},




FULL Code body :
{
"id": 1111,
"status": {
"id": 42000002,
"code": "DONE"
},
"versionNumber": 1,
"limitNumber": "0001/2025",
"limitId": 4545,
"data": {
"limitListId": 4545,
"policyNumber": "56565",
"amount": 1000,
"currency": {
"id": 40000,
"code": "PLN"
},
"paymentDays": 20,
"type": {
"id": 1111212121,
"code": "STANDARD"
},
"validFrom": "2025-07-03",
"overridePendingRequest": false
},
"decisions": [
{
"id": 111111,
"type": {
"id": 0001,
"code": "APPROVAL"
},
"status": {
"id": 00002,
"code": "ACTIVE"
},
"versionNumber": 1,
"validFrom": "2025-07-03",
"amount": 1000,
"currency": {
"id": 4000130,
"code": "PLN"
},
"paymentDays": 20,
"conditions": [],
"codes": []
}
]
}

MVP
In reply to: AlidEk

Thanks for a Tip,
Action is working but wont fill in the field, the response is returned with response body and code 200.
in this [0] should I pass some kind of id? $.decisions[0].type.code

Zero here: $.decisions[0].type.code just means first element of the array, so this will be the first decision, which is present in the array of decision as in your json example.
Have you configured target field? In my case it's a local parameter in automation, but if you need it on form, then it should be set to the attribute which should be filled in.

You could also send a screenshots how the current config looks like on your side :)

MVP
In reply to: AlidEk

updated pic in previous msg i tried with $.decisions[0].type.code and $.[0]decisions.type.code

Make sure that Json Path you are using returns what you need. You could use this tool for example:
https://jsonpath.com/

If the data structure looks exactly like the one in example, then my proposition should work out of the box, if there are some differences try your solution out with tool above :)