With all the news around Microsoft Teams during Microsoft Ignite and before, you might came across the following challenge. When uploading a file to a specific Teams channel you tried to select a Power Automate flow you or someone else created and shared with you via „…“ and the resulting UI was something like this:

Microsoft Teams – Files – Context Menu options

So you asked yourself where is my Power Automate section within that context menu? If you click „Open in SharePoint“, it will bring you to a screen like this:

SharePoint – Selected File – Context Menu options

Here, you can find Automate inside your context menu and many more options. There´s obviously a design gap we´ve identified between the SharePoint and the Microsoft Teams layout presenting files.

Solution 1:
Assuming you´ve implemented an approval request for a selected file your way of „triggering“ this event would be a 4-step action that way. Select the file within Microsoft Teams, select Open in SharePoint from context menu, select the file in SharePoint UI again, select the approval request flow from the Automate context menu option.

Note that this solution is only possible when using the Microsoft Teams web or desktop experience. From the mobile client, the options inside your context menu from within Microsoft Teams mobile app are different.

As you can see this solution comes with a switch between two applications and in many cases, you might not want to switch between clients. So what´s the next best thing?

Microsoft Teams – Files tab with a folder in it

One thing you could consider is to use the Move context menu option. In my case, I´ve created a folder called Init Approval.

Solution 2:
Whenever a user is going to move the file to this Init Approval folder, the request approval flow is going to be initiated for that file. It will start the approval process and ensures that the user knows about the progress. How? Let´s take a look into the details.

SharePoint – Preparing a custom column

First, I´ve created a custom column that hosts my approval status. Whenever a user is uploading a file to the file repository within Microsoft Teams, this column shows „Not initiated“ as default to allow the user recognizing the current status.

Microsoft Teams – Approval pending

Whenever a user moves the file to the Init Approval folder, the approval process kicks-in, changes the status to Pending and moves the file back to the original main folder. That way, the Init Approval folder should be clean, not containing any documents unless someone created a file directly inside that folder. The user though don´t need to jump into this folder to get the approval status from the moved document to init the process. They can take a look at the column inside the main folder next to their document.

The beauty of this solution is, it doesn´t cause any additional licensing as all these actions can be done with the Power Automate seeded licensing inside Office 365 / Microsoft 365 licensing.

The downfall of this solution is, it takes a folder to be „mapped“ to the approval flow. With a couple of condition clauses, I could certainly use one folder to initiate different kind of flows, but it would be tough for users to understand which kind of flow kicking-in at which time, unless you would train them.

Another downfall of this solution is, again it only works inside the Microsoft Teams Desktop or Web experience. Moving files in the Microsoft Teams mobile app – as of writing this article – would cause users to use another app for this action – OneDrive for Business or SharePoint mobile app.

You might ask, what´s the trick behind the trigger as the move file can´t be found as a trigger inside the SharePoint connector. Using the create file trigger inside the SharePoint connector won´t trigger the flow to run, as we´ve not created a file, we moved a file.

Microsoft Power Automate – Approval request flow logic

What I did was using a Recurrence trigger, this uses the Get items SharePoint action with a Filter Query as listed in the visual above to only react on those documents. The rest of the approval flow logic is up to you. [I will not outline the various options for creating approval flows here, as you can find many examples via a simple research]. I would recommend starting with a template like this and modify.

To be fair, another downfall of this solution is certainly the recurrence pattern, which causes API calls to be consumed over the day, as it continuously looks for „jobs“, even if there´s no file moved into the folder. So we could implement the flow to terminate, if there´s no document found that matches the Filter Query statement, but it will still consume API calls.

Additionally, a couple of other cross-checks might be considered. What about documents being directly created inside my Init Approval folder? With the current logic given, their „My Approval Status“ would be „Not initiated“ as well, as I selected this to be my default value. But that was out of scope for todays article, as I only wanted to outline the out-of-box capabilities without jumping into other licensing constructs. But wait, there´s more.

Solution 3:
Take a look at the announced improvements on the Approvals application inside Microsoft Teams. You can read about it here and with the new attachment capabilities upcoming, there could be an even more attractive way for your users to initiate approval flows for uploaded documents.

Until then, …