How to Convert SharePoint Document Library Images to Base 64 Using Microsoft Flow/Power Automate

Introduction

 
In this article, we will talk about how we can easily convert SharePoint Document library Images to Base 64 and store the value of the Base 64 Images to SharePoint’s Multiline textbox. Sometimes, there are situations where we need to convert our Images to Base 64. At that time, this concept will be very useful to us. Microsoft flow provides the function to convert any image file to the Base 64. Now, let’s get started!
 
Step 1
 
Below is the list structure of the SharePoint document library where we have the following columns.
  • Title = Name of the Image file
  • Base 64 Image = Multiline Textbox to store the information of Base64 Image.
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 
Step 2
 
Create a new flow.
 
Add a Trigger – “When a file is created in a folder”.
 
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 
Step 3
 
Initialize Variable.
 
For Value, Go to the Expression and add the following formula.
  1. base64(triggerBody())  
Name = Name of the variable
Type = String
Value = base64(triggerBody())
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 
Step 4
 
Add an action Get files (properties only)
 
Add the following Filter Query.
  1. FileLeafRef eq '@{triggerOutputs()['headers']['x-ms-file-name-encoded']}'  
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 
Step 5
 
Add an action – “Update File Properties”.
 
Set the ID and Base64Image variable.
 
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 
Now, our flow has been created.
 
This will add the additional Apply to each step like in the following:
 
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 
The final flow will look like the below image:
 
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 
Now, its time to test the flow.
 
Add the Image to your document library.
 
Check the flow run.
 
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 
You can see here that the Base 64 for that image has been added successfully.
 
Convert SharePoint Document Library Images To Base 64 Using Microsoft Flow Or Power Automate
 

Conclusion

 
This is how we can easily convert SharePoint document library images to Base 64. I hope you love this article!
 
Stay connected for more amazing content!!


Similar Articles