Search code examples
microsoft-teamsmicrosoft-graph-teamsadaptive-cardsteams-toolkit

Using a form to post assistance request posts on a Teams channel


On my team SD agents usually require assistance from SD specialists, and this assistance request is made on our Teams channel room/chat.

We have problems making the agents use a text pre-defined template in order to provide SD specialists with minimal data set, information, incident number and so on.

ATM basically agents just copy paste into the chat this pre-defined text template. But this method is not effective because they copy from each other from previous help requests and at the end of the day it's a mess.

I was wondering if Teams has some kind of functionality or add-in or something that allows a pre-defined template to be used via a form, where the agents would click a button, the form pops up, they fill in the information and submit the form and the assistance request is immediately posted on the channel, keeping in this way all the information and topics always nice and tidy. Also would be useful if the form would refuse submission if some areas were left blank.

Is such a thing possible? How?

Thank you


Solution

  • I found the solution:

    1 - On "Power Automate", create a new "instant cloud flow", find Teams action: "From the compose box".

    2 - Click "Edit adaptive card". You now need to get a bit familiar with JSON and adaptive cards. This builder is useful and better than the one in Power Automate: https://adaptivecards.io/designer/

    3 - Be aware that each "input" block needs to have an "Id". When you're done, copy and paste the JSON code from adaptivecards.io if you used it, into the default designer.

    4 - Click on "Next step" and Search for Teams action: "Post a message in a chat or channel".

    5 - Now in this section you need to decide if the post will be as "User", or "Flow bot". I chose "User". "Post in" can be "Group chat" or "Channel". Then choose your "Team" and "Channel" (if you chose channel). On "Message" you should switch to HTML mode and use simple HTML for formatting the text that gets posted on the channel. For example, you can type the name for each item/text box on the form and use <strong> for bold and <br> for a line break and so on. Now in HTML mode, you can use the "Id" mentioned in point 3, which should be used here in order to get the value/text from the form the user submitted. You can choose the "Id"s on a panel that pops up on the right.

    6 - Now this next points I don't remember exactly. I'm not going to go back and reconfigure this on my Teams just to know what to write here, so I'll just explain as I remember it. On the Windows Teams app (or using Teams in the browser), you will need to install or add the "Power Automate" app. Then you also need to install/add the "Workflows" app.

    7 - Go to a compose text box in any chat, group chat, or channel that is not private, click the 3 dots on the right (last icon on the compose box), and search for "Workflows" after you find it, right-click on it and "pin" it to the compose box. Now every time you want to open the form just click on "Workflows" and then choose the form. If you end up creating more forms using Teams action "From the compose box" (mentioned in point 1), all these forms will show up here as a list, after you click on "Workflows" because that's what they are: Workflows.

    8 - I think there is an extra step that I don't remember well where you might need to connect your Teams to Power Automate through a connector or something, but now I'm not sure. Anyway, these last points from 6 to 8 were easy to figure out. The hardest part for me was from points 1 to 5 where I did need to dig for a few days to get everything working. If you have any questions just comment below. If you remember exactly what the steps are from 6 to 8, or if you find anything that needs correcting, please let me know in the comments too. Thanks! :)