Mass upload employee pictures to D365 Finance and Supply Chain also D365 HR

Hello all,

This will be a quick blog post, decided to write about it since I couldn’t see any info in the web about this topic. In the human resources module inside D365 Finance and SCM there is a place to store your employees images. (the procedure is the same in D365 HR). Although Microsoft should probably have a sync with Azure AD to import the pictures if they are available there. (Maybe should post that as an idea in the community)

Anyways, let’s start. Most organizations keep employee pictures inside their Microsoft 365 tenant Azure AD (Formerly knows as Office 365) , so the first step is to download the files from there. For that step I set-up a Power Automate flow to achieve that process. (If you don’t use Microsoft 365 but have your pictures organized in a folder then you can skip these steps and go directly to the upload to D365 part of the blog)

  1. Power Automate

The flow below is pretty simple to create, I used a manual trigger since I will only use it once to download the pictures from Microsoft 365. There is a flow connector called “Get user photo” that’s really useful in this situation. It basically expects you to pass the User Principal Name and is basically the user’s email address (Most of the cases). I created an excel table which stores our user’s email  address along with their employee number and then saved it on One drive. I then use this Excel table to loop through the records in Microsoft 365 and export the users pictures and store them in a SharePoint site folder I created.

2020-05-21 08_37_22-

Inside the apply to each loop, on the create file in SharePoint connector for the file name I used the Concat function to name each picture with the Worker’s number which I stored in the Excel table along with the email address of the employees.

concat(items(‘Apply_to_each’)?[‘Personnel number’],’.JPEG’)
Note: Make sure to add the “.JPEG” file extension to the file names or the flow will fail since it won’t know the file type being created.

The file content is pretty simple, just use the dynamic content and pass the image file content from the get user photo connector. The reason why this is so easy its because both storage systems use binary format to store images, so there is no need to convert formats.

2020-05-21 08_55_47-Edit your flow _ Power Automate

Once you run your flow, the end result should be that your SharePoint folder should contain all the pictures. (I downloaded 245 pictures and it took seven minutes to complete the process)

2020-05-21 08_59_17-Testing Lists - EmployeePictures - All Documents

 

2. Uploading to D365 Finance and Supply Chain or D365 HR

The process of uploading to either version of the system is the same. Head over to the Data management workspace and export the contents of this entity “Person Image”, the trick is to download the data package instead of just the data file. To do this at the top click on “Download Package”

2020-05-21 09_04_31-Execution summary -- Human Resources

This will download a zip file with different file types in it. The first step is to unzip the file and export the contents into a folder. The pic below are the zip file contents.

2020-05-21 09_07_27-Downloads

The first thing you need to do is open the resources folder and then Person image sub-folder, and then copy the images from your storage folder and place them in this folder

2020-05-21 09_10_00-Person image

This is where having the pictures saved with the employee number will come in handy. On the Person Image excel file (#3 above) paste the “PartyID” of the employee records and then the file name that corresponds to their picture (You can use the Worker data entity to get the PartyID’s of the employees)

See below for file structure

2020-05-21 09_13_08-Person image - Excel

Once you have all the data sorted and stored in the Excel file the last step is to Zip the contents of the file again into a new zip file. (Grab the 4 files above and zip them into a folder)

Once you have the zip folder then head over to the data management workspace and proceed to upload using the same Person Image data entity. When asked for the source data type, select package and then use the zip folder you created above.

2020-05-21 09_17_02-Import -- Human Resources

The end result should be all employees should have their pictures in their worker profiles. How awesome is that!!!!

2020-05-21 09_19_33-People hub -- Human Resources

Until next time, stay safe folks

Juan Sebastian Grijalba, CPA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s