Pulling Multiple IDs From A Bundle, Into An Array | Community
Skip to main content
Eric_D_Miller
Level 5
September 11, 2025
Solved

Pulling Multiple IDs From A Bundle, Into An Array

  • September 11, 2025
  • 1 reply
  • 606 views

Hello

I need to pull two different types of IDs from the data below

I need the user.id from each NTAG as well as each team.id from each NTAG.

The goal is to have an array of IDs to include in a Update reply.

 

[
    {
        "body": {
            "data": [
                {
                    "ID": "68c0562903223440aff85176b936c54d",
                    "objCode": "NOTE",
                    "owner": {
                        "ID": "62a0af46002ec17cbee98efaa8105fda",
                        "name": "Fusion Integration",
                        "objCode": "USER"
                    },
                    "entryDate": "2025-09-09T16:30:33.128Z",
                    "isReply": false,
                    "tags": [
                        {
                            "ID": "68c056290322345e296bfb31382c3c1d",
                            "objCode": "NTAG",
                            "team": null,
                            "user": {
                                "ID": "redacted",
                                "name": "redacted",
                                "objCode": "USER"
                            }
                        },
                        {
                            "ID": "68c056290322345d95d488354dbf6c59",
                            "objCode": "NTAG",
                            "team": null,
                            "user": {
                                "ID": "redacted",
                                "name": "redacted",
                                "objCode": "USER"
                            }
                        },
                        {
                            "ID": "68c056290322345cc66e8cbbac7af1d1",
                            "objCode": "NTAG",
                            "team": null,
                            "user": {
                                "ID": "63c1a27e00279b070b1f1bea390bb479",
                                "name": "Test Worker",
                                "objCode": "USER"
                            }
                        },
                        {
                            "ID": "68c0562903223460b62c7882ad2c71ec",
                            "objCode": "NTAG",
                            "team": {
                                "ID": "6823962200097e8787dfcd4e08e2b0bc",
                                "name": "Test Team",
                                "objCode": "TEAMOB"
                            },
                            "user": null
                        },

 

 

 

 

Any assistance would be greatly appreciated.

Best answer by danperkins

Chris,

 

My expression above was indeed put into an iterator, yet I only got the user ID tags highlighted in yellow. I need also the IDs above highlighted in green.

 

Is my expression incorrect?

 

I essentially have one array that contains several arrays, each containing a user.ID or a team.ID that will ultimately be put into an array formatted to enter into a notify module. I have most of this figured out, I just can't seem to get each unique user and team ID in the entire topmost array, and only get the data from the first tags[1] array.

 

How do I make the body:data point to all data sets instead of just [1]?

 


@eric_d_miller If you want every ID from every object in the array within "body.data[]", you can use the iterator module as @chrisstephens mentioned. You can also use this:

{{deduplicate(remove(merge(map(flatten(map(2.body.data; "tags")); "user.ID"); map(flatten(map(2.body.data; "tags")); "team.ID")); null))}}

This will pull all user.ID values and all team.ID values within the payload. Then since you are using deduplicate, I added that in as well. 

1 reply

danperkins
Level 2
September 12, 2025

I would use map() and merge() and remove().

First I will use map() to build 2 sets of arrays for each object type: users, and teams

Then use merge() to combine the two arrays.

Finally use remove() to get rid of any empty (null) values.

{{remove(merge(map(2.body.data; "user.ID"); map(2.body.data; "team.ID")); null)}}

This should give you an array of only the IDs of the individual object records. (The "2" is the module number. Replace it with the module you are referencing).

 

 

Eric_D_Miller
Level 5
September 15, 2025

Hi Dan,

 

Thank you for the reply, unfortunately I am not getting any values from that.

 

 

Here is the input bundle if that helps:

[ { "name": "Tags", "scope": "roundtrip", "value": [] } ]

 

Eric_D_Miller
Level 5
September 15, 2025

Pointing the '2.body.data' variable to '2.body.data[].tags' instead gives me values, but only from the first data array.

 

 

 

Highlighted yellow are the tags I am getting
and green is what tags I also need included

 

Any ideas?