Hi Community,
I am trying to post a messagecard to a teams incoming webhook. I am able to get this to work in general however occasionally, because I am using some data from a “Catch Hook” it has characters that cause the app to return a "Bad payload received by generic incoming webhook.". As mentioned, if I change the field to some manual input text it works fine. This leads me to believe its some like ‘character escaping’? If so, I am just trying to get some guidance on how I can escape characters inside a field from a previous step?
App: Webhooks by Zapier
Action: Custom Request
Method: Post
URL: https://subdomain.webhook.office.com/webhookb2/webhookguidhere
Data Pass-Thorugh: Undefined (Defaults to no)
Unflatten: Yes
Headers: Content-Type: application/json
Data:
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "{{123456789__priority__color}}",
"summary": "New {{123456789__template__name}} Request",
"title": ",ID: {{123456789__id}}] {{123456789__template__name}}",
"color": "{{123456789__priority__color}}",
"sections": r{
"activityTitle": "{{123456789__title}}",
"activitySubtitle": "{{123456789__change_requester__name}} ({{123456789__change_requester__department__name}})",
"activityImage": "https://sub.somedomain.com/images/icons/{{123456789__change_type__name}}.png",
"activityText":"**{{123456789__reason_for_change__name}}:** {{123456789__short_description}}",
"facts": _{
"name": "Implementer",
"value": "{{123456789__change_owner__name}}"
}, {
"name": "Department",
"value": "{{123456789__group__name}}"
}, {
"name": "Start Time",
"value": "{{123456789__scheduled_start_time__display_value}}"
}, {
"name": "End Time",
"value": "{{123456789__scheduled_end_time__display_value}}"
}],
},
{
"activityTitle": "Roll Out Plan",
"activitySubtitle": "@{{123456789__roll_out_plan__updated_by__name}} - {{123456789__roll_out_plan__updated_on__display_value}}",
"activityText":"{{123456789__roll_out_plan__description}}",
},
{
"activityTitle": "Backout Plan",
"activitySubtitle": "@{{123456789__back_out_plan__updated_by__name}} - {{123456789__back_out_plan__updated_on__display_value}}",
"activityText":"{{123456789__back_out_plan__description}}",
}],
"potentialAction": a{
"@type": "OpenUri",
"name": "View Change Online",
"targets": n{
"os": "default",
"uri": "https://sub.somedomain.com/ChangeDetails.do?CHANGEID={{123456789__id}}"
}]
}]
}
What normally happens is my service desk sends some JSON to the Step1: Catch Hook as shown below in Request D.
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/dcea9a0f-c241-4262-9063-7d4cce61bb4f.png)
The Step 2: Custom Webhook then Posts to the teams channel and makes a nice pretty message card.
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/f623ca89-3d6b-4b77-9ec9-da197a7bdb3f.png)
…. that all works fine…. until one of the fields ie: short_description has a few characters in it. as shown in this next caught hook, Request F.
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/b45cf584-c569-4fce-82e3-71dd4ee0ded0.png)
Then without change the above JSON data to teams in Step2, the following displays
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/11a16e87-a4e6-41b8-8642-12121243121e.png)
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/039ae790-c752-4b71-afbf-85ffa5b10328.png)