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 / Adaptive Card Error - ...
Power Automate
Answered

Adaptive Card Error - Invalid Json

(0) ShareShare
ReportReport
Posted on by 28

Please help me with this error

 

{
"error": {
"code": "InvalidJsonInBotAdaptiveCard",
"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: C. Path 'body[2].inlines[0].text', line 43, position 18.\r\n at Newtonsoft.Json.JsonTextReader.ParsePostValue(Boolean ignoreComments)\r\n at Newtonsoft.Json.JsonTextReader.Read()\r\n at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)\r\n at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)\r\n at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)\r\n at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)\r\n at Microsoft.Azure.ProcessSimple.Data.Components.AdaptiveCards.AdaptiveCardBuilder.DeserializeAdaptiveCard(String serializedAdaptiveCard, RequestIdentity requestor) in X:\\bt\\1046707\\repo\\src\\processsimple\\Roles\\ProcessSimple.Data\\Components\\AdaptiveCards\\AdaptiveCardBuilder.cs:line 384\r\n --- End of inner exception stack trace ---\r\n at Microsoft.Azure.ProcessSimple.Data.Components.AdaptiveCards.AdaptiveCardBuilder.DeserializeAdaptiveCard(String serializedAdaptiveCard, RequestIdentity requestor) in X:\\bt\\1046707\\repo\\src\\processsimple\\Roles\\ProcessSimple.Data\\Components\\AdaptiveCards\\AdaptiveCardBuilder.cs:line 392\r\n at Microsoft.Azure.ProcessSimple.Web.Common.Validation.BotAdaptiveCard(String card, RequestIdentity senderRequestIdentity) in X:\\bt\\1046707\\repo\\src\\processsimple\\Roles\\ProcessSimple.Web\\Common\\Validation\\BotValidation.cs:line 585"
}
}

