cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Invalid JSON when posting adaptive card to channel

Hi Everyone,

 

I've recently been designing a flow that does the following:

  • Person fills out form
  • Response is gathered and the details are posted in a channel as an adaptive card for review using the "Post an Adaptive Card to a teams channel and wait for response action"
  • Adaptive card then updates when it is reviewed.

 

I have however been getting the error:

 

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: After parsing a value an unexpected character was encountered: A. Path 'body[15].columns[1].items[0].text', line 302, position 39.
at Newtonsoft.Json.JsonTextReader.ParsePostValue(Boolean ignoreComments)
at Newtonsoft.Json.JsonTextReader.Read()
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\1019601\repo\src\processsimple\Roles\ProcessSimple.Data\Components\AdaptiveCards\AdaptiveCardBuilder.cs:line 503
--- 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\1019601\repo\src\processsimple\Roles\ProcessSimple.Data\Components\AdaptiveCards\AdaptiveCardBuilder.cs:line 522
at Microsoft.Azure.ProcessSimple.Web.Common.Validation.BotAdaptiveCard(String card, RequestIdentity senderRequestIdentity) in X:\bt\1019601\repo\src\processsimple\Roles\ProcessSimple.Web\Common\Validation\BotValidation.cs:line 614'.

 

I seem to have isolated the issue down to the fact the adaptive card does not like a 'choice' variable from the form, because as soon as I remove it from the adaptive card, it seems to work fine.  Would any of you know how to fix the below adaptive card so it knows how to comprehend the multiple choice variable.  I have highlighted the problematic variable in red.

 

Adaptive Card:

 

{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "ExtraLarge",
"weight": "Bolder",
"text": "New Training Request:",
"horizontalAlignment": "Center"
},
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['rf193d622fdb54fcfa44bece86b4c19e0']}",
"size": "Large",
"weight": "Bolder",
"horizontalAlignment": "Center",
"wrap": true
},
{
"type": "TextBlock",
"text": "Part A: Origin of the request",
"wrap": true,
"separator": true,
"fontType": "Default",
"size": "Large",
"weight": "Bolder",
"spacing": "ExtraLarge",
"height": "stretch",
"color": "Accent"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Name:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['rcc75971b027a4aeabe2c30b93f5d4d7a']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Email Address:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['racf987b0e7764d7ba037fa584973de43']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Department:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['r57a91a730c8c481cba16fdca9dbf00e6']}",
"wrap": true
}
]
}
]
},
{
"type": "TextBlock",
"text": "Part B: Details of the training request",
"wrap": true,
"size": "Large",
"weight": "Bolder",
"separator": true,
"spacing": "ExtraLarge",
"color": "Accent"
},
{
"type": "TextBlock",
"text": "Please provide an overview of your training request, with detailed notes outlining what you require and how it would benefit the business:",
"wrap": true,
"fontType": "Default",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['rb80005928ce743d9848cb12ffca5752f']}",
"wrap": true
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Date of submission:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['ra25664a92ff4462e99f564d3117b28fe']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Target start date:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['r52437179bcd547dbbddd05f37821e771']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Target due date:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['r08db7d5881504fb78875721b00b73677']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Approved by manager?",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['re4444967c9994728ae89c25ad79886cd']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Authorising manager:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['r4e336bd436e745dcafea16fa7c9a48a5']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Delivery Method:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['rfd6b7b86833d495594e5fdb31f1e1f8c']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Training Headcount:",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['r6e6ba7c99afd4bccac6b5ac411ad0df9']}",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Training Material Required?",
"wrap": true,
"weight": "Bolder"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['rd51e6aa0649c469e9866bf2311ba9b09']}",
"wrap": true
}
]
}
]
},
{
"type": "TextBlock",
"text": "Part C: Confirmation of the request",
"wrap": true,
"size": "Large",
"weight": "Bolder",
"separator": true,
"spacing": "ExtraLarge",
"color": "Accent"
},
{
"type": "TextBlock",
"text": "Do you have any additional information you wish to disclose?\n",
"wrap": true,
"height": "stretch",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "@{body('Get_the_training_response_details')?['r7798986504994eba974ed378aa181d0c']}",
"wrap": true
},
{
"type": "Input.Text",
"placeholder": "Enter comments",
"isMultiline": true,
"id": "Comments"
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Approve",
"id": "Approve"
},
{
"type": "Action.Submit",
"title": "Reject",
"id": "Reject"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}

0 REPLIES 0

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (109,424)