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.
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:
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.
(Note: Exporting your scenario will not include private information or keys to your connections)
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”.
A.
Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
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).
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.
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:
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.
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.
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
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 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:
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.
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”.
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:
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.