Hello,
I am newbie.
I’m using a GET to request a list of objects. These are just a few of them in the response:
{
“id”: 437725467,
“name”: “Div - 02”,
“orig_id”: null,
“proj_id”: “12345”,
“code”: “02”
},
{
“id”: 437725468,
“name”: “Div 02 - Dept 230”,
“orig_id”: “0201”,
“proj_id”: “12345”,
“code”: “02-230”
},
{
“id”: 440033671,
“name”: “Div 02 - Dept 260”,
“proj_id”: “12345”,
“orig_id”: “0202”,
“code”: “02-260”
},
{
“id”: 518363961,
“name”: “Div 01 - Dept 330”,
“proj_id”: “12345”,
“orig_id”: “0103”,
“code”: “01-330”
}
I want to save all of the ids, codes, and proj_id (same in this case) to an environment variable array and then concatenate “code” and “proj_id” to make a new value for “orig_id” in the next PATCH API call. Its body would look like this:
{
“updates”: [
{
"id": 437725468,
"orig_id": "12345-02"
},
{
"id": 437725468,
"orig_id": "12345-02-230"
},
{
"id": 440033671,
"orig_id": "12345-02-260"
},
{
"id": 518363961,
"orig_id": "12345-01-330"
}
]
}
Any idea is highly appreciated.
Thank you all!