How to Fix Power Automate Invalid URI Errors in HTTP Actions
Question details
The user needs to resolve an issue where Power Automate HTTP actions reject extracted download links as invalid URIs when attempting to save email attachments or files to SharePoint.
- Product
- Microsoft Power Automate
- Device & OS
- not provided
- Scenario
- Extracting a download link from an email or external source to save an attachment or file to SharePoint using an HTTP action.
- Observed behavior
- The HTTP action fails, rejecting the extracted download link and displaying an invalid URI error.
Ensure you have the exact output of the extracted URL from your previous flow run history to accurately verify its formatting.
Clean and Verify the Extracted Absolute HTTPS URL
Ensure the extracted download link is a fully formed, clean HTTPS URL without trailing spaces, line breaks, or hidden characters.
Power Automate's HTTP action requires a perfectly formatted absolute URI. If the extracted link contains HTML encoding, trailing whitespace, or hidden quotation marks, the action will fail.
Open your Power Automate flow run history and inspect the output of the specific step that extracts the URL.
Look closely at the extracted string for HTML encoding, trailing characters, line breaks, or quotation marks that do not belong in a standard link.
Add a 'Compose' action before the HTTP action to clean the URL using string expressions, such as trim(outputs('Your_Extracted_URL')) to remove whitespaces.
Verify that the cleaned URL starts with 'https://' and test it manually in a web browser to ensure it resolves successfully.
Configure the HTTP Action and SharePoint File Creation
Properly set up the HTTP action to download the file and correctly map the response body to the SharePoint action.
Consult the Microsoft Power Platform Community
If standard troubleshooting fails, the issue may be specific to a third-party connector or a complex authentication requirement.
Boost Your Document Productivity with WPS Office
While complex workflows like Power Automate require specialized configurations, managing your downloaded documents should be simple. WPS Office is a highly compatible, free, and lightweight Office suite that handles all your daily document needs seamlessly.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the Software: Run the downloaded executable file and follow the simple on-screen instructions to complete the setup.
- 3. Manage Your Files: Launch WPS Office to easily open, edit, and save any documents you have downloaded via SharePoint or email.

Frequently Asked Questions
Why does Power Automate say my URL is an invalid URI?
This error usually occurs when the extracted URL contains hidden characters, line breaks, HTML encoding, or is missing the absolute 'https://' prefix. Cleaning the string before passing it to the HTTP action resolves most invalid URI errors.
How do I remove hidden characters from a URL string in Power Automate?
You can use a Compose action with expressions like trim(outputs('Your_Step_Name')) to remove leading and trailing spaces, or use the replace() function to eliminate specific unwanted characters like quotation marks or line breaks.
Why does the SharePoint Create File action save a corrupted file after the HTTP action?
If the HTTP action completes but the saved file is corrupted, it often means the SharePoint 'File Content' is not mapped correctly. Ensure you are mapping the 'Body' output from the HTTP action, and verify that the original HTTP GET request downloaded the actual file rather than an HTML login page.
Can I use WPS Office to open files downloaded from SharePoint?
Yes, WPS Office is fully compatible with Microsoft Office formats like .docx, .xlsx, and .pptx. You can easily open, edit, and save any standard documents you download from your SharePoint libraries.




