cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tapesh
Post Prodigy
Post Prodigy

How to Validate user image if no image displayed in gallery show other image ?

Hi All

 

I m trying validate the filed Image in Gallery, which I did figure out how to do it in certain ways, but it shows and error while running the app saying invalid userid  I do not know whats the error actually for as the Id which I have passed is the email ID only and still showing the error as follows:

Tapesh_0-1615210290568.png

Any leads on this error experts/. 


Please see that I used the formula something like this in Gallery Image. 
ON image: 

 

 

 

 If(Office365Users.UserPhotoMetadata(ThisItem.'Created By'.Email).HasPhoto ,  ThisItem.'Created By'.Picture , 'collaboration-female-male' )

 

 

 

Please note  I also tried below formula as suggested in one of the article and solutions on PowerApps Community but did not seems to be working fine for me. 

 

 

 

If(!IsBlank(ThisItem.'Created By'.Email), If(Office365Users.UserPhotoMetadata(ThisItem.'Created By'.Email).HasPhoto ,  ThisItem.'Created By'.Picture , 'collaboration-female-male' ))

 

 

 

 

AND 

 

 

 

If(!IsBlank(Text(ThisItem.'Created By'.Email)), If(Office365Users.UserPhotoMetadata(Text(ThisItem.'Created By'.Email)).HasPhoto ,  ThisItem.'Created By'.Picture , 'collaboration-female-male' ))

 

 

 

BUT NO LUCK 

 

Thank you for helping on, much appreciated your time and efforts 

Thanks a million.

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @Tapesh ,

I have done a test on my side using three formulas you provided and they all work well:

v-albai-msft_0-1615442471352.png

v-albai-msft_1-1615442471354.png

v-albai-msft_2-1615442471357.png

Not sure if below formula can work but you can have a try:

If(
    !IsBlank(ThisItem.'Created By'.Email),
    If(
        Office365Users.UserPhotoMetadata(ThisItem.'Created By'.Email).HasPhoto = true,
        Office365Users.UserPhotoV2(ThisItem.'Created By'.Email),
        'collaboration-female-male'
    )
)

Besides, if above still cannot work, since everything works fine on my side, I would suggest you submit a Microsoft Support Ticket at:  https://admin.powerplatform.microsoft.com/support. (maybe this is related to the Office365Users.UserPhotoMetadata connector itself)

Best Regards,

Allen

View solution in original post

2 REPLIES 2
v-albai-msft
Community Support
Community Support

Hi @Tapesh ,

I have done a test on my side using three formulas you provided and they all work well:

v-albai-msft_0-1615442471352.png

v-albai-msft_1-1615442471354.png

v-albai-msft_2-1615442471357.png

Not sure if below formula can work but you can have a try:

If(
    !IsBlank(ThisItem.'Created By'.Email),
    If(
        Office365Users.UserPhotoMetadata(ThisItem.'Created By'.Email).HasPhoto = true,
        Office365Users.UserPhotoV2(ThisItem.'Created By'.Email),
        'collaboration-female-male'
    )
)

Besides, if above still cannot work, since everything works fine on my side, I would suggest you submit a Microsoft Support Ticket at:  https://admin.powerplatform.microsoft.com/support. (maybe this is related to the Office365Users.UserPhotoMetadata connector itself)

Best Regards,

Allen

View solution in original post

Tapesh
Post Prodigy
Post Prodigy

Thanks a million for the solution @v-albai-msft  sir, it did work fine and not showing any error as of now. 

Thanks Again 🙂 for sharing the knowledge

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,305)