cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hansswolfs
Level: Powered On

Post an adaptive card in a teams channel with a "reply via mail option"?

hey people,

first time posting here in the Power Automate forum. Hope you can help me out.

 

I have created a flow that's triggered via a HTTP request (a form filled in on our WordPress website) where parents of our students request help with their ELS (Electronic Learning System) account.

 

My idea is to post an adaptive card with the details they fill in on the webform and add a reply button to the adaptive card that allows us to send an email to the person in question with the resolution of their problem (most cases a new password).

 

I'm as far as getting the adaptive card to show up in our Teams channel but have no idea how to start to get that "Reply" button in there as well.

 

Hope this is even possible so looking forward to the replies!

 

So far, this is my JSON to get the adaptive card in Teams:

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "TextBlock",
            "text": "@{triggerBody()?['5']}",
            "id": "Title",
            "spacing": "Medium",
            "horizontalAlignment": "Center",
            "size": "ExtraLarge",
            "weight": "Bolder",
            "color": "Accent"
        },
        {
            "type": "TextBlock",
            "text": "@{triggerBody()?['1.3']} @{triggerBody()?['1.6']} heeft een probleem met de Smartschool-co-account van @{triggerBody()?['7.3']} @{triggerBody()?['7.6']} uit klas @{triggerBody()?['8']}: @{triggerBody()?['9']}",
            "id": "acInstructions",
"wrap": true
        }
    ]
}

 

(All the triggerbody entries are the fields I capture from the webform)

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Post an adaptive card in a teams channel with a "reply via mail option"?

Hi

Adaptive Cards declaration include an 'actions' section, so you declare buttons and related options: OpenURL, Submit, ShowCard...

As far as I know, PA Flow currently supports Submit events on new action blocks recently released for Microsoft Teams Connector, otherwise you will probably have to rely on OpenURL pointing to a secondary Flow, please note you could face security issues by using this second approach

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

4 REPLIES 4
Dual Super User
Dual Super User

Re: Post an adaptive card in a teams channel with a "reply via mail option"?

Hi

Adaptive Cards declaration include an 'actions' section, so you declare buttons and related options: OpenURL, Submit, ShowCard...

As far as I know, PA Flow currently supports Submit events on new action blocks recently released for Microsoft Teams Connector, otherwise you will probably have to rely on OpenURL pointing to a secondary Flow, please note you could face security issues by using this second approach

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

hansswolfs
Level: Powered On

Re: Post an adaptive card in a teams channel with a "reply via mail option"?

Sorry for the late reply @efialttes but it's been very busy here.

 

I went for the "Create an adaptive card in Teams and wait for response" instead then and when the Submit button in Teams is clicked, PA executes a "Send a mail from a shared mailbox" step to send the mail.

 

I'm having another problem though... In the adaptive card, there's an input field ("GebruikersCorr") to confirm the user's username together with all the details coming from the HTTP request:

    "type": "AdaptiveCard"
    "body": [
        {
            "type": "TextBlock",
            "text": "Probleem met Smartschool-account",
            "id": "Title",
            "spacing": "Medium",
            "horizontalAlignment": "Center",
            "size": "ExtraLarge",
            "weight": "Bolder",
            "color": "Accent"
        },
        {
            "type": "TextBlock",
            "text": "Aanvrager: @{variables('aanvrager')}  ( @{variables('email_aanvrager')} )",
            "id": "aanvrager1",
            "wrap": true
        },
        {
            "type": "TextBlock",
            "text": "Gegevens kind: @{variables('kind')}  uit klas  @{variables('klas')}",
            "id": "Gegevens kind",
            "wrap": true
        },
        {
            "type": "TextBlock",
            "text": "Probleem: @{variables('probleem')}",
            "id": "Probleem",
            "wrap": true
        },
        {
            "type": "TextBlock",
            "text": "Controleer de gebruikersnaam"
        },
        {
            "type": "Input.Text",
            "id": "GebruikersnaamCorr",
            "placeholder": "@{variables('gebruikersnaam')}"
        }
  ],
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Opgelost - verstuur email"
        }
    ]

 But for some reason whenever I put the HTTP Request fields in the adaptive card step (either straight from the HTTP Request field or either via variables (like the code posted)), I can't enter the "GebruikersCorr" field in the email step... The fields from the "Create and adaptive card" step just won't show up in the dynamic content list...

 

Is it possible the JSON has problems with the "@variable" that's created when inserting the dynamic content fields?

Dual Super User
Dual Super User

Re: Post an adaptive card in a teams channel with a "reply via mail option"?

Hi

Did my first answer solve the initial issue?

If so, my humble suggestion is:

1.-Mark this topic as "Solved" by clicking "Accept as a solution". THis way others with the same problem can find a solution faster

 

Flow_AcceptSolution.png

2.- Open a new thread for your next question, following the policy: 'One Question, one post'. This way you have more chances to attrack attention for superusers that are seeking for unanswered topics.

3.- (OPTIONAL) Click on 'Thumbs up' in any of my answers in this current thread if you found them valuable.

 

Flow_thumbsUp.png

Even though this 3rd step is OPTIONAL, please remember it is the cheapest, easiest way to say thanks to somebody that simply tried to help. And just between you and me, everytime an inspiring answer receive a kudo in this community, an ewok escapes from The Emperor menace 

 

If you finally open a new thread describing this new problem, please add my nickname @efialttes so I will inmediately receive an alert.

Thanks!

 


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



hansswolfs
Level: Powered On

Re: Post an adaptive card in a teams channel with a "reply via mail option"?

okido! Will open a new thread with a tag.

 

Cheers already!

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,479)