Categoris in wordpress from a list

hi, i am trying to make a scenario where finds a topic and some information about that topic and then sends it to ChatGPT then writes an Article for WordPress with the headline, content, categories, tags, and excerpt,

I am then using some text parser to separate the different elements so I can put it into WordPress but my categories I get from the text parser look like this

Mazda, Toyota, Volvo, BMW

how do I get those in my WordPress Post?

I have tried many things, can some one please help me

Welcome to the Make community!

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.


thanks for the reply
I have some problems getting it to work

this is how it looks now
the text parser’s outputs:
I: 1
$1: Toyota, Mazda, Opel, Volvo

The iterator array field is set to the output from the text parser

then there is the WordPress Search Categories

the array aggregator is set
The source Module is set to the Iterator
and under WordPress - search Categories I have selected Categories ID

and in the WordPress create post I have set it to Map( “the array from the aggregator” ; id )

but still doesn’t work it puts all categories on the post