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)
- 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.
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.
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.
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)
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”
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.
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
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
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.
The end result should be all employees should have their pictures in their worker profiles. How awesome is that!!!!
Until next time, stay safe folks
Juan Sebastian Grijalba, CPA