How to create an array from bundles with ID items in them?

I feel like this is the most basic use of an array aggregator yet I cannot figure out how to set it up.

My process is this:

  1. Search for files in a Google Drive folder
  2. Download file from Google Drive folder (1 operation for each file found in 1.)
  3. Upload it to Wordpress (returns Media ID) (1 operation for each file found in 1.)
    …???
  4. Create a post in Wordpress with an Image gallery of the media files created in 3. This is done by providing a key/value pair for the ACF image gallery field, where the key is the name of the field and the value is an array of the Media IDs that should go into the gallery, like so: [123,456,789]. I know this is correct, because when I test it with flat values, it works.

But I cannot figure out how to go from 3 separate operations, each with their own bundle that has as one of the items the Media ID, to a single array that only contains the values of those IDs.

I’ve tried many variations, but I can’t figure it out. See below for the most basic variant of my solution so far:

The Array aggregator’s Output:

What goes into the ACF field:

What should go into the ACF field: [11946,11948,11950]

Any idea how to do this right? :slight_smile:

You can use map function for this.

Something like this,

map(Array Aggregrator Array; Media Item ID)

2 Likes

Thanks! I used the map function like you said, created the primitive array that I wanted nicely. Took some puzzling to figure out the module to use but Transform to JSON worked in the end:

Final setup:

Transform to JSON module:

2 Likes