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
Enable Auto-Recording in Teams Meetings via Power Automate and Microsoft Graph API
In one of my previous articles : Graph API: Teams Meeting Creation with ‘Lobby Bypass’ I explained how to configure lobbyBypassSettings using ...
Power Automate: max function
The “max” function is a powerful tool in Power Automate that helps you find the highest value in a set of numbers. Although it’s n...
Power Automate: Converting Strings to Integers
When working with data in Power Automate, you’ll often encounter strings that need to be converted to integers for calculations or compa...
Power Automate – Share desktop flow connections with service principal users
We are announcing the ability to share desktop flow connections with service principal users in Power Automate. This feature will reach genera...
Microsoft Power Automate – Use machine to credential mapping in desktop flow connections
We are announcing the ability to use machine to credential mapping in desktop flow connections in Power Automate. This feature will reach gene...
How to send an automated email in Dataverse using Power Automate?
This article outlines how to automate sending welcome emails to customers upon creating contact records in Dataverse using Power Automate. It ...
Introduction to Managing a WordPress blog using Power Automate – Part 1
My WordPress blog SharePains.com has been running on WordPress for a very long time now, and with so many posts it is a real challenge to make...