ChatGPT - Make crucial error?

I’m working with ChatGPT which is trying to walk me through building a scenario to sync posts between Notion and Wordpress when I come across this:

:collision: Boom — NOW we have the real diagnosis!

You just uncovered a very advanced but important problem.
I see exactly why you’re getting duplicated “Iconic FX Moments” instead of the second real category.


:brain: Here’s the exact issue:

Your Iterate Categories module is running correctly.

:white_check_mark: It outputs:

  • 1st: “Iconic FX Moments”
  • 2nd: “FX Tutorials and Techniques”

BUT your Search Categories module is being triggered outside the context of the correct post.

:white_check_mark: That’s why:

  • Operation 1: Iconic FX Moments (good)
  • Operation 2: Iconic FX Moments again (:cross_mark: bad! Should be FX Tutorials and Techniques)

:loudspeaker: The REAL technical reason:

:backhand_index_pointing_right: Your Iterate Bundles is incorrectly “capturing” the wrong Category during the flow.

:backhand_index_pointing_right: Make is processing multiple bundles at the same time — it’s mixing iterations.

IS THIS LAST LINE TRUE? If Make is mixing iterations that seems like a pretty BIG bug?

Further Information -

So my scenario is setup as follows:


  1. Notion Module - Pulls any Notion page / row where the status is “Ready to Publish” and the Automation Trigger checkbox is true.

  2. Iterator Module - Iterates over each of the bundles from the Notion Module

  3. Iterate Categories Module - Iterate over each of the bundles from Module 2

  4. Search Categories - Search for the Category ID for each of the Categories from Module 3.


ISSUE - Somehow between the Iterate Categories Module (#3) and the Search Categories Module (#4) one of the categories is dropped / replaced by a duplicate.

Here is the Input / Output of each :

Iterate Categories:

Search Categories:

SO… What am I doing wrong? Is this something I’m doing wrong or is this a Make flaw?

Please HELP!! I’ve spent a week working on this!

Welcome to the Make community!

It’s not a bug. Your Search module is returning 3 items, so the rest of the modules run x 3 each.

One search module = one aggregator

Combining Bundles Using Aggregators

Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.

You can find out more about the other types of aggregator modules here:

Question: Which is the best aggregator do you think you’ll need for your use-case?

Mapping a Specific Structure Into a Complex Field

If you have an array of collections, in programming terms, this is called an array of objects, or an array with non-primitive data types (“complex”).

The Array Aggregator module is very powerful because it allows you to build a new complex array of collections that matches a later module’s field to map multiple items (collections) to it. Such fields initially would allow you to manually add items, but you can toggle the “Map” switch to the “on” state and map a whole array into a single field.

This is done by selecting the “Target structure type” in an Array Aggregator module.

As you can see from the above example, the “Map” toggle on complex fields are used when you have an array variable (like from an array aggregator). Other combinations of modules may also allow you to generate an array that matches a future field’s array structure, like “Aggregate to JSON + Parse JSON”, or “Create JSON + Parse JSON”, but this is an advanced topic.

Question: Are you mapping your array into a field that accepts more than one item/collection?

For more information, see “Mapping with arrays” in the Help Centre. You should also do the Make Academy, which also covers the use of Iterators & Aggregators.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

Let me be as simple as I can - I’ve got everything working EXCEPT for MULTI-SELECT fields from NOTION.

I can pull the records and I can iterate through the Categories for a multi-category post:

Input

* Bundle 1  <small>Collection</small>

  * id : 7
* Bundle 2   <small>Collection</small>

  * id : 5

Output

* Bundle 1   <small>Collection</small>

  * Array    <small>Array</small>

    * 1   <small>Collection</small>

      * Category ID : 7
    * 2   <small>Collection</small>

      * Category ID : 5

  * __IMTAGGLENGTH__

2

My problem is how do I WRITE MULTI-SELECT fields to WORDPRESS? It seems when writing it writes the first item in the array and ignores anything else?