Convert SharePoint Library Images to Base 64 with Microsoft Flow

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.

Columns

Step 2. Create a new flow.

Add a Trigger "When a file is created in a folder”.

 Trigger

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())

. Initialize Variable

Step 4. Add an action Get files (properties only).

Add the following Filter Query.

FileLeafRef eq '@{triggerOutputs()['headers']['x-ms-file-name-encoded']}'

Filter Query

Step 5. Add an action “Update File Properties”.

Set the ID and Base64Image variable.

Base64Image

Now, our flow has been created.

This will add the additional Apply to each step like in the following.

Value

The final flow will look like the below image.

Final Flow

Now, it's time to test the flow. Add the Image to your document library.

Check the flow run.

Document Library

You can see here that the Base 64 for that image has been added successfully.

Image

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