Convert Base64 to URL & Consume in PowerApps

To Convert a Base64 string to PDF or any other image file >> there is no direct way to convert in PowerApps.

High level resolution steps

  • We convert the Base64 to Binary first
  • Create & Stage the file in Azure Blob in our case. (You can use OneDrive to stage the file as well)
  • Use DataUri to convert Binary into a uniform resource identifier (URI) version of that string.

Detailed resolution steps

Step 1: Use a manual trigger flow and pass the bas64 string.
Step 2: Add a compose action and use the formula as shown in the below picture:

Power Automate flow showing Base64 string conversion to binary for PowerApps.

Step 3: Stage the file in Azure Blob Container that will be created in Azure Portal and provide the blob name with proper extension and for blob content provide the outputs from compose action as shown below:

Azure Blob storage interface showing file staging for Base64 content.

Step 4: Now we must Initialize one variable and, in the value – provide the blob container URL(available from Azure Portal) and followed by the path that will be coming in from Previous Action as shown below:

Power Automate variable initialization with Azure Blob container URL

Step 5: Add another compose action and convert a string into a uniform resource identifier (URI) version of that string in the specified format below:

Power Automate output showing the converted URL ready for consumption in PowerApps.

Output:

Get the Output or respond back to PowerApps as shown below:

Browser preview displaying a PDF file generated from a Base64 URL.

The URL will be exposed out of the Base64 that you provided.
If we try opening the URL in a browser, a PDF file will be displayed to you.