cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
k1ng
Helper I
Helper I

Issues with "Get user photo (V2)" in O365

Hey All,

 

I am trying to build a small global address book in a flow for my bot.  Everything is going smoothly expect the photo, I can't seem to grab it from my flow, it's completing however without any photos..  Anyone is using that or anything else for grabbing photos?

TopicTopic

 

FlowFlow

 

Logs (it is completing but no length on the image?)Logs (it is completing but no length on the image?)  

 

Trying to make a card, you know?
No image :(No image 😞

 

Thank you for your help!!

-n

3 REPLIES 3
Expiscornovus
Super User
Super User

Hi @k1ng,

 

Can you try this expression for your Get User Photo (V2) action. This is using an index value of [0] to get the first item.

 

outputs('Search_for_users_(V2)')?['body/value']?[0]?['UserPrincipalName']

 

If you still prefer the first function you could also use this expression

first(outputs('Search_for_users_(V2)')?['body/value'])?['UserPrincipalName']

Both of expressions got the same results, @Expiscornovus:6.PNG

 

Least it got something on the length however now I am getting an authorization error, do I need to add a permission on scope for that?

Also this is the right way to grab it from the flow?
7.png

 

Or any other way to get an user's photos?

-n

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,169)