I'm building an app for my team's use and need a way to display their images. How would I do this?
Solved! Go to Solution.
Hi@hari3,
Based on the issue that you mentioned, do you want to display users's images?
Could you please share a bit more about the scenario?
Office365Users.UserPhotoMetadata() expects the userid(Principal Name/ Email ID) of the user for which we want to search data for.
In my scenario, I have a SP list containing a Person column named 'Senior' storing the team users.
Add a Gallery and set the Image property as below:
If(
!IsBlank(ThisItem.Senior.Email),
If(
Office365Users.UserPhotoMetadata(ThisItem.Senior.Email).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.Senior.Email),
SampleImage
)
)
Hope it could help.
Regards,
Qi
@Anonymous add the Office365Users connector to your app and then use the following expression:
If(
!IsBlank(gblUserID),
Office365Users.UserPhotoV2(gblUserID),
SampleImage
)
Where gblUserID is a variable that has the user name of the user for whom you want to display a photo.
For example, if you have a gallery of users, the expression would change to:
If(
!IsBlank(ThisItem.'User Name'),
Office365Users.UserPhotoV2(ThisItem.'User Name'),
SampleImage
)
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
Hi, I put the full name of the user in place of gblUserID but it still won't display their picture?
Hi@hari3,
Based on the issue that you mentioned, do you want to display users's images?
Could you please share a bit more about the scenario?
Office365Users.UserPhotoMetadata() expects the userid(Principal Name/ Email ID) of the user for which we want to search data for.
In my scenario, I have a SP list containing a Person column named 'Senior' storing the team users.
Add a Gallery and set the Image property as below:
If(
!IsBlank(ThisItem.Senior.Email),
If(
Office365Users.UserPhotoMetadata(ThisItem.Senior.Email).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.Senior.Email),
SampleImage
)
)
Hope it could help.
Regards,
Qi
User | Count |
---|---|
258 | |
111 | |
95 | |
48 | |
41 |