problems with json sent from webhook on empty values

Anonymous
Not applicable

problems with json sent from webhook on empty values

Hi, i am encountering a weird problem. i defined a webhook with this data:
data={"type":"ddd","name":"aaa","externalId":{{lead.id:default=}},"firstName":{{lead.First Name:default=}},"lastName":{{lead.Last Name:default=}},"email":{{lead.Email Address:default=}},"companyWebsite":{{company.Website:default=}},"companyPhone":{{company.Main Phone:default=""}},"api":"xxx","enrichStatus":{{lead.LS Status:default=}},"sourceType":"Api", "ticket":"aaa"}

As you can see the for example:
"firstName":{{lead.First Name:default=}}
i set no default value. on the json i receive on my server this will be translated to
"firstName":""
but on other servers the "" are not added and it causes parse problems on json.
Any idea why this is not consistent? should i define this instead: "firstName":{{lead.First Name:default=""}}

Thanks,
Tags (1)
2 REPLIES 2
Alok_Ramsisaria
Level 10

Re: problems with json sent from webhook on empty values

Also, you could try in the following way,

data={"type":"ddd","name":"aaa","externalId":"{{lead.id:default=}}","firstName":"{{lead.First Name:default=}}"

Hope this would help!
Anonymous
Not applicable

Re: problems with json sent from webhook on empty values

Setting the default value to {{lead.First Name:default=""}} is probably best way to ensure a predictable result for cases without a custom value.