Trigger body output from body

how to transform data from this webhook body

It depends. You can use the Function node or the Set node. How do you want to transform the data?

I Tried Set node but output is not working properly as needed

If you show me how you want the data to be transformed, I can provide an example. Without knowing that, there is not a lot that I can do.

I got error saying
ERROR:The provided field ‘body’ is not an array

I received data in webhook in this format
[

{

“headers”: {

“host”: “flow.cnswebtechnologies.com”,

“user-agent”: “Mozilla/5.0 (compatible; Google-Apps-Script; beanserver; +https://script.google.com; id: UAEmdDd9HcJZeiGPwv9znQAWbNeGmHNxBzg)”,

“content-length”: “401”,

“accept-encoding”: “gzip, deflate, br”,

“content-type”: “application/x-www-form-urlencoded”,

“x-forwarded-for”: “27.5.26.162, 35.187.134.88”,

“x-forwarded-proto”: “https”

},

“params”: {

},

“query”: {

},

“body”: {

“{“name”:“name”,“EmailID”:“EmailID”,“PhoneNo”:“PhoneNo”,“facebook marketing class 8pm 14th feb Launch Meeting - Zoom”: “Sks4TjFJeEdpbXdvV1UyY2Z4VTBoUT09 Meeting ID: 859 5726 7720 Passcode: soiim”:“send”,“SpreadsheetName”:“Live Class Notifcation for Class”,“SpreadsheetID”:“1WVndpiWw5cLjiHo3PAYk9m9B0YB7ehsv2UzyRieFAng”,“SheetName”:“Sheet1”,“SheetID”:0,“TriggerColumn”:“D”,“RowIndex”:2}”

}

}

]

Now I want to split out the values to send SMS, email and whatsapp, But i am getting error of Not an array

https://watch.screencastify.com/v/QtT2tqbAhen87R2kXVQa

Hey @chandan988,

Looking at that import data it isn’t an array so there is nothing to split out of it, You should be able to just select the data you need with something like {{$json["body"]["EmailID"]}} if you add your next node and use the expression builder it should show you something like this:

If you did want to use the item list node you could add a set node before it and make a string variable and for the content use {{[$json["body"]]}}

While using set node i am getting error, Might be i am doing something wrong

image

Hey @chandan988,

Ah yeah you have another issue there where your data isn’t coming in as JSON instead it is just a string, You will also need to use JSON.parse() on the body or see if you can change the headers for what is being sent to application/json instead of application/x-www-form-urlencoded

@chandan988 I’m not sure, but it looks like there is something wrong with the body structure. It does not look like valid JSON.

It think it should look like:

Here’s an example of valid JSON with the Set Function to filter out the EmailID. Please notice that you need to set Keep Only Set to true.

TIP: You can validate JSON via JSONLint.