In this Blog post I will show you how we can store BC’s image into OneDrive using with PowerAutomate.

First of all you should have access of using PowerAutomate and OneDrive for the same account you are going to use with Business Central, please ask your Admin to provide you required permission.

Read the document here.

Now that you have all the necessary access, let’s begin the process of achieving that.

To start, locate and click on the PowerAutomate button from the Business Central window, as shown in the image below.

  1. Now Click on the Create and Choose Instant cloud flow option as per below
  2. Click on Skip button
  3. Now I will choose an trigger, based on the business central, i.e. when an Item is modified in business central (This action is demo purpose only, you can choose any other action based on your requirement)
  4. As you can see below Action I have chosen the Item table based on my environment, you can fill those fields as per your environment values, so that we use the Picture field to get the content of that field.
  5. After this trigger fire we can choose another step to perform the new action based on this record modification trigger, Here I am going to choose Get the Image action if record is modified in BC in first trigger.
  6. In the above step you can see the I have chosen the Path as the Picture field of the Item table we already have in BC and provided the “Row ID” from the above trigger when the record is modified, it means that in this step flow will find that item only which is modified with the first trigger.
  7. In the next step we will choose the compose action where we will compose the content of the “Get an Image..”‘s action in to readable format.
  8. Now we will read the composed action and try to save in our Onedrive folder path with “Create File” of Onedrive action, I am using in root path to store the file with name of “sample.png”, you can choose any path of your onedrive folder and give it any name.
  9. In the above step you can see that “File Content” field has “OutPuts”, it means the “Base64ToBinay” method we had used has already composed and ready to store with the Output functions inherited by Compose Steps

See the complete Flow below

Now to test this flow, I will manually test it for doing this I will save this entire flow and Click on Test button as per below

After putting it to Testing mode I will jump to BC environment (Same environment which have defined in Flow) and Modify any record by adding any picture to it.

Now see the result when I tested it successfully

See the image file name with “Sample.png” already stored in OneDrive path, which we had selected in “Create file” action step

Click on this file name and check if you have the same file as you had in your BC’s Item record

 

Thanks for visiting my blog.

 

Let me know if there is any question.

Happy to Help.