cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dgpadia
Advocate I
Advocate I

Working within JSON objects and getting Adaptive Cards to display in Teams

        {
            "type": "Container",
            "separator": true,
            "items": [
                {
                    "type": "TextBlock",
                    "size": "Large",
                    "weight": "Bolder",
                    "color": "Accent",
                    "text": "Project Links"
                },
                {
                    "type": "TextBlock",
                    "spacing": "Small",
                    "size": "Small",
                    "text": "Project Links Dynamic Multiple",
                    "wrap": true
                }
            ]
        },

This is an example chunk of an adaptive card I am building. For the second text block, I want to be able to split a Forms response (already have that part) and do a for-each where a new text block using the parameters of the last text box above and the output of the split in the text field. 

 

I'm trying to return an Adaptive Card to Teams using objects instead of strings since supplying a string of the JSON returned this at the final action to submit the card to Teams:

"error": {
  "code": "MissingOrInvalidBotAdaptiveCardRequest",
  "message": "The specified Teams flowbot adaptive card request is missing or invalid."
}

Either I'm not submitting the data properly using Flow, or something is not right on the Teams side. Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

I see, have you tried going here ? https://adaptivecards.io/designer

 

Also I had to install both App Studio in Teams and install the Flow Bot on the Team where I wanted to post tickets from flow I assume you've done this?

Its working for me so far

View solution in original post

7 REPLIES 7
dgpadia
Advocate I
Advocate I

Now I am finding that the message body for the action "Post your own adaptive card as the Flow bot to a channel (preview)" absolutely HAS to be a string. It won't allow me to insert a variable of the type 'object' into the message body. So there's that, I guess. I'll have to do everything via strings. Either way, I'm still getting this error message no matter how I enter the card information. 

Haing exactly the same issue, did you manage to work anything out?


@dgpadia wrote:

Now I am finding that the message body for the action "Post your own adaptive card as the Flow bot to a channel (preview)" absolutely HAS to be a string. It won't allow me to insert a variable of the type 'object' into the message body. So there's that, I guess. I'll have to do everything via strings. Either way, I'm still getting this error message no matter how I enter the card information. 




I also posed the question here: https://stackoverflow.com/questions/55070910/microsoft-flow-teams-adaptive-card?noredirect=1#comment...
No real answers, but one user did know to put in an issue/request at the Microsoft documentation GitHub to see if they could provide answers: https://github.com/MicrosoftDocs/flow-docs/issues/100
Knowing Microsoft, maybe we'll get an answer sometime next year . . . Or the year after . . .

Was just wondering if you are doing it via json did you put the schema in ? I tried this and managed to get it to post by putting this at the end of my code. 

Yeah, I even tried just submitting the example card json as static text (no variables or anything dynamic) and I still get the same error.

I see, have you tried going here ? https://adaptivecards.io/designer

 

Also I had to install both App Studio in Teams and install the Flow Bot on the Team where I wanted to post tickets from flow I assume you've done this?

Its working for me so far

View solution in original post

Everything works now. Apparently, my corporate IT did have permissions accepted for the TeamsFlowTab app for our corporate Office 365. Once that was done, we can now post adaptive cards. I also did install App Studio, but I'm not sure if it was necessary or not, as they approved the permissions after I left on Friday. I come in Monday and right away get to adding the App Studio app. Maybe it was one or the other, maybe it was both. Either way, the double check for permissions is to open the Flow app in Teams and try to go to the Flows or Approvals tabs and see if it will let you sign in. 

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (77,444)