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 

17 REPLIES 17
JR-BejeweledOne
Super User
Super User

I want to make sure I am understanding what you have setup correctly.    Is your combobox separate from the datacardvalue or have you put your formula into the item property of the Datacardvalue?



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.

I made some changes on the data property and now am able to search and see the data using the formula 

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

 

However, i am still able to view the admin accounts within the list they are not excluded 🙂

Thanks a lot 

Sid_Jafri
Responsive Resident
Responsive Resident

Hi @MAM627646 


You can try the trim now, it will help if you share the screenshot of few items of users says "- ADMIN" at the end. You may remove the "-" hyphen from filter if that helps

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

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

Very much appreciate your response. Here are some samples of the users that have admin words with thier account

 

XXXX.secadmin@xxxx
Admin,XXX
XXXAdmin@xxxx

Admin-XXXXX
admin-XXXXX@xxxxx

user, admin
admin@xxxxx

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

Sid_Jafri
Responsive Resident
Responsive Resident

Okay so Admin is not at the End of your Value and it won't work therefore you use 

Filter(Office365Users.SearchUser({searchTerm:DataCardValue5.SearchText}), !IsMatch(Trim(DisplayName), "ADMIN",Contains & IgnoreCase))

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

Wonderful it worked thanks a lot 🙂

Thanks Sid for all your exerted effort and support . 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,452)