How can I create a Power Automate flow to send a Teams notification when a new file is added to a OneDrive folder?

2025-11-20T20:37:06.08+00:00

Hello,

I want to set up a flow using Power Automate that sends a notification to a Microsoft Teams channel whenever a new file is added to a specific folder in OneDrive for Business.

Details:

• The folder is shared with multiple team members.

• I need the notification to include the file name and a link to the file.

What I’ve tried:

• Used the template “When a file is created in a folder” and added “Post a message in Teams,” but the message doesn’t include the file link.

Question:

How can I configure the flow so that the Teams message includes the file name and clickable link? Are there any dynamic content options I should use?

Microsoft 365 and Office | Development | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Gabriel-N 9,545 Reputation points Microsoft External Staff Moderator
    2025-11-21T03:30:16.74+00:00

    Hello أحمد صلاح عبدالرحيم عثمان

    Thank you for posting on the Q&A Forum.

    I’ve successfully created a flow following your description. Kindly apply the steps below to your workflow and let me know if they match.

    Step 1: Configure the Trigger

    Create an Automated cloud flow.

    Select the OneDrive for Business trigger: "When a file is created".

    Important: For the Folder field, please click the folder icon to browse and select the folder from the Root. Do not paste the URL directly, as this often causes connection errors.

    Step 2: Add an intermediate action

    Add a new action, search for OneDrive for Business, and select "Create share link for a file or folder".

    Configure it as follows:

    • File identifier: Select File identifier from the Dynamic Content list (from the "When a file is created" step).
    • Link type: View.
    • Link scope: Organization (so everyone in your company can access it) or Anonymous.

    Step 3: Add the Teams action

    Add the action "Post message in a chat or channel".

    In the Message field, please paste the following HTML code:<p class="editor-paragraph">Click here to view: <a href=Web URL>Name</a></p>

    Crucial Step:

    • Delete the text Web URL inside the code and replace it by selecting Web URL from your Dynamic Content (make sure to pick the one from the "Create share link" action).
    • Delete the text Name and replace it with File name from the Dynamic Content.

    User's image

    The result will look like the screenshot I attached.

    User's image

    Please give this a try and let me know if you encounter any issues along the way. Your feedback is valuable and will help us ensure everything works as expected.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.