Splitting a String into an Array for Use in Webhook

Hello Make.com community,

I am facing an issue while working with the Set Variable and Webhook modules in Make.com, and I need some guidance.

Here’s the scenario:

  • I have a string like this: "ORD0001, ORD0041".
  • I’m trying to split this string into an array of individual order numbers (["ORD0001", "ORD0041"]) using the Set Variable module with the following expression:

split(string; “,”)

However, the output I’m receiving in the “OrderArray” variable is not what I expect. Instead of the array I need ([“ORD0001”, “ORD0041”]), I am getting this:

[
“ORD0001”,
“ORD0041”
]

It seems that the output is still a list of strings and not an array as expected. I am using this data in a Webhook to send the array to Voiceflow. However, Voiceflow is not handling the data correctly because it’s not formatted as an array.

Questions:

  1. What is the correct way to ensure that the result from split is properly formatted as an array of order numbers?
  2. How can I send the array from Make.com to a Webhook so that Voiceflow can process each order number correctly as a button?

I would really appreciate any help or advice on how to fix this issue.

Thank you!

Hey there,

Does this fit your purpose:

No the function not working

Is it possible to send the actual string so that I can get a better idea of the situation?

This is the string:

[
{
“text”: “ORD0001,ORD0041”
}
]

This is the set variable output after using this function : split(replace(30.text;, ;", ");, )

[
{
“OrderArray”: [
“ORD0001”,
“ORD0041”
]
}
]

The webhook send the string to Voiceflow like this:

{
“order_array”:“ORD0001, ORD0041”
}

Welcome to the Make community!

To do this, you can use the built-in functions split and join

{{ split(text; separator) }}

{{ join(array; separator) }}

e.g.:

{
  "OrderArray": ["{{join(split(1.text; ","); """,""")}}"]
}

For more information, the function’s documentation can be found in the Help Centre. You should also complete the tutorials in the Make Academy.

Example

Here is an example of how your scenario could look:
Screenshot_2025-03-14_220334

This is just an example. Your final solution may or may not look like this depending on your requirements.

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.