Tip #1378: Update Common Data Service user photo from Office 365 profile

I had things stolen from me, I gave things away on many occasions. But I never ever lost anything. What’s the secret? Time perception.

I do not lose things, I only temporarily misplace them

The Enabler

Consider this. Last year I created a folder for all the good tips coming in from the fellow tipsters, users, developers. (Your email can land in that folder too if you send it to jar@crmtipoftheday.com). Then I lost misplaced that folder. Then I found it again (SEE?). For the next few days I’m going to be bringing these tips to life. Today’s tip is from Michael Aarvik.

I wanted to get the user profile picture from Office 365 to Dynamics. Tried with Powershell and some commands, but only got I to work partly. Then I saw that flow had some functions that could solve this issue. Worked perfect!

Get the users

Check if user has a photo

Update user record in CDS (Field “Entity Image” with “Image file content” from Get User Photo (V2)

Cover photo Female Avatar by Tucia / CC BY