logo
search
Others

How to Fix Power Automate Invalid URI Errors in HTTP Actions

Maira MehtabMaira Mehtab Sep 22, 2026 868 views

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.
Before you start

Ensure you have the exact output of the extracted URL from your previous flow run history to accurately verify its formatting.

Solution 1Recommended

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.

1
Inspect the URL Output

Open your Power Automate flow run history and inspect the output of the specific step that extracts the URL.

2
Check for Invalid Characters

Look closely at the extracted string for HTML encoding, trailing characters, line breaks, or quotation marks that do not belong in a standard link.

3
Clean the URL String

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.

4
Test the URL

Verify that the cleaned URL starts with 'https://' and test it manually in a web browser to ensure it resolves successfully.

URL Encoding Tip: If your extracted URL legitimately contains spaces, ensure you use the encodeUriComponent() function in Power Automate.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the Software: Run the downloaded executable file and follow the simple on-screen instructions to complete the setup.
  3. 3. Manage Your Files: Launch WPS Office to easily open, edit, and save any documents you have downloaded via SharePoint or email.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formats.Lightweight architecture ensuring fast installation and smooth performance.Built-in PDF editing tools for streamlined document management.Familiar user interface providing a seamless transition and zero learning curve.
microsoft office alternative - wps office

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.