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.
The Step 2: Custom Webhook then Posts to the teams channel and makes a nice pretty message card.
…. 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.
Then without change the above JSON data to teams in Step2, the following displays