Create a flow in Power Automate to update multiple customer pictures in Business Central from OneDrive

Dynamics 365 Business Central

Hi, Readers.
Last week I shared a Business Central short video, Create a flow in Power Automate to update current customer picture in Business Central from OneDrive.

Create a flow in Power Automate to update current customer picture in Business Central from OneDrive

More details: Business Central 2022 wave 2 (BC21): Power Apps and Power Automate support for media/image & document attachments

Then I got a question if it is possible to update picture for multiple customers from OneDrive? Yes, of cource. So today I would like to briefly discuss it.
PS: In Dynamics 365 Business Central: Import Multiple Customer Pictures (Customization), We have discussed importing multiple customer pictures from zip files.

Business Central short video: Import Multiple Customer Pictures (Customization)

This time we also used the same way, put the customer pictures that need to be uploaded in OneDrive, and named the file with the customer code.

For example,

Let’s start.
Because we need to perform this action in Business Central this time, choose Power Automate -> Create action based on a flow on the Customer list page.

Then choose Create from blank. (Because there is no template for this requirement)

The page will jump to the Power Automate design page. And For a selected record (V3) trigger will be added automatically.
More details: “For a selected record (V3)” trigger in Power Automate

First, give the flow a name.
For example, Update multiple customer pictures (This will be displayed in the action bar)

Click New step. Search for OneDrive for Business, and click on it.

Select List files in folder action (Because there are multiple files)

Select the folder where the pictures are saved.

Click New step. Search for OneDrive for Business, and click on it. Select Get file content action

Set the file Id of the “List files in folder” step in File.

PS: Since there may be multiple files, Apply to each action will be automatically added.

Click Add an action. Search for Business Central, and click on it.

This time we use a new action that just released, Find one record (V3) action. More details: Business Central 2024 wave 1 (BC24): Find a matching record in a Power Automate flow (“Find one record” action)

Select the BC environment info and standard customers API.

Click Show advanced options

Set in Filter 1, number (Filter in API) equals (Filter operator) Name without extension (value from “List files in folder” step)

Last step, click Add an action. Search for Business Central, and click on it.

Select Update an image, file or document (V3) action

Select the BC environment info and then click file icon (Show Picker) in Path.

Choose customers -> picture -> pictureContent

Set Id for ‘customers’ to the Id in Find on record (V3) step.

Set Content to the File content in Get file content step.

That’s all. Let’s test it briefly.

Your flow ran successfully.

Great.

Test video:

Youtube:

Create a flow in Power Automate to update multiple customer pictures in BC from OneDrive

Very simple. Give it a try!!!😁

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL