Hi,
I stored a value in my collection. And from that collection get a Mail..
I want to show user photo through from collection's mail..
i got a following issue
Am giving id in Userphotometadata.
But it shows error.. While am using mail also its getting error.
How to solve this UserPhotoMetadata error?
Thanks,
Dhinesh
Solved! Go to Solution.
Hi@Dhinesh28R,
Could you please tell me how you collect this collection, post your Collect formula which is the key.
ThisItem only works in a Gallery, do you put your collection into a Gallery?
To test, please try to add a Gallery and set the Items property as below:
YourCollectionName
Make your Gallery layout containing Image as follows:
Set the Image property as below:
If(
!IsBlank(ThisItem.Id),
If(
Office365Users.UserPhotoMetadata(ThisItem.Id).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.Id),
SampleImage
)
)
Please make sure that you refer to the Id directly as abpve.
Hope it helps.
Regards,
Qi
Hi@Dhinesh28R,
Glad to see you and hope we could solve this again.
Do you want to display the user photo?
Could you please tell that how you create the collection?
Office365Users.UserPhotoMetadata() expects the userid(Principal Name/ Email ID) of the user for which we want to search data for.
Please make sure that you are passing correct data inside office365 function.
From your formula, you could not just refer to the Id within the Office365Users.UserPhotoMetadata().
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
)
)
Note: If you want to display the certain user photo, you should find the related record firstly from your collection and refer to the userid(Principal Name/ Email ID).
Regards,
Qi
Hi @v-qiaqi-msft ,
Glad to see you again, Yes i want to display a user photo.
I created a collection with Name, id, phot and UserPrinicipalName.
Am passing into Office365Users.UserPhotoMetadata(Id/Mail). its getting error only.
And also am using this Office365Users.UserPhotoMetadata(Id/Mail). within a collection.. not a gallery
Now also its getting error.
Thanks,
Dhinesh
Hi@Dhinesh28R,
I just provide a sample for reference.
I mentioned that you should not refer to the Id/Mail in the Office365Users.UserPhotoMetadata() directly. You should find the Id using a formula to determine which user you want to display the user photo.
Who's Id you want to find is the key to this issue.
If there are many users in your collection and you just want to display one of them, find this user from your collection.
Office365Users.UserPhoto(LookUp(Col1,DisplayName="Qi Qiao").Id)
Regards,
Qi
HI @v-qiaqi-msft ,
I just gave only one user (ThisItem.UserPrincipalName) within metada. It shows error "No resource Found".
Thanks,
Dhinesh.
Hi@Dhinesh28R,
Could you please tell me how you collect this collection, post your Collect formula which is the key.
ThisItem only works in a Gallery, do you put your collection into a Gallery?
To test, please try to add a Gallery and set the Items property as below:
YourCollectionName
Make your Gallery layout containing Image as follows:
Set the Image property as below:
If(
!IsBlank(ThisItem.Id),
If(
Office365Users.UserPhotoMetadata(ThisItem.Id).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.Id),
SampleImage
)
)
Please make sure that you refer to the Id directly as abpve.
Hope it helps.
Regards,
Qi
HI @v-qiaqi-msft ,
This works fine man, But shows error on Metadata "Resource not Found" something "User not found".
Name | Id | Photo | ||
Dhinesh | Dhinesh@sample.com | 13214 | Dhinesh@sample.com | |
Suresh | Suresh@sample.com | 45321 | Suresh@sample.com |
This s my collection looks like.
AM using this collection into a gallery ,
Am using this formula into a image property of gallery,
If(
!IsBlank(ThisItem.Id),
If(
Office365Users.UserPhotoMetadata(ThisItem.Id).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.Id),
Image
)
)
But its shows error in metadata. But it displays image in a gallery. Appears error.
Thanks,
Dhinesh
Hi@Hi@Dhinesh28R,
I have reproduce the issue you mentioned and the situation is confirmed on my side.
The reason why you met this is probably that there are some guest users who are not in your tenant.
The Office365Users.UserPhotoV2() could only search for the users who are the owner of the group rather than the guests.
Please make sure that all the users are internal users.
Hope it could help.
Regards,
Qi
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
208 | |
98 | |
60 | |
51 | |
42 |
User | Count |
---|---|
259 | |
160 | |
85 | |
79 | |
57 |