cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OfficeKundigDEV
Frequent Visitor

Office365users.userprofile failed due to incorrect userid

I have created an APP containing two fields to select an Microsoft 365 account.

However in the test environment (different tenant) I was able to select one of all existing accounts available.

In the production environment of my client (more than 3000 accounts) I only see a view and selecting one of these the APP does not process . When using a manual input like jsleeboom@officekundigdev.onmicrosoft.com it is working fine.

In the PowerApp we already set the option to select maximum available fields but it didn't change anything.

Please help me out and explain what is going wrong on this production tenant.

 

Kind regards,

Jan

Netherlands

13 REPLIES 13
BCBuizer
Super User
Super User

Hi Jan,

 

Can you please share the code that isn't working and any error messages you are getting? Are the two fields you mention peoplepickers? If so, what are their items properties?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

It is a PeoplePicker field

The update looks like:
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(ComboBox6.Selected.Mail),
DisplayName: ComboBox6.Selected.DisplayName
}

The Items field:
Office365Users.SearchUser()

Dropdown field itself
The DefaultSelectedItems:
if(IsBlank(ThisItem.'QHSE Manager'.Email),Office365Users.UserProfile("A***.W***@T***nc.com"),Office365Users.UserProfile(ThisItem.'QHSE Manager'.Email))

This Item field looks like:
Office365Users.SearchUser()

Please can someone send me the solution for this issue!?

kind regards,

Jan

Hi @OfficeKundig ,

 

I have done a test with a ComboBox which is working for me, so please try this.

 

Set the Items property for:

Office365Users.SearchUser({searchTerm:Self.SearchText})

 

Then set the Layout to 'Person' and check the Primary Text, Secondary Text and SearchField properties:

 

BCBuizer_0-1650381564204.png

 

This is in an environment with well over 3K users, so the dropdown itself will not show all users, but rather a suggestion. The more characters you add to the SearchText, the better your results will be.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
OfficeKundig
Helper II
Helper II

I have changed the Items property to

Office365Users.SearchUser({searchTerm:Self.SearchText})  But there is no option for {secondary text}

However the search users issue has been solved but I still receive this error message.

 

kind regards,

Jan

 

BCBuizer
Super User
Super User

Hi @OfficeKundig ,

 

Can you please share the error message and what you receive it against?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
BCBuizer
Super User
Super User

Hi @OfficeKundig ,

 

Hope you managed to find a solution for your issue. If so, can you please share so and mark the solution for the benefit of other users?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Hi,

sorry for the late reaction. But this error message is equal to the header of this:

When starting the powerapp {Office365users.userprofile failed due to incorrect userid} pops-up

kind regards, Jan

BCBuizer
Super User
Super User

Hi @OfficeKundig ,

 

Perhaps it's worth a try to create a similar solution to this:

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/the-service-returned-an-error-Office365Users...

 

If(!IsBlank(Self.SearchText),Office365Users.SearchUser({searchTerm:Self.SearchText}))


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,725)