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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Adaptive Card Error - ...
Power Automate
Answered

Adaptive Card Error - Choiceset cannot take in dynamic array

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    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.

    Snipaste_2020-11-18_17-19-51.pngSnipaste_2020-11-18_17-20-02.pngSnipaste_2020-11-18_17-20-43.png

     

    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-intro 

    Please try to enable the 'Developer Preview' mode or modify the Adaptive Card Version from 1.2 to 1.0.

     

    Hope this helps.

    Sik 

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard