microsoft-teams-apps-requestateam icon indicating copy to clipboard operation
microsoft-teams-apps-requestateam copied to clipboard

Post an Adaptive Card to a Teams Channel and wait for a response - fails

Open NPrice99 opened this issue 3 years ago • 11 comments

The Request Teams Approval PowerAutomate Flow fails in the step Post an Adaptive Card to a Teams Channel and wait for a response :-

The request failed. Error code: 'BotRequestFailed'. Error Message: 'Request to the Bot framework failed with error: '{"error":{"code":"BadSyntax","message":"Bad format of conversation ID"}}'.'. Here is the JSON -

{ "type": "AdaptiveCard", "bod y": [ { "type": "TextBlock", "size": "Large", "weight": "Bolder", "text": "Pending Approval" }, { "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "FactSet", "facts": [ { "title": "Requested by:", "value": "@{triggerBody()?['Author']?['DisplayName']}" }, { "title": "Date created: ", "value": "@{formatDateTime(triggerBody()?['Created'],'F')} UTC" }

                        ],
                        "spacing": "Large"
                    }
                ],
                "width": "stretch"
            }
        ]
    },
    {
        "type": "ColumnSet",
        "columns": [
            {
                "type": "Column",
                "width": "95px",
                "spacing": "Medium",
                "items": [
                    {
                        "type": "TextBlock",
                        "text": " "
                    }
                ]
            },
            {
                "type": "Column",
                "items": [
                    {
                        "type": "TextBlock",
                        "text": "**Team Name:** @{triggerBody()?['Title']}",
                        "isSubtle": true,
                        "wrap": true
                    },
                    {
                        "type": "TextBlock",
                        "text": "**Description:** @{triggerBody()?['TeamDescription']}",
                        "isSubtle": true,
                        "wrap": true,
                        "spacing": "None"
                    },

                   
                    {
                        "type": "TextBlock",
                        "text": "**Business Justification:** @{triggerBody()?['BusinessJustification']}",
                        "isSubtle": true,
                        "wrap": true,
                        "spacing": "None"
                    },
    {
                        "type": "TextBlock",
                        "text": "**Confidential data:** @{triggerBody()?['ConfidentialData']}",
                        "isSubtle": true,
                        "wrap": true,
                        "spacing": "None"
                    },
                    {
                        "type": "TextBlock",
                        "text": "**Visibility:** @{triggerBody()?['Visibility']?['Value']}",
                        "isSubtle": true,
                        "wrap": true,
                        "spacing": "None"
                    },
                    {
                        "type": "TextBlock",
                        "text": "**Template type:** @{triggerBody()?['TemplateTitle']}",
                        "isSubtle": true,
                        "wrap": true,
                        "spacing": "None"
                    }
                ],
                "width": "stretch"
            }
        ],
        "spacing": "Small"
    }
],
"actions": [
    {
        "type": "Action.ShowCard",
        "title": "Approve",
        "card": {
            "type": "AdaptiveCard",
            "body": [
                {
                    "type": "Input.Text",
                    "id": "approveComment",
                    "placeholder": "Add a comment",
                    "isMultiline": true
                }
            ],
            "actions": [
                {
                    "type": "Action.Submit",
                      "id":"Approve",
                    "title": "Submit",
                }
            ],
            "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
        }
    },
    {
        "type": "Action.ShowCard",
        "title": "Reject",
        "card": {
            "type": "AdaptiveCard",
            "body": [
                {
                    "type": "Input.Text",
                    "id": "rejectComment",
                    "placeholder": "Add a comment",
                    "isMultiline": true
                }
            ],
            "actions": [
                {
                    "type": "Action.Submit",
                      "id":"Reject",
                    "title": "Submit"
                }
            ],
            "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
        }
    }
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"

}

NPrice99 avatar Jan 20 '21 10:01 NPrice99

@NPrice99 Are you able to share the details of the Team that was requested? I'm wondering if a special character perhaps in one of the column values is causing this.

alexc-MSFT avatar Feb 19 '21 11:02 alexc-MSFT

Hi I have the same issue here i get that ChannelID not found, I've verified and it's correct. sometimes the Team gets created hours after.

image

hhmaity avatar Apr 08 '21 20:04 hhmaity

Is there a workaround for this issue? When using ChannelID and TeamID the flow fails with the 'ChannelNotFound' error (as described above) and therefore the Admins will be unaware that there's a new request for approval. I read that if we leave these blank and use the Admin Mail ID instead so that an email can be received to mailbox, however this also is not working for us as well.

dav1dbailey avatar May 10 '21 13:05 dav1dbailey

I fixed this by ignoring the instruction to encode the ChannelID. Step 2 Point 10

NPrice99 avatar May 10 '21 13:05 NPrice99

Thanks for the quick reply. Do you use the Admin Mail ID instead?

dav1dbailey avatar May 10 '21 13:05 dav1dbailey

No - if you click on details you can see the approve butyon

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: dav1dbailey @.> Sent: Monday, May 10, 2021 2:51:20 PM To: OfficeDev/microsoft-teams-apps-requestateam @.> Cc: Nigel Price @.>; Mention @.> Subject: Re: [OfficeDev/microsoft-teams-apps-requestateam] Post an Adaptive Card to a Teams Channel and wait for a response - fails (#217)

Thanks for the quick reply. Do you use the Admin Mail ID instead?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/OfficeDev/microsoft-teams-apps-requestateam/issues/217#issuecomment-836726717, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACAXJUDCWNV6ZRC3MXQG44LTM7QFRANCNFSM4WKPIJYA.

NPrice99 avatar May 10 '21 13:05 NPrice99

Oh. Looks like I am missing something here. I am assuming you are describing a 'details' button on a message in the Admin team Team channel? I don't get any notification when a request is made and waiting for approval (I have the whole process working except the issue described above).

dav1dbailey avatar May 10 '21 13:05 dav1dbailey

You have two options :- 1) ignore Step 2 point 10 - that should get the adaptive card working. or 2) keep checking the "Approve Requests" tab click on details and there is an "Approve" button there.

NPrice99 avatar May 10 '21 14:05 NPrice99

Ok thanks. Looks like we just continue with option 2 (regularly check to see if any requests are waiting approval).

dav1dbailey avatar May 10 '21 14:05 dav1dbailey

I have taken another look at this and found a resolution. Keeping the ChannelID and TeamID steps blank as you suggested then within the 'Post an Adaptive Card to a Teams Channel and wait for a response' step remove the variables and enter the TeamID as a custom value. The connector works its magic and you then need to select the channel 'General' from the list.

image

dav1dbailey avatar May 11 '21 08:05 dav1dbailey

for me it worked and all of a sudden I receive "Something went wrong. Please try again" on the submit step. It looks like the adaptive card is not receiving its response. Any Idea? I tried to create a brand new team with an instant flow, this also failed. Maybe I am missing a general setting in Teams? image

pieronegri avatar Jul 01 '21 13:07 pieronegri