Is it possible to remove line breaks from within a Text field using a Flow step?
We are using a Text field in a webhook call, and getting a BadRequest error when the field has line breaks and does not adhere to JSON string format.
Solved! Go to Solution.
You don’t add quotes around the tokens in the payload.
JSON encoding takes care of quoting when necessary. It encodes values based on the datatype (string, number, boolean).
Here is the response I got from the target system admin...
You need to have Request Token Encoding set to JSON:
There’s no need to make changes to the stored value.
Already in place...
Where is that “message“
JSON property coming from?
It is part of the Payload of the webhook call - the syntax is below.
{
"salesOrg": "{{lead.Sales Org:default=edit me}}",
"contactId": "{{member.PMCFstring6}}",
"accountId": "{{lead.Account Nbr (SFDC):default=edit me}}",
"campaignName": "{{member.PMCFstring5}}",
"firstName": "{{lead.First Name:default=edit me}}",
"lastName": "{{lead.Last Name:default=edit me}}",
"fullName": "{{lead.Full Name:default=edit me}}",
"email": "{{lead.Email Address:default=edit me}}",
"phone": "{{lead.Phone Number:default=edit me}}",
"city": "{{lead.City:default=edit me}}",
"state": "{{lead.State:default=edit me}}",
"zip": "{{lead.Postal Code:default=edit me}}",
"country": "{{lead.Country:default=edit me}}",
"currencyIsoCode": "{{lead.Lead Currency:default=edit me}}",
"company": "{{lead.Company_formUse:default=edit me}}",
"profession": "{{lead.Profession:default=edit me}}",
"position": "{{lead.Primary Position:default=edit me}}",
"leadId": "{{member.PMCFstring7}}",
"products": "{{Lead.Web product Interest:default=edit me}}",
"inquiryType": "{{member.PMCFstring1}}",
"message": "{{Lead.Feedback_txt_long:default=edit me}}",
"formId": "{{member.PMCFstring3}}",
"formName": "{{member.PMCFstring4}}",
"formUrl": "{{member.PMCFstring2}}",
"sourceSystem": "{{lead.Lead Source:default=edit me}}"
}
The fields on the left are SFDC fields.
Thanks Sanford - that did it!
Good to hear, thought it would be something like that.