AnsweredAssumed Answered

How to Combine elements to an array in json

Question asked by spaty148449 on Apr 23, 2018
Latest reply on Apr 27, 2018 by 51662476

Hi,

I should combine all the assignees into one profile object array like below. Can anyone please help me to get a script/boomi process to achieve this ?

For example:

document 1

{
"Id":"46eec255-070c-452e-af38-4a347d90e2eb",
"ProjectId":"ddd165a1-4ac9-4b92-b613-2c99fe1b57ad",
"Name":"testTask",
"Description":"",
"assignments": [
{

"userId": "8de4d08b-fb5d-43d2-8085-323c8bcb7374",
"firstName": "test",
"lastName": "one"
}
]}

document 2

{
"Id":"46eec255-070c-452e-af38-4a347d90e2eb",
"ProjectId":"ddd165a1-4ac9-4b92-b613-2c99fe1b57ad",
"Name":"testTask",
"Description":"",
"assignments": [
{

"userId": "8de4d08b-fb5d-43d2-8085-323c8bcb7375",
"firstName": "test",
"lastName": "two"
}
]}
Need out put as below,

{
"Id":"46eec255-070c-452e-af38-4a347d90e2eb",
"ProjectId":"ddd165a1-4ac9-4b92-b613-2c99fe1b57ad",
"Name":"testTask",
"Description":"",
"assignments": [
{

"userId": "8de4d08b-fb5d-43d2-8085-323c8bcb7374",
"firstName": "test",
"lastName": "one"
},
{

"userId": "8de4d08b-fb5d-43d2-8085-323c8bcb7375",
"firstName": "test",
"lastName": "two"
}
]}

 


Thanks

Outcomes