cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fmourtaza
Helper II
Helper II

Update user profilephoto from CDS to AD - using Graph Api

Hello Folks,

 

The aim is to update a user profile photo stored in CDS (PowerApps) to the Active Directory using Graph API - and for that I am using Flow.

 

1. To get the image from CDS - I am using the [Get file or image content] action - in the output we are getting the image content.

 

fmourtaza_0-1603176151990.png

 

2. thereafter converting the content into base64 for further processing with Graph Api. The processing of the Compose action is successful, however when we see the output, the end of the string is not properly closed/formatted.  

 

fmourtaza_1-1603176313409.png

 

fmourtaza_2-1603176403628.png

 

3. The next step would be to update the AD using Graph Api hence using the HTTP action - but its failing with a HTTP Failed error - I feel its because of the length of the content.

fmourtaza_4-1603176773925.png

 

fmourtaza_3-1603176734454.png

 

Any clue how can I overcome this ? or another approach to update the user profile photo to the AD ?

 

Regards.

1 ACCEPTED SOLUTION

Accepted Solutions
fmourtaza
Helper II
Helper II

The solution was given in one of the previous post - thanks to @EricRegnier 

 

A simple method to update the images is via Power Automate with the O365 connector. Here's a template:https://emea.flow.microsoft.com/en-us/galleries/public/templates/514fe3a191cd47d5ac0ab273cbf0a773/up...

 

This works nicely.

 

fmourtaza_0-1603179146291.png

 

View solution in original post

5 REPLIES 5
fmourtaza
Helper II
Helper II

The solution was given in one of the previous post - thanks to @EricRegnier 

 

A simple method to update the images is via Power Automate with the O365 connector. Here's a template:https://emea.flow.microsoft.com/en-us/galleries/public/templates/514fe3a191cd47d5ac0ab273cbf0a773/up...

 

This works nicely.

 

fmourtaza_0-1603179146291.png

 

Hi fmourtaza ,

 

Thanks for sharing the solution.

 

Regards,

JAvier

Hi @FCGALLEG 

 

Thanks for your comments, however it didn't work for other users - it seems this action works only for the user owning the flow - any idea on how to impersonate the flow or its action ? 

 

 

Hi fmourtaza,

 

Do you have any error?

Could you share it with us?

 

Thanks

Javier

 

Hi @FCGALLEG 

 

The error is a generic one Action 'HTTP' Failed

 

The screenshot is shared on the initial post or you can click the below link

 

https://powerusers.microsoft.com/t5/Using-Flows/Update-user-profilephoto-from-CDS-to-AD-using-Graph-...

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,068)