Updating or posting a Wordpress post with multiple tags created with an Iterator module

Hi all,

I am struggling to be able to add multiple tags to a Wordpress post even after creating the tags.

Currently I have an Iterator module that extracts all the tags (separated by coma) from my Airtable database and then passes them through the “Create Tag” Wordpress module to create the individual tags (not one long tag with comas).

Once the Tags are created, I loop back and then move on through another path to the Wordpress modules: “Search Tags” (based on the tag names iterated) and from here I am able to have the Wordpress IDs of the tags to theoretically then add them to a Wordpress “create post” module.

The problem I have, is that because the Iterator is still active, It creates multiple posts (one for each tag). I then tried to create an aggregator which would take all of the IDs from the “Search Tag” module and put them together in an array, but I think it is aggregating only one of the iterations and not all of the iterations into one.

Can you please help me to find a solution so I can aggregate all of the IDs from each Iteration and then add them all as Tags in the Wordpress “Create a Post” module? Assuming it is possible to add multiple Wordpress tags when creating a post.

I’ve been struggling with this for a while now and can’t seem to find the answer online or in the forum.

Many thanks,
Alex

Welcome to the Make community!

1. Screenshots of module fields and filters

Please share screenshots of 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:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

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

Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the 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!

2 Likes

Thanks Samliew, here is the additional information you suggested sharing. In this example I have 3 Tags that are being processed. So there are 3 output bundles at the end with each a different unique tag, and as you can see in the screenshot, the post was created 3 times (1 for each tag).

Screenshot of problematic segment:

Blueprint:
ExtractFrom_WordpressPublish_blueprint.json (222.4 KB)

Output bundles (cannot upload text file). I put a screenshot where the tags come into the Wordpress Create a Post Bundle Input where you can clearly see that it is inputing three different requests for a new post with each a different Tag ID.

Please let me know if you need anything else. Thanks!

@EaZyGreen

I’ve discovered a straightforward solution for managing multiple tags in WordPress using the ‘make an API call’ module. There are two methods to address this issue:

  1. Create a Post via API: This involves creating an entire post through the API, including all the required fields such as tags. However, this method can be complex due to the numerous fields involved.
  2. Update a Post via API: The simpler approach is to update a post through the API by modifying the tags accordingly. This method has proven effective.

I’ve noticed that many individuals encounter the same problem, and I believe implementing this solution will be beneficial for them.

3 Likes

Thanks Abhishek, I’ll give the update solution a try.

That said, @samliew I think I found a BUG with the aggregator module. Please double check to see if it is just on my side.

So, when I I created the aggregator, I set the aggregation of the Tag ID and the Tag Name, and click “OK”.

But when I then run the scenario and look at what the aggregator outputs, I can see the correct Tag Names, but the ID is the Post ID and not the Tag ID for some reason.

When I go back into the aggregator module, I can see that Tag ID is deselected even though Tag Name remains selected. I select it again, click OK and when I open the settings of the aggregator back up again it is de-selected!

Scrolling down I saw that “Post ID” was selected (automatically?). So I tried de-selecting “Post ID” and selected again the Tag ID and saved. And like magic, the correct bundles are now going out and the tick box for Tag ID aggregation is remaining selected when I open the settings again.

I think there could be an issue with the fact that “Post ID” seems to be using the same bundle name “ID” as the tag ID in the aggregator (just a hunch), but I’ll leave the experts to figure it out :wink:

Hi @Abhishek,

So I tried to do your suggestion, but I am running into a complication because to be able to list my tag IDs like you did in your module, I need to map them into a text format separated by comas (the number of tags can vary and are never an exact amount I can pre-set).

I based this on the solution provided in another question ( How can I get all value from an array of collection of collection - Questions & Answers - Make Community).

I tried to recreate this on my side, but unfortunately it seems like the tool doesn’t recognise the label “ID” as the Tag ID in the “variable value” that is output and shows only the comas (although it seems to understand that there are three values in my array, because it gives “,”).

@samliew Do you know if this is part of the bug I mentioned in my previous message caused by the tag ID label? or is my “variable value” mapping incorrect?
The input array is this:

And my “variable value” is this:

The ID in the built-in map function needs to match the raw key/name in the Output Bundle, and is case-sensitive.

What is being displayed is the LABEL, and the LABEL (what you see) could be different from the NAME of the variable.

b46a09bdf90df95795aa2e1540ff24771bd548ad

It might actually be a lowercase ID,

{{ join(map(112.array; "id"); ",") }}


If you need further assistance, please provide the following:

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

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

This will allow others to better assist you. Thanks!

3 Likes

Thank you both so much @Abhishek and @samliew. With your help I was able to solve the issues! For the sake of an easy and clear response, I will summarise your replies in one post and mark it as solved.

Issue n°1 - Iterations going past the aggregator and performing too many steps instead of combined into one:
I solved this by setting the Source module of the Array aggregator to the Iterator itself.

Issue n°2 - Cannot get the correct the correct label pulled into the “variable value”:
as per Samliew’s response (Updating or posting a Wordpress post with multiple tags created with an Iterator module - #7 by samliew), I needed to hover the mouse over the label to get the accurate case-sensitive key to use.
b46a09bdf90df95795aa2e1540ff24771bd548ad

Issue n°3 - Tags not updating correctly for Wordpress post:
The solution provided by @Abhishek worked well (Updating or posting a Wordpress post with multiple tags created with an Iterator module - #4 by Abhishek). I still had to add another step to publish the post and be able to get back the value of the post url, but it is a very good workaround the tags update issue.

Issue n°4 - Aggregator not returning tag IDs if Post ID is also being aggregated:
I still think that this is a bug that should be fixed in the future to save others a lot of struggling (Updating or posting a Wordpress post with multiple tags created with an Iterator module - #5 by EaZyGreen).

Thanks again for both of your help, I really appreciate it.

All the best,
Alex

1 Like

Hey there @EaZyGreen :blob_wave:

Just jumping in to pat you on the back for the great job you, @samliew, and @Abhishek did while solving your problems.

Thank you so much for summarizing the info and updating us on your issue! This way we keep our forum organized and neat for others.

Keep up the awesome work! :meow_party:

1 Like