Official Site
Microsoft Most Valuable Professional M365 Apps & Services
Microsoft Most Valuable Professional Business Applications
Consultant & Sr Cloud Solution Architect Modern Wokrplace
Find hereMore than 150 Articles about Microsoft Technologies on Modern Workplace
19 November 2024
In today's article, I will show you how to Get notified of new OneDrive files using Power Automate.
First, we need to have an active M365 subscription and from the home page, we select Power Automate from the apps. On the Power Automate home page, we select Templates from the left menu.
We locate the available template named "Get notified of new OneDrive files."
In the next screen, we will allow all necessary connections and select continue.
In the next screen, we will select the folder in OneDrive where we want to be notified when a new file is uploaded, and whether we want to include subfolders.
On the automate page, we encounter the first trigger action of type "when a file is created," where we need to specify the folder in OneDrive that will notify us when a file is uploaded, whether it will include subfolders, and the number of files to return.
The next action is to assign a string variable named adaptivecardlinktoitem, which will create a link to the specific file in our adaptive card in Teams.
The next step is an action of type "create share link," where we set the file ID and the link type, e.g., view, as well as the scope that will have access to the link.
In the next step, we will set the variable with the JSON that will contain the button to redirect to the file.
The next action is of type "get profile v2," where the automate identifies the user.
In the final action of type "post adaptive card in a chat or channel," we have chat with flow bot in the initial selection, then the recipient, which is us, and the automate retrieves from the get my profile v2. Finally, in the adaptive card, we have the JSON creation of the card as well as a series of properties from other actions of the automate, such as display name of file or button with adaptive card link.
In the next step, we save the automate.
And of course, we select manually test flow.
Then we go to OneDrive, locate the specific folder, and upload a new file.
Our automate executes successfully.
And finally, as expected, it sent an adaptive card with the details we specified and a button that redirects to the file.
Visit Archives below to find more articles about Microsoft technologies on Modern Workplace