Formula to separate array with commas?

Hi Team. I am currently working on an automation that posts articles to my WordPress site. I am trying to take an array of numbers and separate them with commas so I can create / upload the WordPress tags.

Array Output:

Couple formulas I already tried (I am new to these, so still learning)
image
image

image
image

Thank you in advance for any help… I have been stuck on this for almost a full day now😂

Hi James,

Have you tried using a “Text Aggregator” module yet? if you look on advanced settings there are custom options where you maybe able to play around to get each vaue seperated by a comma.

Hope this works!

1 Like

Welcome to the Make community!

Looks like you have to map first before you can join.

Currently you are joining before you map (incorrectly too).

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

@samliew

1 Like

Hey @James_G

I hope this will help you

1 Like

Thank you Samliew! Good to be here :slight_smile:

I knew that my formula would be wrong. Thank you for clarifying!

I’m just guessing (typing on my phone), but try something like this:

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

Copy and paste the above directly into your field, including pasting together with the {{ }} brackets.

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

@samliew

3 Likes

Thank you! Your formula worked and now is outputting the values separated by commas…
image

The next, and hopefully last, problem is now WordPress module is erroring…


Have I missed a step in my scenario?

Thank you, this is helpful indeed.

I implemented your steps of using the “Make an API Call” module, and the scenario runs without errors, however when I check the post in WP, it only has one tag (the first ID in the array)

Output from WordPress module:
image

WordPress Dashboard:

@James_G

Try with text aggregator

1 Like

Ah, so it’s not expecting a string of comma-separated IDs.

You need to actually insert an array of IDs, so skip the join, to leave it as an array.

This should be all you need:

{{ map(53.array; "id") }}

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

@samliew

2 Likes

Thank you so much @samliew & @ManishMandot

Your solutions combined both helped me a lot.

The scenario has run 2 times in a row and returned the result I want, so I believe it’s solved!

Summary of Solution:
I used the formula provided by @samliew
image

I used the “Make an API Call” module instead of “Update a Post”, thanks to @ManishMandot for the instructions to set that up.

Both of these combined got me the result I want, thank you both!

image