How to Create Direct OneDrive URLs for Files in a Folder
Question details
The user needs to build dynamic, direct OneDrive URLs for specific files located within a folder to use in automated applications like Power Apps or Power Automate.

- Product
- Microsoft OneDrive
- Device & OS
- not provided
- Scenario
- Constructing dynamic file links when file names update periodically for automated workflows.
- Observed behavior
- Opening a standard folder URL only redirects to the folder directory, failing to directly access the specific target file required by the application.
Ensure you have the exact file name, its correct file extension, and the complete folder directory path in OneDrive or SharePoint before attempting to build the direct URL.
Construct the Direct File URL Manually
Combine the fixed account path, library path, and the specific file name to properly create a direct file link that bypasses the folder view.
A direct file URL must include the complete OneDrive or SharePoint path, including the account path, the Documents library, every folder level, and the exact file name with its extension.
Get your SharePoint or OneDrive account URL (for example, https://domain-my.sharepoint.com/personal/user_domain_com/).
Append 'Documents/' followed by the specific folder levels where your file is stored.
Add the exact file name including its extension (e.g., updated_video.mp4) to the very end of the URL path.
Ensure any spaces or special characters in the folder or file names are URL-encoded (for example, replace spaces with %20).

Generate a Standard File Link via OneDrive Interface
If you do not need dynamic URL construction for APIs or Power Apps, you can easily get a direct link manually through the standard OneDrive web interface.
Try WPS Office for Seamless Cloud File Management
While building dynamic OneDrive URLs is specific to Microsoft's Power Automate ecosystem, everyday document management shouldn't be complicated. WPS Office is a free, lightweight suite that seamlessly integrates with cloud storage, allowing you to open, edit, and share files across all your devices easily.
- 1. Download and Install WPS Office: Visit the official WPS website to download and install the free WPS Office suite on your device.
- 2. Connect Cloud Storage: Open WPS Office, navigate to the Cloud section, and sign in to your preferred cloud drive (like OneDrive or Google Drive).
- 3. Manage Files Directly: Easily browse, open, edit, and share your cloud files directly within the familiar WPS interface.

Frequently Asked Questions
Why does my OneDrive URL open the folder instead of the file?
A folder URL lacks the specific file name and extension at the end of the path. To open a file directly, the URL must point to the exact file rather than just the directory it resides in.
How do I handle spaces in OneDrive file names when making a URL?
You must URL-encode spaces and special characters. Replace every space in the folder or file name with '%20' to ensure the URL resolves correctly across web browsers and applications.
Can I use dynamic OneDrive URLs in Power Automate?
Yes. You can construct the base path as a fixed string and use Power Automate dynamic content variables to populate the specific file name and extension at the end of the URL.




