How to Create a OneDrive Sharing Link with Power Automate
Question details
The user needs to automatically generate a sharing URL for a PDF file stored in a known OneDrive folder using a Power Automate flow.

- Product
- Power Automate
- Device & OS
- not provided
- Scenario
- Automating document distribution by generating a shareable OneDrive link for a newly created or uploaded PDF file.
- Observed behavior
- Requires configuring a Power Automate flow that accurately retrieves the file and outputs a valid OneDrive sharing URL.
Ensure you have an active Microsoft Power Automate license and the appropriate permissions to read and share files within the target OneDrive folder.
Use the Create Share Link Action in Power Automate
Utilize the built-in OneDrive for Business connector to automatically generate a sharing link for a specific file or PDF.
Power Automate provides a dedicated action within the OneDrive for Business connector that allows you to create sharing links programmatically. You can configure the link's access level and use the resulting URL in subsequent steps, such as sending an email.
Log in to Power Automate and either create a new automated flow or open an existing flow where you need the file link generated.
Click 'New Step', search for 'OneDrive for Business', and select the 'Create share link' action from the list of available options.
In the 'File' field, click the folder icon to navigate to your specific PDF in OneDrive, or use Dynamic Content to map the File ID if the file was created in a previous step.
Choose the Link Type (e.g., 'View' or 'Edit') and select the Link Scope (e.g., 'Anyone with the link' or 'Organization only') based on your sharing requirements.
Save the flow. You can now insert the 'Web URL' dynamic content generated by this step into subsequent actions, such as appending it to an email notification or saving it to a database.

Need a simpler way to manage and share documents? Try WPS Office
If you are looking for a cost-effective, lightweight suite to create, edit, and share documents or PDFs without setting up complex automation flows, WPS Office provides an all-in-one solution. It integrates seamlessly with major cloud drives for easy sharing.
- 1. Download WPS Office: Visit the official WPS website and download the free installer for your device.
- 2. Install and Sign In: Run the installer, complete the setup, and sign in to access cloud storage features.
- 3. Share Documents Easily: Open any document or PDF and click the 'Share' button to instantly generate a secure sharing link.

Frequently Asked Questions
Can I generate a OneDrive sharing link for a folder instead of a file?
Yes, the 'Create share link' action in Power Automate can also be used for folders. You just need to provide the Folder ID or the folder path instead of the File ID.
Why is my Power Automate flow failing to create the OneDrive link?
This usually happens due to permission issues or providing an incorrect File ID. Ensure the account running the flow has sharing permissions for the specific OneDrive file, and check that the File ID is dynamically mapped correctly from previous steps.
Can I set an expiration date for the OneDrive sharing link in Power Automate?
Yes, when configuring the 'Create share link' action, you can expand the advanced options to set an expiration date and time for the generated link.
Does this method work with SharePoint documents?
Yes, but you will need to use the SharePoint connector's 'Create sharing link for a file or folder' action instead of the OneDrive for Business connector to generate links for SharePoint files.




