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 Apps
Answered

Combobox & Gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have following comboBox for selecting a single office365 user which works:

 

Filter(Office365Users.SearchUser({searchTerm:Cobo_FindNewUser.SearchText, top:10}).Mail,IsBlankOrError(Mail)=false)

 

Based on this ComboBox I set up a Gallery which partially works;

Office365Users.UserProfile(Combo_FindNewUser.Selected.Mail)

 

error message: Office365User.Userprofile failed. 'UserProfile' has an invalid value parameter for 'userid'

 

Tried to start app with ComboBox with DefaultSelectedItem, a lot of workarounds to get rid of the error...but nothing works so far. 

 

Need help to get rid of the error. Thanks!

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey mate,

     

    The function Office365Users.UserProfile() takes an ID. This means that passing it the Mail property will not work.

    An ID looks like this: 4120c940-255b-4547-bedc-6e308ee0030e.

     

    To fix your function, change it to this: Office365Users.UserProfile(Combo_FindNewUser.Selected.ID).

     

    I confirmed on my end that I can use my ID to find the user. In your gallery you will now be able to select the parameters of the user (Name, Country etc). and add them into your gallery.


    Regards,

    Jacob Shand | Automation Specialist

    NextStep Creations


    Taking your PowerApps Skill the NextStep

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    HI @Anonymous :

    I made a same test and encountered the problem that you described.

    Let me explain why this happened.

    The point is the required parameter can not be blank value.

    The UserProfileV2 function Retrieves the profile of a specific user by the parameter id that meet the following rules.

     

    1.PNG

     

    If you havent chose any options,  Combo_FindNewUser.Selected.Mail is blank.

    But it does not affect the normal use of the app, I think you can ignore this error or use the default value as you said.

    I used the following code to eliminate the error:

     

     

    Office365Users.UserProfileV2(If(IsBlank(Cobo_FindNewUser.Selected.Mail),"ccc@ccc.com",Cobo_FindNewUser.Selected.Mail)) /* ccc@ccc.com is your default email address*/

     

     

    Since you use the Office365 Users connector, I think this link will help you a lot:

    Office 365 Users:

    https://docs.microsoft.com/en-us/connectors/office365users/#get-user-profile-(v2)

     

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Greate @v-bofeng-msft works! thanks for the link!

    To your point app was functional, however, I hate errors when applications starts. Now it starts with no errors.

     

    Thanks again!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard