A Microsoft file hosting and synchronization service.
Hi,
Thanks for reaching out to Microsoft Community! My name is Vicky and I’m happy to assist. I’m understand that you're trying to build a Power Automate flow that triggers when a file is shared with you in OneDrive for Business either via a shareable link or direct sharing.
Here's a comprehensive breakdown of what’s currently possible and recommended based on both Microsoft documentation and community insights:
As of now, Power Automate does not offer a built-in trigger for the specific event “file shared with me” in OneDrive for Business. This limitation means you cannot directly detect when someone uses the “Share” option to give you access to a file. And I’m so sorry about that.
So, I give some alternative recommendation bellow, and I really hope can help you some ways:
- Scheduled Flow Using Microsoft Graph API
I can see you mentioned the sharedWithMe endpoint in Microsoft Graph. This is a viable workaround:
- Create a scheduled flow that periodically calls the sharedWithMe endpoint.
- Compare the results with previous runs to detect new shared files.
- Trigger actions like copying the file or sending notifications.
This method is reliable but requires:
- Custom HTTP requests in Power Automate.
- Storing and comparing previous results (e.g., in a SharePoint list or Excel file).
- Webhooks via Microsoft Graph Change Notifications
Webhooks can be used to subscribe to changes in OneDrive, but:
- They do not support “shared with me” events directly.
- You can monitor changes in folders you own or have access to.
- This is more complex and requires Azure AD app registration and webhook management.
- Shared Folder Ownership
If collaboration is key, consider using SharePoint document libraries or shared folders in OneDrive:
- Files added to a shared folder you own can trigger flows using “When a file is created” or “When a file is modified” triggers.
- This method is seamless and supports notifications, copying, and other actions.
- Manual Trigger: “For a Selected File”
You can use the “For a selected file” trigger in OneDrive for Business. Anyway, this is a manual trigger, not automatic. It will be useful for ad-hoc actions like approvals or file processing.
I also try to research some expert Insights from the Community and here’s some information:
- SharePoint is preferred for collaborative scenarios. OneDrive is designed for personal use, and its sharing model doesn’t integrate well with Power Automate triggers.
- Shared folders in OneDrive can be monitored if you are the owner. If someone shares a folder with you, you cannot trigger flows on it unless it’s in SharePoint.
Once again, I truly appreciate your question and hope my research can be helpful to you in some way.
Best Regards,
Vicky-I - MSFT | Microsoft Community Support Specialist