Categories:
I have the same question (0)
  • efialttes Profile Picture
    14,756 on at

    Hi!

    Can you please share a screenshot from your flow design, also from your Adaptive Card json design?

    The error says Flow JSON parser found an unexpected character at line 43, position 18

    Thanx!

  • pavanpal Profile Picture
    28 on at

    Thanks for the revert. Here is the complete json

     

     

    {
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
    {
    "type": "TextBlock",
    "text": "New Request",
    "weight": "Bolder",
    "size": "Large"
    },
    {
    "type": "ColumnSet",
    "columns": [
    {
    "type": "Column",
    "width": "stretch",
    "items": [
    {
    "type": "TextBlock",
    "text": "@{body('Get_user_profile_(V2)')?['displayName']}",
    "weight": "Bolder",
    "wrap": true
    },
    {
    "type": "TextBlock",
    "spacing": "None",
    "text": "@{body('Convert_time_zone')}",
    "isSubtle": true,
    "wrap": true
    }
    ]
    }
    ]
    },
    {
    "type": "RichTextBlock",
    "inlines": [
    {
    "type": "TextRun",
    "text": "@{variables('varComments')}"
    }
    ]
    },
    {
    "type": "ActionSet",
    "actions": [
    {
    "type": "Action.OpenUrl",
    "title": "Chat",
    "url": "https://teams.microsoft.com/l/chat/0/0?users=@{body('Get_user_profile_(V2)')?['userPrincipalName']}"
    },
    {
    "type": "Action.OpenUrl",
    "title": "Email",
    "url": "mailto:@{body('Get_user_profile_(V2)')?['mail']}"
    }
    ]
    }
    ]
    }

  • efialttes Profile Picture
    14,756 on at

    Hi!

    In the Adaptive Cards I have designed so far, I close body before declaring actions.

    Not 100% sure this is the problem, but... my suggestion is to try this adaptive Card definition instead:

     

    {
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
    {
    "type": "TextBlock",
    "text": "New Request",
    "weight": "Bolder",
    "size": "Large"
    },
    {
    "type": "ColumnSet",
    "columns": [
    {
    "type": "Column",
    "width": "stretch",
    "items": [
    {
    "type": "TextBlock",
    "text": "@{body('Get_user_profile_(V2)')?['displayName']}",
    "weight": "Bolder",
    "wrap": true
    },
    {
    "type": "TextBlock",
    "spacing": "None",
    "text": "@{body('Convert_time_zone')}",
    "isSubtle": true,
    "wrap": true
    }
    ]
    }
    ]
    },
    {
    "type": "RichTextBlock",
    "inlines": [
    {
    "type": "TextRun",
    "text": "@{variables('varComments')}"
    }
    ]
    }

    ],
        "actions": [
    {
    "type": "Action.OpenUrl",
    "title": "Chat",
    "url": "https://teams.microsoft.com/l/chat/0/0?users=@{body('Get_user_profile_(V2)')?['userPrincipalName']}"
    },
    {
    "type": "Action.OpenUrl",
    "title": "Email",
    "url": "mailto:@{body('Get_user_profile_(V2)')?['mail']}"
    }
    ]
    }
     
    Hope this helps
  • pavanpal Profile Picture
    28 on at

    Hi,

     

    I am still getting same error, This is not working only with MS Teams. I check on adaptivecards designer page and it seems there is no issues with JSON.

     

    {
      "error": {
        "code""InvalidJsonInBotAdaptiveCard",
        "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: C. Path 'body[2].inlines[0].text', line 43, position 18.\r\n   at Newtonsoft.Json.JsonTextReader.ParsePostValue(Boolean ignoreComments)\r\n   at Newtonsoft.Json.JsonTextReader.Read()\r\n   at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)\r\n   at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)\r\n   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)\r\n   at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)\r\n   at Microsoft.Azure.ProcessSimple.Data.Components.AdaptiveCards.AdaptiveCardBuilder.DeserializeAdaptiveCard(String serializedAdaptiveCard, RequestIdentity requestor) in X:\\bt\\1046707\\repo\\src\\processsimple\\Roles\\ProcessSimple.Data\\Components\\AdaptiveCards\\AdaptiveCardBuilder.cs:line 384\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.Azure.ProcessSimple.Data.Components.AdaptiveCards.AdaptiveCardBuilder.DeserializeAdaptiveCard(String serializedAdaptiveCard, RequestIdentity requestor) in X:\\bt\\1046707\\repo\\src\\processsimple\\Roles\\ProcessSimple.Data\\Components\\AdaptiveCards\\AdaptiveCardBuilder.cs:line 392\r\n   at Microsoft.Azure.ProcessSimple.Web.Common.Validation.BotAdaptiveCard(String card, RequestIdentity senderRequestIdentity) in X:\\bt\\1046707\\repo\\src\\processsimple\\Roles\\ProcessSimple.Web\\Common\\Validation\\BotValidation.cs:line 585"
      }
    }
  • efialttes Profile Picture
    14,756 on at

    Hi again!
    Let's see if this works. Replace the URL in your action and use a concat() based expression instead:

    Current:
    url": "https://teams.microsoft.com/l/chat/0/0?users=@{body('Get_user_profile_(V2)')?['userPrincipalName']}"

    Proposal:
    url": "@{concat('https://teams.microsoft.com/l/chat/0/0?users=',body('Get_user_profile_(V2)')?['userPrincipalName'])}"

    Hope this helps

  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Wait, wait, wait

     

    If the error persists, I would suggest to remove rich text block just for troubleshooting purposes. According to the doc it was introduced in AdaptiveCards version 1.2...
    https://adaptivecards.io/explorer/RichTextBlock.html

     

    ...and according to Tomasz Poszytek blog (post from Jan2020) Power Automate supports 1.0.

    https://poszytek.eu/en/microsoft-en/office-365-en/powerautomate-en/register-response-from-custom-adaptive-cards-sent-from-power-automate-to-teams/


    According to this last post "...Microsoft Teams still works with version 1.0 of Adaptive Cards. If you don’t want to loose any functionalities of your designed card stick to those from SDK version 1.0 (https://github.com/microsoft/AdaptiveCards/releases/tag/v1.0)

    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

    Hope this helps

  • pavanpal Profile Picture
    28 on at

    Hey! I am a bit confused, Can you please remove the rich text block and give the copy the entire json here

     

    Thanks for your extended help. 

     

    Regards

    Pavan

  • efialttes Profile Picture
    14,756 on at

    Hi!

    I was referring to this section

    {
    "type": "RichTextBlock",
    "inlines": [
    {
    "type": "TextRun",
    "text": "@{variables('varComments')}"
    }
    ]
    },

     

    ...so once removed your original JSON would look like:

    {
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
    {
    "type": "TextBlock",
    "text": "New Request",
    "weight": "Bolder",
    "size": "Large"
    },
    {
    "type": "ColumnSet",
    "columns": [
    {
    "type": "Column",
    "width": "stretch",
    "items": [
    {
    "type": "TextBlock",
    "text": "@{body('Get_user_profile_(V2)')?['displayName']}",
    "weight": "Bolder",
    "wrap": true
    },
    {
    "type": "TextBlock",
    "spacing": "None",
    "text": "@{body('Convert_time_zone')}",
    "isSubtle": true,
    "wrap": true
    }
    ]
    }
    ]
    },
    {
    "type": "ActionSet",
    "actions": [
    {
    "type": "Action.OpenUrl",
    "title": "Chat",
    "url": "https://teams.microsoft.com/l/chat/0/0?users=@{body('Get_user_profile_(V2)')?['userPrincipalName']}"
    },
    {
    "type": "Action.OpenUrl",
    "title": "Email",
    "url": "mailto:@{body('Get_user_profile_(V2)')?['mail']}"
    }
    ]
    }
    ]
    }

     

    Hope this helps

  • pavanpal Profile Picture
    28 on at

    Oh God! You Are so awesome! It finally worked after removing Rich Text Block.

    Can you give me some hint on how to use the code if not Rich Text Block

     

    "type": "TextRun",
    "text": "@{variables('varComments')}

     

    P.S. -- I am not a developer, I am trying my best to help my colleague who is unwell.

  • efialttes Profile Picture
    14,756 on at

    Hi again!

    So, I would try the following: remove from the original design

    {
    "type": "RichTextBlock",
    "inlines": [
    {
    "type": "TextRun",
    "text": "@{variables('varComments')}"
    }
    ]
    },

     

    and use this other approach instead

    {
    "type": "TextBlock",
    "spacing": "None",
    "text": "@{variables('varComments')}",
    "isSubtle": true,
    "wrap": true
    },

     

    If it this replacement does not work, please let us know. If succeeds, since you already marked the topic as solved, as an optional way to thanx for weekend support is by just clicking 'Thumbs up' in this current answer, or even in all of them  😉

    Flow_thumbsUp.png

     

    Hope your colleague recovers soon!

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard