cancel
Showing results for 
Search instead for 
Did you mean: 

Structuring the Data receiving from the Union snap

Prajwal
New Contributor II

Hi all,

Can anyone help me to figure out how can I format the data in more structural manner?

Input Data:

[

  {

    "account_name": "Prajwal",

    "Name": "Jhonson Inc.",

    "OwnerId": "0052w00000BUhAGAA1",

    "StageName": "Negotiation/Review",

    "CloseDate": "2024-07-15",

    "Description": "Renewal contract for XYZ Inc. with added services.",

    "campaign_name": "Navya-Snaplogic"

  },

  {

    "Campaign_Id": "701Ig000000xF3BIAU"

  },

  {

    "AccountId": "0012w000027SrONAA0"

  }

]

Expected output data:

[

  {

    "account_name": "Prajwal",

    "Name": "Jhonson Inc.",

    "OwnerId": "0052w00000BUhAGAA1",

    "StageName": "Negotiation/Review",

    "CloseDate": "2024-07-15",

    "Description": "Renewal contract for XYZ Inc. with added services.",

    "campaign_name": "Navya-Snaplogic",

    "Campaign_Id": "701Ig000000xF3BIAU",

    "AccountId": "0012w000027SrONAA0"

  }

]

the campaign_id and accountid should be incorporated into the first object.

Thank you for your help!

Prajwal

2 ACCEPTED SOLUTIONS

Aleksandar_A
Contributor III

Hello @Prajwal,

Is the input always going to be the same (the number of documents)? If yes, then you can use a Gate Snap to gather all of the documents into a single array and then combine all of the elements into a single object.

 

For more information, please refer to the attached pipeline.

Let me know if this helps you.

Regards,

Aleksandar.

View solution in original post

svatada
Former Employee

@Prajwal Try using GroupByN snap to merge the incoming documents into one

svatada_0-1717051210505.png

 

View solution in original post

4 REPLIES 4

Aleksandar_A
Contributor III

Hello @Prajwal,

Is the input always going to be the same (the number of documents)? If yes, then you can use a Gate Snap to gather all of the documents into a single array and then combine all of the elements into a single object.

 

For more information, please refer to the attached pipeline.

Let me know if this helps you.

Regards,

Aleksandar.

Prajwal
New Contributor II

I have one question, will the gate snap works in the child pipeline? this child pipeline is triggering from the ultra parent pipeline.

svatada
Former Employee

@Prajwal Try using GroupByN snap to merge the incoming documents into one

svatada_0-1717051210505.png

 

Prajwal
New Contributor II

Thanks @Aleksandar_A  and @svatada, I'll give a try with these methods.