Handle Base64 and Binary File Content Types in Power Automate

Identification
🔗 Binary
🔗 Base64
{ "$content-type": "image/png", "$content": "iVBORw0KG...i/DhQmCC" }
Conversion
🔗 Create Note Attachment from SharePoint File
Get file content action will return the SharePoint file content in Binary but creating a Note attachment requires Base64 value. Using the ['$content'] property of the output with the following expression will populate with Base64 value to the Document column.outputs('Get_file_content')?['body']?['$content']
Upload File with Binary Data
To upload the Binary data (e.g. documentbody column value of the Note attachment) to SharePoint or File data type column, base64ToBinary function can be used.base64ToBinary(outputs('Get_a_Note_Attachment')?['body/documentbody'])
Populate Word Template Image
To construct the file content for the image placeholder in the Word template with the Binary data type, ['$content'] property can be used as in the following expression.outputs('Get_file_or_image_content')?['body/$content']
Compose action step is required to construct the input for the image content using the Base64 value and populate the output of the Compose step to the image placeholder. If the content JSON is directly populated, the step will fail with the following error.
Summary
Published on:
Learn moreRelated posts
Asynchronous flows and Concurrency Control in Power Automate
In this post I will look at Asynchronous flows vs Synchronous flows, Concurrency controls and multiple response actions in Power Automate flow...
2 Actions to run script in Excel from Power Automate flows
Within Power Automate, it has been possible to run scripts in Excel using the Run Script actions. Did you know that the is a Run Scripts from ...
Power Automate Cloud Flows in Power Pages
What are Cloud Flows in Power Pages? Cloud flows allow you to: You configure this using the Power Pages + Power Automate integration via the “...
When Do We Use the ActivityParty.AddressUsed Property for Emails in Power Automate (Dataverse)
When we automate emails in Dataverse using Power Automate, we deal with something called Activity Party. It manages the participants of an ema...
Find Power Automate flows referencing a specific field / column in Power Apps
In this blogpost, we will learn to identify all Power Automate flows that reference or interact with a specific column or field within a Power...
How to call Microsoft Graph API from Power Automate?
While Power Automate has many built-in connectors for these services, there are times when you need more control or access to features not ava...
Power Automate – Debug desktop flows using step over and step out
We are announcing the ability to debug desktop flows using step over and step out in Power Automate. This feature will reach general availabil...
Sending Adaptive Cards in Outlook via Power Automate (Test User Setup Guide)
In today’s fast-paced business world, real-time communication is essential. In this guide, I’ll show you how I built a fully automated employe...
Power Automate – Configure and manage SLA with work queues
We are announcing the ability to configure and manage SLA with work queues in Power Automate. This feature will reach general availability on ...