cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RealMABN
Helper II
Helper II

How to check if User exists through Office365Users with mail or initials? 1000+ users

Hi, 

I'm trying to create a function with Office365Users.SearchUserV2, where i get a true or false value when i type either initials or the mail of a user into a textinput.
So basically the function checks if a user with those initials exists or not.

I have tried using this function: IsBlank(LookUp(Office365Users.SearchUserV2().value, Mail = TextInput.Text).Mail)

But It cannot return more than 1000 users, which makes the function useless for my need. 

So if anybody knows how i get it to return more than 1000 users, than it would really help.

Thanks in advance! 🙂

1 ACCEPTED SOLUTION

Accepted Solutions

HI @RealMABN,

Emm, the solution I posted will return all the users in your group, and you could lookup the textinput text within.

IsBlank(LookUp(AllUsers, TextInput.Text in Mail).Mail)

If you want to search user based on the initial strings, I think you could only use the in operator, which causes the delegation issue and could not retrieve in a collection including more than 2000 records.

 

 

 

Best Regards,
Qi

View solution in original post

5 REPLIES 5
Silvester
Super User
Super User

Kindly go to your app setting and raise the limit from 2000. 
Click file (top left corner) > App settings > Advanced settings > set value for non-delegable queries

Hope this helps!

 

 

 

Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the thread and so other members of the community can find it easily.
v-qiaqi-msft
Community Support
Community Support

Hi @RealMABN,

Do you want to get more than 1000 users using the Office365Users.SearchUserV2() function?

 

Actually, Office365Users.SearchUserV2() could only return 999 users at max, which is a limit of Office365 connector. To set the row limit to 2000 is useless.

 

I did a sample for you.

1\ Add a button control and set its onselect property to:

Clear(Col);Set(varNextlink,Blank());Set(varNextlinkTemp,Blank());Set(varSkiptoken,"");With(Office365Users.SearchUserV2({searchTerm:""}),Collect(Col,ThisRecord.value);Set(varNextlink,ThisRecord.'@odata.nextLink');Set(varSkiptoken,Mid(varNextlink,Find("skipToken",varNextlink)+10)));Set(varNextlinkTemp,varNextlink)

2\ Add a toggle control and set its Default property to:

If(varNextlinkTemp=Blank(),true,varNextlinkTemp=varNextlink,false,true)

Set the toggle's OnCheck property to:

Set(varNextlinkTemp,varNextlink)

Set the toggle's OnUncheck property to:

If(varNextlink=Blank()&&varNextlinkTemp=Blank(),Blank(),With(Office365Users.SearchUserV2({searchTerm:"",skipToken:varSkiptoken}),Collect(Col,ThisRecord.value);Set(varSkiptoken,Mid(ThisRecord.'@odata.nextLink',Find("skipToken",ThisRecord.'@odata.nextLink')+10));Set(varNextlink,ThisRecord.'@odata.nextLink')))

Set the toggle's visible property to:

false
Best Regards,
Qi

Hi @v-qiaqi-msft,

Thank you for your answer, I think your code is on another level than me, so im a littel confused on how i should add the inputbox + Mail = TextInput.Text).Mail, so the searchTerm can see where i type the initials 🙂

Thanks again!
Mabn

HI @RealMABN,

Emm, the solution I posted will return all the users in your group, and you could lookup the textinput text within.

IsBlank(LookUp(AllUsers, TextInput.Text in Mail).Mail)

If you want to search user based on the initial strings, I think you could only use the in operator, which causes the delegation issue and could not retrieve in a collection including more than 2000 records.

 

 

 

Best Regards,
Qi

Hi @v-qiaqi-msft 

Ah i see 🙂

Thanks for your answer, it makes sense now. 🙂

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,962)