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.
Step 2. Create a new flow.
Add a Trigger "When a file is created in a folder”.
Step 3. Initialize Variable
For Value, Go to the Expression and add the following formula.
base64(triggerBody())
Name: Name of the variable
Type: String
Value: base64(triggerBody())
Step 4. Add an action Get files (properties only).
Add the following Filter Query.
FileLeafRef eq '@{triggerOutputs()['headers']['x-ms-file-name-encoded']}'
Step 5. Add an action “Update File Properties”.
Set the ID and Base64Image variable.
Now, our flow has been created.
This will add the additional Apply to each step like in the following.
The final flow will look like the below image.
Now, it's time to test the flow. Add the Image to your document library.
Check the flow run.
You can see here that the Base 64 for that image has been added successfully.
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!!