Array aggregator not working as expected

Hello! Probably a stupid question but I’m trying to combine the text field from the bundle from 2 operations into 1 single text/ bundle.

As you can see in the screenshot, I’m trying to output a single text field that contains the two texts fields in the 2 operations using Array Aggregator. However, after processing it, it still outputs 2 separate Operations. What am I doing wrong? Appreciate your help!

Hi @Fion_Leung
The source module should be a ChatGPT module.

Thanks! However I tried it and it still produced 2 bundles.

Here’s more background on what I’m trying to do and a close up to why there are 2 Operations in output → I’m getting PDF.co to convert a PDF into an image for OpenAI to analyze. If the PDF has 2 pages, it becomes 2 images and therefore 2 separate bundles, and OpenAI would generate 2 JSON after analyzing the 2 images. I’m trying to merge these 2 JSONs into 1 so i can do analyze on the 2 images (meaning the full page with 2 pages). Let me know if this makes sense or if you know a better way to go about it! Thanks again!

Hi @Fion_Leung
I would suggest extending the scenario logic like this.

  1. The upper route will generate an array of images and set the variable with an array of records.
  2. The bottom route’s Get Variable module will get the array of images.
  3. The router after the Get Variable module will have two routes:
    a) The upper route with a filter Array length equal to 1.

    b) The bottom route with a filter Array length greater than or equal to 2.
2 Likes

Thanks so much for the detailed explanation and for the set up! It works now - thanks again!!

2 Likes