web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / 'UserPhotoMetadata' ha...
Power Apps
Unanswered

'UserPhotoMetadata' has an invalid value for parameter 'userid'

(0) ShareShare
ReportReport
Posted on by 318

Hi, 

 

I am using the onboarding template, i get this error when someone new opens the app. 

VikasNagaraj_0-1649859236653.png

I understand because they do not have a profile picture. I have used IsBlank in the formula even then this error pops up, please help thank you.

VikasNagaraj_2-1649859359222.png

 

Here is the formula.

ClearCollect(UserPhotoCache,
{
UserId:MyUserId,
Photo:If(!IsBlank(MyUserId),If(Office365Users.UserPhotoMetadata(MyUserId).HasPhoto,Office365Users.UserPhoto(MyUserId),'default-profile')),
Time:Now()
});

Categories:
I have the same question (0)
  • zmorek Profile Picture
    3,272 on at

    Can you try:

     

    Photo: Coalesce(Office365Users.UserPhoto(MyUserId),'default-profile')

     

    Else, you might need to turn on Formula Level Error Management in the app settings and try something like:

     

    IfError(Office365Users.UserPhoto(MyUserId),'default-profile')

  • VikasNagaraj Profile Picture
    318 on at

    @zmorek 

    Thanks for the reply, I turned on the formula lever error management and used 

    IfError(Office365Users.UserPhoto(MyUserId),'default-profile'), this solved the userphotometadate error. but i have a new error now, i assume this is because the user is new and no manager is assigned to the profile.

     

    VikasNagaraj_0-1649862050305.png

    Any help regarding this please? 

  • zmorek Profile Picture
    3,272 on at

    I would assume that can be fixed in a similar fashion with IfError(); where are you trying to reference the user's manager?

  • VikasNagaraj Profile Picture
    318 on at

    @zmorek 

    This is the formula, i am not sure where i should use IfError.

     

    Set(ManagerProfile,Office365Users.Manager(MyUserId));

    ClearCollect(
    MyManagerList,
    {
    DisplayName:ManagerProfile.DisplayName,
    City:ManagerProfile.City,
    JobTitle:ManagerProfile.JobTitle,
    UserPrincipalName:ManagerProfile.UserPrincipalName,
    GivenName:ManagerProfile.GivenName,
    Mail:ManagerProfile.Mail,
    Id:ManagerProfile.Id,
    Mobile:ManagerProfile.mobilePhone,
    OfficePhone:ManagerProfile.TelephoneNumber,
    Department:ManagerProfile.Department,
    OfficeLocation:ManagerProfile.OfficeLocation,
    Photo:If(
    Not(
    ManagerProfile.Id in UserPhotoCache.UserId
    ),
    Collect(
    UserPhotoCache,
    {
    UserId:ManagerProfile.Id,
    Photo:If(
    Office365Users.UserPhotoMetadata(ManagerProfile.Id).HasPhoto,Office365Users.UserPhoto(ManagerProfile.Id),'default-profile'),
    Time:Now()
    }
    );
    LookUp(UserPhotoCache,UserId = ManagerProfile.Id).Photo,
    LookUp(UserPhotoCache,UserId = ManagerProfile.Id).Photo
    )
    }
    );

  • zmorek Profile Picture
    3,272 on at

    There's a lot going on there and I'm not certain the collection is needed, nor am I certain IfError() might work, but I would try:

     

    Set(ManagerProfile,IfError(Office365Users.Manager(MyUserId),Blank()) );

     

    The problem is that even if that works, I believe you'll get errors when you try to collect the MyManagerList collection because you pass that value back into the UserPhotoMetaData connector...

  • VikasNagaraj Profile Picture
    318 on at

    @zmorek 

    I am sorry that i put everything here, i used Set(ManagerProfile,IfError(Office365Users.Manager(MyUserId),Blank()) );

    I got the error 'UserPhotoMetadata' has an invalid value for parameter 'userid' back again.

  • VikasNagaraj Profile Picture
    318 on at

    @zmorek 

    Still having issues, help please?

    @WarrenBelz @StalinPonnusamy @BCLS776 @CNT 

  • VikasNagaraj Profile Picture
    318 on at

    Hi.

    @zmorek @WarrenBelz @StalinPonnusamy @BCLS776 @CNT 

     

    I have tried the below code as well, i still get the error 'UserPhotoMetadata' has an invalid value for parameter 'userid' when logged in as a new user, could you please help me resolve it thank you.

     


    ClearCollect(UserPhotoCache,
    {
    UserId:MyUserId,
    Photo:If(!IsBlank(MyUserId),'default-profile',If(Office365Users.UserPhotoMetadata(MyUserId).HasPhoto = true,Office365Users.UserPhoto(MyUserId),'default-profile')),
    Time:Now()
    });

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard