cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DarrenPlant
Helper II
Helper II

Post_your_own_adaptive_card_as_the_Flow_bot_to_a_channel failed

Help!!  I ran the flow 4 times successfully, now the next two times failed???

 

The json for the adaptoive card to be sent to TEAMS:

 

{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"size": "ExtraLarge",
"wrap": true,
"text": "SynaPortal - New Minor Release",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "Description: @{triggerOutputs()?['body/Description']}",
"wrap": true,
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "DevOpsID: @{triggerOutputs()?['body/DevOpsID']}",
"wrap": true,
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "Date Created: @{triggerOutputs()?['body/DateCreated']}",
"weight": "Bolder"
}
],
"style": "emphasis",
"bleed": true
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}

 

My errors:

 

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: S. Path 'body[0].items[1].text', line 16, position 43.

 

{
  "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: S. Path 'body[0].items[1].text', line 16, position 43.\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, CultureInfo cultureInfo, BotAdaptiveCardAtMentions atMentions) in X:\\bt\\1089125\\repo\\src\\processsimple\\Roles\\ProcessSimple.Data\\Components\\AdaptiveCards\\AdaptiveCardBuilder.cs:line 462\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.Azure.ProcessSimple.Data.Components.AdaptiveCards.AdaptiveCardBuilder.DeserializeAdaptiveCard(String serializedAdaptiveCard, RequestIdentity requestor, CultureInfo cultureInfo, BotAdaptiveCardAtMentions atMentions) in X:\\bt\\1089125\\repo\\src\\processsimple\\Roles\\ProcessSimple.Data\\Components\\AdaptiveCards\\AdaptiveCardBuilder.cs:line 481\r\n   at Microsoft.Azure.ProcessSimple.Web.Common.Validation.BotAdaptiveCard(String card, RequestIdentity senderRequestIdentity) in X:\\bt\\1089125\\repo\\src\\processsimple\\Roles\\ProcessSimple.Web\\Common\\Validation\\BotValidation.cs:line 585"
  }
}
2 ACCEPTED SOLUTIONS

Accepted Solutions

@DarrenPlant 

 

As I do not have complete visibility of your flow, if you want to escape double quotes, then place a Compose action before the adaptive card action with an expression for the value.

 

In the expression, replace " with \"

 

Example: Replace(triggerOutputs()?['body/Description'],'"','\"')

 

Try using the output of the compose action in the adaptive card.

 

The back slash should escape the double quote.

 

Give a try and let me know how it works for you.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

View solution in original post

Thanks for your efforts, still struggling with the compose:

 

replace(triggerOutputs()?['body/Description'],"",'\"'   (what I used, but is staying in error)

 

Flow checker, Error, Compose, Fix invalid expression(s) for the input parameter(s) of operation 'Compose'.

 

My flow below:

 

The settings within the first step are pasted further below.

 

DarrenPlant_0-1594150535827.png

 

DarrenPlant_1-1594150632805.png

 

View solution in original post

4 REPLIES 4
rsaikrishna
Community Champion
Community Champion

@DarrenPlant 

 

Observed that the adaptive card version in your JSON showing as 1.2.

 

Use Adaptive Card designer with  your JSON and change version to 1.0.   Flow bot only supports that for now

 

Give a try by changing the version to 1.0 and test the JSON in the adaptive card designer. Once it looks good, then copy the JSON to the action in Power Automate.

 

Please post here if you have further questions.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

Hi @rsaikrishna, I have changed to v1.0, weird that it worked fine but not for the last two, whereas I am using v1.2 in other flowbot teams adaptive card flow.  I have noticed an issue though and need further advice.  From looking at the debug it point to the value I have as my value (dynamic) being pulled from the SharePoint list. 

 

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: S. Path 'body[0].items[1].facts[0].value', line 19, position 39.

 

My line 19 is the value line below in the flow inputs.  My cell from the SharePoint list has speech marks "" which I believe is causing the issue.  If this is correct debug, how can I get around this?

 

"type": "FactSet",
"facts": [
{
"title": "Description",
"value": ""Ship To Information” & “Bill To Information” sections & field naming, plus field reordering"

 

My adaptive card:

{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"size": "ExtraLarge",
"wrap": true,
"text": "SynaPortal - New Minor Release",
"weight": "Bolder"
},
{
"type": "FactSet",
"facts": [
{
"title": "Description",
"value": "@{triggerOutputs()?['body/Description']}"
},
{
"title": "DevOpsID",
"value": "@{triggerOutputs()?['body/DevOpsID']}"
},
{
"title": "Date Created",
"value": "@{triggerOutputs()?['body/DateCreated']}"
}
]
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}

 

Br

Darren

@DarrenPlant 

 

As I do not have complete visibility of your flow, if you want to escape double quotes, then place a Compose action before the adaptive card action with an expression for the value.

 

In the expression, replace " with \"

 

Example: Replace(triggerOutputs()?['body/Description'],'"','\"')

 

Try using the output of the compose action in the adaptive card.

 

The back slash should escape the double quote.

 

Give a try and let me know how it works for you.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

Thanks for your efforts, still struggling with the compose:

 

replace(triggerOutputs()?['body/Description'],"",'\"'   (what I used, but is staying in error)

 

Flow checker, Error, Compose, Fix invalid expression(s) for the input parameter(s) of operation 'Compose'.

 

My flow below:

 

The settings within the first step are pasted further below.

 

DarrenPlant_0-1594150535827.png

 

DarrenPlant_1-1594150632805.png

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,376)