Hello,
I’m encountering an issue with my module and need some help. I have a parameter questions[]
which is an array of strings. The API I’m working with requires each item in the questions[]
array to be passed individually as separate query parameters.
Here’s a summary of my issue:
- Directly referencing the array (e.g.,
{{parameters.questions[]}}
) results in only the first item being passed in the query string. - I attempted to use the
join()
function to properly format thequestions[]
array for the query string by joining the items with the separator&questions[]=
.
However, the join()
function doesn’t seem to be working as expected. Instead of correctly formatting the query string, it results in questions[]
being sent with an empty string.
Here’s the relevant part of my code:
{
// Request to API endpoint.
"url": "/v1/job/asking",
"method": "GET",
"qs": {
"board_key": "{{parameters.board_key}}",
"key": "{{parameters.key}}",
"reference": "{{parameters.reference}}",
"questions[]": "{{join(parameters.`questions[]`;'&questions[]=')}}"
},
// Response handling
"response": {
"iterate": "{{body.data}}",
"output": {
"answer":"{{item}}"
}
}
}```