I know that Office385Users.SearchUser() returns a string, but how do I check if a User exists in the org using SearchUser? When I did IsBlank(Office385Users.SearchUser({searchTerm: text.Text}), it is supposed to return "true" if the user doesn't exist. But instead, it returned false even when the user I put in doesn't exist. Is there an alternative way to check if a user still exists in an org?
Thank you!
Solved! Go to Solution.
hi @Anonymous ,
try this:
IsBlank(LookUp(Office365Users.SearchUserV2().value, Mail = textInput.Text).Mail)
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
hi @Anonymous ,
try this:
IsBlank(LookUp(Office365Users.SearchUserV2().value, Mail = textInput.Text).Mail)
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
IsBlank(LookUp(Office365Users.SearchUserV2().value, Mail = textInput.Text).Mail)
The solution shown above does not work for a scenario where there are more than 1000 users in the tenancy. Because SearchUserV2 function returns top 1000 users. So if the user you are looking for is not within first 1000 users then the code snippet will always return TRUE. I have used following instead:
IsEmpty(Office365Users.SearchUserV2({searchTerm:textInput.Text}))
You can use SearchUser function as well. Works for me.
Note: checking IsEmpty because SearchUser/SearchUserV2 function returns collection of User objects.
Thank you! I used IsEmpty as in your suggestion and get a nice true or false which I then use in other formulas.
User | Count |
---|---|
255 | |
106 | |
85 | |
51 | |
43 |