Combing items in 3 arrays based on index number

Hello,

I am trying to connect create new rows in powerbi with api, and am having issues combining my arrays. My data came in from klaviyo as three separate 400 element arrays, so I am trying to combine the arrays based on the index number. Ex. create 400 bundles/groups with the items in each of the arrays based on the index number.

Thanks!

1 Like

Welcome to the Make community!

To allow others to assist you with your scenario, please provide the following:

1. Relevant Screenshots

Please share screenshots of your scenario, any error messages, relevant module fields, and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:

2. Scenario Blueprint

Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

3. Output Bundles of Modules

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

Hi @Reid_Sickels

You can iterate through the array to get the bundle order position for each item. Then, you can use this as an index to group items within the array.

Best regards,

Msquare Automation
Gold Partner of Make
@Msquare_Automation

Hey Samliew,

Thanks for the response, here are the screenshots and txt files:

Here there are 3 arrays - Date, Email, SMS. The values on each of the indexes are the date, the attributed revenue of email of the date, and the attributed revenue of sms on the date. Essentially am trying to combine the index values from the 3 different arrays into their own bundles.

aggreagtor.txt (38.5 KB)
Varibles.txt (29.8 KB)
Klaviyoapi.txt (53.7 KB)

1 Like

Just to clarify, are you saying to iterate through each of the arrays (all 3) to get them in bundles, then group items based on bundle order position?

Thanks

1 Like

Hi @Reid_Sickels

Exactly.

Best regards,

Msquare Automation
Gold Partner of Make
@Msquare_Automation

Hey Msquare,

After I’v iterated all three, how would I call back upon the bundle number of each, as they are in 3 separate paths?

1 Like

Hi @Reid_Sickels

You can first merge the data, then iterate through it, and finally aggregate by grouping according to the bundle order position.

Sample structure created:

merge all 3 arrays:

image

Best regards,

Msquare Automation
Gold Partner of Make
@Msquare_Automation

Hey Msquare,

Really appreciate your help here - still a bit stumped.

I merged the data, so not everything is in 1 array, versus three arrays, but am having trouble aggregating by bundle order position as in the new array, every bundle order position is different. Just confirming, the correct order is merge, iterate, then aggregate?

Thanks

Screenshot 2024-09-17 010140

Hi @Reid_Sickels
Got a new workaround for this.


Sample structure :

Believe all 3 array length is same


Output of text aggregator:
image

If you want each set as an item in an array you can use split function:

final output:
image

Best regards,

Msquare Automation
Gold Partner of Make
@Msquare_Automation

1 Like