The automation to Wordpress publish duplicates in each category

Hi everyone.

I’m facing a little problem on my automation that publish posts to wordpress from Airtable.

I have different categories on my wordpress website and everytime I run the scenario, it passes one record, but it publish the same post for each category, like in the screenshot.

I have a simple “Search categories” to get all categories from wordpress and to use it in the error handler “Resume”

Then I have a Generate Category Module

And the Resume error handler

As you can see in the first screenshot, It received 1 record, but made 16 posts from it (every post has been added in each of the available categories)

What am I doing wrong?

You are not aggregating the results of the “Search Categories” module.

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.

Mapping a Specific Structure Into a Complex Field

The Array Aggregator module is very powerful because it allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

This is done using the “Target structure type” field in an Array Aggregator module.

Here is an example:

As you can see, the “Map” toggle on complex fields are used when you have an array. You can easily build an array variable to map to a future module’s field, by using an Array Aggregator module and select the “Target Structure Type” as the future module’s field you have mapped the array into.

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

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

If you have a comma-delimited list of category names, you’ll need to split the categories by comma-space so that it becomes an array. Then, use an iterator on the array so that you can process each category at a time.

Create new category using the name.

Then, if category exists, there will be an error. Handle the error by searching for the category, and resuming with the existing category ID.

Then, aggregate the category IDs into an array using the Array Aggregator.

You can then insert the array of category IDs into the tag/category field.

Similarly, this works the same way for the Wordpress Tags field.

For more information, see How to deal with WordPress errors

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

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Ok, but still cannot understand exactly how to get the right category ID :sweat_smile:

I’m getting always the first category ID from the array. Should I iter it?

Sorry, but I’m not getting this