web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Intermittent Error - i...
Power Automate
Unanswered

Intermittent Error - invalid json in bot adaptive card

(0) ShareShare
ReportReport
Posted on by 13

Hoping someone can help with this intermittent error. I cannot figure out why it tends to fail for the same user, but only some of the time, the rest of the time there is no issue. 

 

The error reads:

 

The request failed. Error code: 'InvalidJsonInBotAdaptiveCard'. Error Message: 'Microsoft.Azure.ProcessSimple.Data.Entities.Exceptions.ProcessSimpleDataException: The specified Teams flowbot adaptive card request is missing or invalid. The tracking Id is '{0}'. ---> Newtonsoft.Json.JsonReaderException: Bad JSON escape sequence: \D. Path 'body[2].text', line 49, position 65.
at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote)
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at Microsoft.Azure.ProcessSimple.Data.Components.AdaptiveCards.AdaptiveCardBuilder.DeserializeAdaptiveCard(String serializedAdaptiveCard, RequestIdentity requestor, CultureInfo cultureInfo, BotAdaptiveCardAtMentions atMentions) in X:\bt\1012562\repo\src\processsimple\Roles\ProcessSimple.Data\Components\AdaptiveCards\AdaptiveCardBuilder.cs:line 504
--- End of inner exception stack trace ---
at Microsoft.Azure.ProcessSimple.Data.Components.AdaptiveCards.AdaptiveCardBuilder.DeserializeAdaptiveCard(String serializedAdaptiveCard, RequestIdentity requestor, CultureInfo cultureInfo, BotAdaptiveCardAtMentions atMentions) in X:\bt\1012562\repo\src\processsimple\Roles\ProcessSimple.Data\Components\AdaptiveCards\AdaptiveCardBuilder.cs:line 523
at Microsoft.Azure.ProcessSimple.Web.Common.Validation.BotAdaptiveCard(String card, RequestIdentity senderRequestIdentity) in X:\bt\1012562\repo\src\processsimple\Roles\ProcessSimple.Web\Common\Validation\BotValidation.cs:line 659'.

 

The JSON is designed in and copied from the adaptive card designer at adaptivecards.io

The flow takes newly submitted data from sharepoint list and sends it as an adaptive card to a Teams channel for review and approval. The JSON is posted below (user and email details have been anonymised) 

 

{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "Work Package Request: \n@{body('Get_item')['Title']}",
"id": "WorkPackageRequest"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "Image",
"style": "Person",
"url": "https://teams.microsoft.com/api/mt/emea/beta/users/@{body('Get_item')?['Author']?['Email']}/profilepicturev2?displayname=@{body('Get_item')?['Author']?['DisplayName']}&voidCache=false",
"size": "Small"
}
],
"width": "auto"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"weight": "bolder",
"text": "@{body('Get_item')?['Author']?['DisplayName']}",
"wrap": true
},
{
"type": "TextBlock",
"spacing": "None",
"text": "Created @{body('Convert_Created_time')}",
"isSubtle": true,
"wrap": true
}
],
"width": "stretch"
}
]
},
{
"type": "TextBlock",
"text": "@{body('Get_item')['DescriptionofWorkPackage']}",
"wrap": true
},
{
"type": "FactSet",
"facts": [
{
"title": "Ref #:",
"value": "@{body('Get_item')['ProjectReference_x0023_']}"
},
{
"title": "Deadline:",
"value": "@{body('Convert_Deadline_time')}"
},
{
"title": "Skill Required",
"value": "@{body('Get_item')['Skillsetrequired']}"
},
{
"title": "Duration:",
"value": "@{body('Get_item')['Duration']}"
},
{
"title": "Deliverables:",
"value": "@{body('Get_item')?['PackageDeliverables']}"
},
{
"title": "Pre-reqs:",
"value": "@{body('Get_item')['Pre_x002d_requisites']}"
},
{
"title": "Quality reqs:",
"value": "@{body('Get_item')?['QualityRequirements']}"
},
{
"title": "Escalate:",
"value": "@{body('Get_item')?['Escalation']}"
}
]
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.ShowCard",
"title": "Allocate",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Text",
"placeholder": "Resourced dates - type in",
"id": "ResourcedDates"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Last Date of resourced time:",
"horizontalAlignment": "Right",
"weight": "bolder",
"id": "last date"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "Input.Date",
"id": "EndDate"
}
]
}
]
},
{
"type": "TextBlock",
"text": "Select Allocated Staff",
"wrap": true,
"weight": "bolder"
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "User 1",
"value": "user.1@email.net"
},
{
"title": "User 2",
"value": "user2@email.net"
},
{
"title": "User 3",
"value": "user.3@email.net"
}
],
"placeholder": "Select Allocated Staff",
"id": "AllocatedStaff",
"wrap": true,
"separator": true
},
{
"type": "Input.Text",
"placeholder": "Comments",
"id": "AllocateComments",
"isMultiline": true
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"id": "AllocateSubmit",
"style": "positive"
}
]
},
"id": "Allocate",
"style": "positive"
}
]
}
],
"actions": [
{
"type": "Action.ShowCard",
"title": "Reject",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Text",
"placeholder": "Comments",
"id": "RejectComments",
"isMultiline": true
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"id": "RejectSubmit",
"style": "destructive"
}
]
},
"id": "Reject",
"style": "destructive"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}

 

Categories:
I have the same question (0)
  • chasestreetdev Profile Picture
    98 on at

    Is it possible that one of the inputs (maybe Comments) has quotes in it when it fails? This breaks the JSON.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard