
Announcements
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"
}
Is it possible that one of the inputs (maybe Comments) has quotes in it when it fails? This breaks the JSON.