0

I suspect this is too advanced for what Adaptive Cards can do, but I'm asking here to be sure and get alternative ideas if people have any.

My workplace has a process in effect where we must complete a health check before we're permitted to work onsite. The resulting email confirms to our manager whether we are fit to work onsite or not.

I would like to show an Adaptive Card in our MS Teams group chat that will prompt team members to confirm whether they pass or fail the health check and send the relevant email to the team manager.

Is this possible, and if not, are there any alternative approaches that might work?

David Metcalfe
  • 2,237
  • 1
  • 31
  • 44
  • That’s actually quite simple but what’s the trigger though and what should be on the card? Is it the whole health check or just a yes/no? You’d want to target every person individually, no? If you put it on a group chat, how does that work? Also, for ease, have you looked at Microsoft Forms? Might be a better option. – Skin Apr 29 '22 at 20:58
  • @Skin There are set days we are supposed to be in the office, so I'd try to trigger based off which day of the week, and sometime in the morning. As for uniqueness, the resulting email is the same regardless of the person. It's only different if there's a pass/fail of the check. So I'd want the email to be sent from the person saying they pass or fail the check, and send to the manager with pre-set body text. – David Metcalfe Apr 29 '22 at 21:56
  • Yeah, ok, so the card needs to go out to each person individually, correct? It’s less about the email, more about the card. Again though, how complex is the card? Is it yes/no or the entire health check? If it’s yes/no, how is the health check filled in? – Skin Apr 29 '22 at 22:00
  • @Skin Yes/No for the health check since I could just have the symptom checklist in the card. If you have any of these symptoms, you fail the health check. – David Metcalfe May 01 '22 at 19:51

2 Answers2

1

I've provided a simple answer that demonstrates the possibilities but you'll need to take it further for your own scenario.

For a start, this is the JSON of the card, it's simple but again, it can be built on using the card designer (https://adaptivecards.io/designer/) ...

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "size": "Medium",
            "weight": "Bolder",
            "text": "Health Check Result"
        },
        {
            "type": "TextBlock",
            "text": "Did you pass the health check?",
            "wrap": true
        },
        {
            "type": "ActionSet",
            "actions": [
                {
                    "type": "Action.Submit",
                    "title": "Yes",
                    "style": "positive",
                    "id": "Yes"
                },
                {
                    "type": "Action.Submit",
                    "title": "No",
                    "style": "destructive",
                    "id": "No"
                }
            ]
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.2"
}

As for the action, you need to set it up like this ...

Adaptive Card Action

... then when it comes through to Teams and the user makes their selection ...

Teams

... you'll be able to deal with the response with relative ease ...

Result

Skin
  • 9,085
  • 2
  • 13
  • 29
0

The most simple approach might be, instead of going to the Team chat itself, to send "proactive" messages to the individuals directly, via Power Automate (there is a built-in "Flow" bot that can send direct messages to the users). Via the Flow, you can get the list of team members, send them each an adaptive card, wait for the responses, and send a relevant email.

Hilton Giesenow
  • 9,809
  • 2
  • 10
  • 24