This was previously working but it broke suddenly.
The Choiceset takes in a dynamic array as the value and presents to the user.
Format of the array:
[{"title":"Value1","value":"value1"},{"title":"Value2","value":"value2"}]
Adaptive card:
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"text": "text",
"wrap": true,
"weight": "Bolder",
"isSubtle": true,
"fontType": "Default",
"size": "Large"
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "text",
"wrap": true
}
]
},
{
"type": "TextBlock",
"text": "@{outputs('Get_@mention_token_for_a_user')?['body/atMention']} \nPlease assign SA for this opportunity",
"wrap": true
},
{
"type": "Input.ChoiceSet",
"choices": @{variables('sa_array')},
"placeholder": "Select from these choices",
"id": "assignedSA"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"id": "btnSubmit",
"style": "destructive"
}
]
}
Error message:
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: P. Path 'body[1].items[0].text', line 20, position 72.
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\1136156\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\1136156\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\1136156\repo\src\processsimple\Roles\ProcessSimple.Web\Common\Validation\BotValidation.cs:line 642'.
This issue is resolved when I hardcore the values instead. This is not what I want.
Solved! Go to Solution.
Hi Sik
Thanks for your response. I have since figured that the issue was with another field where the form result was returning a string with " in an array format string which was causing the entire JSON to break and giving wrong error information. This has since been resolved. Thanks!
Hi @leroylim ,
Could you please share the flow steps? How do you define the array?
I made a test on my side, but can't reproduce your issue, the Array variable can be taken in the adaptive card properly, please see my test outcome.
The clue I found from this blog is that If you’d like to use some of the features from versions 1.1 and 1.2 please turn your Teams (desktop or web) into “Developer Preview”: https://docs.microsoft.com/en-us/microsoftteams/platform/resources/dev-preview/developer-preview-int...
Please try to enable the 'Developer Preview' mode or modify the Adaptive Card Version from 1.2 to 1.0.
Hope this helps.
Sik
Hi Sik
Thanks for your response. I have since figured that the issue was with another field where the form result was returning a string with " in an array format string which was causing the entire JSON to break and giving wrong error information. This has since been resolved. Thanks!
User | Count |
---|---|
11 | |
8 | |
7 | |
3 | |
3 |
User | Count |
---|---|
16 | |
8 | |
6 | |
4 | |
2 |