cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Combobox & Gallery

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

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

View solution in original post

3 REPLIES 3
Helper II
Helper II

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

Community Support
Community Support

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

View solution in original post

Anonymous
Not applicable

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!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (44,569)