Share feedback, ideas and get community help

Updated 6 months ago

Sending an array variable via the HTTP request block

At a glance

The community member is having trouble sending an array via a webhook body. They tried using the {{var}} variable, which is set to an array, but this resulted in a 500 error and an empty request body. The community member also tried putting quotes around the variable, but that did not work either. However, using a string variable like "A B C" works fine.

Another community member commented that they were able to get it working on their end, but did not provide details on how they resolved the issue. A third community member asked the original poster how they managed to resolve the problem, as they also need to send a JSON payload and parse a variable that may be a string.

There is no explicitly marked answer in the comments.

Hi,

any idea how we can send arrays via the webhook body?

For example, this custom body does not work (Error 500) if {{var}} is set an array, such as ["A", "B", "C"] in a previous block

{
"input": {{var}}
}

I've examined my endpoint logs and it seems that the request does sends an empty body, when {{var}} is an array. I've also tried putting quotes before and after the variable -
i.e.,
"{{var}}", still this did not work.

If you use a typical string variable, such as "A B C", the call just works.
B
S
m
5 comments
I just tried and it works on my end
With a test with a webhook.site URL
No idea why this is happening. I will investigate more. Thanks
@Stergios How did you manage to resolve this? I need to send a json and I need to parse the variable first because if I send the direct variable it will be a string. I tried escaping it with \ but it doesn't work either!
Add a reply
Sign up and join the conversation on Discord