Issue in parsing tawk.to data on webhook

[

{

"headers":{

"host":"flow.ourklient.com",

"user-agent":"tawk.to-webhook",

"content-length":"490",

"content-type":"application/json",

"x-forwarded-for":"35.232.27.218",

"x-forwarded-host":"flow.ourklient.com",

"x-forwarded-port":"443",

"x-forwarded-proto":"https",

"x-forwarded-server":"c8aad5ad9548",

"x-hook-event-id":"8024483584994071",

"x-real-ip":"35.232.27.218",

"x-tawk-signature":"76842eb30acfa87009d8f88c7b2f776ae53b6a23",

"accept-encoding":"gzip"

},

"params":{

},

"query":{

},

"body":{

"chatId":"86a39470-24b2-11ee-9558-41699ded48d3",

"visitor":{

"name":"chandan kumar gupta",

"city":"delhi",

"country":"IN",

"email":"[email protected]"

},

"message":{

"sender":{

"type":"visitor"

},

"text":"Name : chandan kumar gupta Mobile No. : xxxxx Email : [email protected] Course or Services inquiring for? : testing webhook api for tawk to",

"type":"msg"

},

"time":"2023-07-17T14:59:58.029Z",

"event":"chat:start",

"property":{

"id":"5afe76eb5f7cdf4f053453ee",

"name":"DIDM"

}

}

}

]

i am trying to get Name, Emai, Phone from this, Name & Email is easily coming out by set node, But getting Phone Number is challenge to me any code or node to get this phone number

Hey @chandan988,

The best option would be to use a regular expression to get the data you are after. The ugliest way I can think of that would do it without Regex would be {{ $json.body.message.text.split('Mobile No. :')[1].split('Email')[0].trim() }} which you can see in action in the workflow below.

this is correct, But i cannot use previous data to run it automatically basically i cannot drag webhook header into this Function node so it runs automatically any solution to put previous webhook node data ( Header ) to this function node

Hey @chandan988,

I don’t follow, Why can’t you use previous data? The example does just that.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.