cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MAM627646
Helper I
Helper I

Excluding Admin and test users from my search field

Hi guy,

I have a combobox search field that is set to person primary text displayname and secondary is mail . I used this code in the items field to pull the data""" Office365Users.SearchUser({searchTerm:DataCardValue5.SearchText})""", however , i noticed that that admin and test users are showing within the list . I tried the code to Filter(Office365Users.SearchUser({searchTerm:DataCardValue5.SearchText}), EndsWith(DisplayName, "- ADMIN"),DisplayName,Mail) but to no avail . 

 

I do apricate your help regarding this matter 

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Super User
Super User

Your filter as it is right now will only exclude items with " -ADMIN".     You might try

 

Filter(Office365Users.SearchUser({searchTerm:DataCardValue5.SearchText}), !("admin" in displayName))



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

17 REPLIES 17
JR-BejeweledOne
Super User
Super User

You want it to only display the ones that don't have the -ADMIN so, try changing your formula and wrap the EndsWith(DisplayName, "-ADMIN" in a NOT like this:

 

Filter(Office365Users.SearchUser({searchTerm:DataCardValue5.SearchText}), !(EndsWith(DisplayName, "- ADMIN")),DisplayName,Mail)

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Thank you for your prompt reply, much appreciated .  I amended the formula with the provided one and did not get any error but when i play the App and type on the filed nothing is happening . Here is a snapshot 

 

 

Sid_Jafri
Responsive Resident
Responsive Resident

Hi @MAM627646 

 

Please try this

 

Filter(Office365Users.SearchUser({searchTerm:DataCardValue5.SearchText}), !(EndsWith(Trim(DisplayName), "- ADMIN")),DisplayName,Mail)

 

Please Thumbs up and accept as solution if my post helped you solve your issue.

Thanks Sid . Once i apply the formula and play the app but am unable to type anything on the field . it looks like its blocked . Here is a snapshot 

JR-BejeweledOne
Super User
Super User

Can you go back into your items property and review it in the formula bar across the top, not the data card properties pane. 

 

Are there any red lines or other indications that all is not as it should be?  If you hover over them you may see a popup indicating where the problem is.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Once again , thanks a lot for your quick response. I cannot see any error or red lines on that. I attach a photo for easy reference . 

JR-BejeweledOne
Super User
Super User

I see that this is in a datacard.   Is this by chance a SharePoint person column?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Sid_Jafri
Responsive Resident
Responsive Resident

Hi @MAM627646 

 

Filter(Office365Users.SearchUser({searchTerm:DataCardValue5.SearchText}), !(EndsWith(DisplayName, "- ADMIN")))

You don't need to provide columns at the end of the filter and can set through ComboBox property if need to

Please Thumbs up and accept as solution if my post helped you solve your issue.

Correct it is a person sharepoint column  and the update in the Datacard is set to 

{
Claims:"i:0#.f|membership|" & Lower(DataCardValue5.Selected.Mail),
Department:"",
DisplayName: DataCardValue5.Selected.DisplayName,
Email: DataCardValue5.Selected.Mail,
JobTitle:".",
Picture:"."
}

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,051)