Hello everyone,
I’m trying to achieve a rather simple thing but I’m not too sure how to go about it.
The scenario
My scenario is a simple setup where a Webhook is listening for incoming data and from which I want to create a variable (the complete scenario is more complex but I decided to scope the scenario for visualization sake).
The problem
I’m successfully getting the data from the Webhook. However, I’m having a hard time mapping it to the desire format.
In the screenshot below, I’m getting some data, notably an array of recipients
.
From this array of recipients
I’m trying to create a phoneNumbers
variable with a specific format.
In fact I’m trying to create an array of Collection from these phone numbers and just set the key for each phone number to number
like in the JSON example below.
[
{
"number": "+250780123456"
},
{
"number": "+250720654321"
}
]
Right now I’m not sure what Variable value I should use in the Tools module so that the output bundle has the desired form. My understanding is the map
function is more to filter out values and keys but not necessarily to modify the data structure.
Does anyone know how I can solve this?