Anyone can replicate sending a dynamic array via json in activepieces html request (api call)?
I am trying to send a contact to a webflow membership group - that in itself is not a problem - the challenge for me is that when you asign a contact to a group in webflow then the group you added the contact to replalces all other groups the contact was in so you have to GET USER first and then get all groups and then list them like shown and thats it. In activepieces again I managed to send a one group but I am not able to dynamically make a api call to webflow.
Static applying groups would look like this:
“accessGroups”: [
“webflowers”,
“platinum”,
“free-tier”
]
For getting all existing groups(inputsmemberships) and to combine it with the new group I tried this which looks good for me but when I do the call it gets an error:
export const code = async (inputs) => {
const accessGroups = […inputs.memberships.map(group => group.slug), inputs.membership];
return accessGroups;
};
Result:
[
“bze5”,
“bze4”,
“bze2”,
“bze1”,
“bze3”,
“bze6”,
“bze7”,
]
if I send only one like this:
{
“accessGroups”: [“{{step_10[0]}}”]
}
it works fine! But if I send all groups like this
{
“accessGroups”: [“{{step_10}}”]
}
it does not work. Also removing the square brackets wont work (“Invalid request body”). And removing Quotation marks " " from {{step_10}} Like:
{
“accessGroups”: {{step_10}}
}
here activepieces wont even let me make the call, calling it “JSON Body is invalid” without the Quotation marks " "
Anyone can replicate sending a dynamic array via json in activepieces? I know a workaround that I rather not use to not make it unnesseary complex (sending it to a webapp instead of to webflow api and code the whole thing and call api from there)
Clarification is really appreciated.