cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Gallery filter to excluded records that contain specific text.

I have a gallery from Office365Users that is filtered by the deptarment manager. Now I need to remove people from this list based on their job title. How do I write an expression to filter out the Jobtitles that contain a term like "Consultant"?

 

Any help is much appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@HodgsonIM 

I am going to show you a quick mini-tutiorial that you can apply to your own situtation.  Start a new app and give this a try.

 

Step #1 Create a new button.  Put this code in the OnSelect property of the button.

 

ClearCollect(
myCollection,
{
job_title:"Cost Accountant"},
{job_title:"Senior Financial Accountant"},
{job_title:"Junior Financial Accountant"},
{job_title:"Administrative Assistant"},
{job_title:"Assistant Controller"},
{job_title:"Senior Controller"}
);

 

Step #2 Click on the button to create the collection

 

Step #3 Make a new gallery.  Put the following code in the Items property of the gallery.

 

Filter(myCollection,Not(IsMatch(job_title,".*Accountant.*")))

 

Step #4  The gallery will now show all records which do not include Accountant within the job title.

 

Note:  for your own example you can substitute "Consultant" for "Accountant"

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

 

 

View solution in original post

3 REPLIES 3
Super User III
Super User III

@HodgsonIM 

I am going to show you a quick mini-tutiorial that you can apply to your own situtation.  Start a new app and give this a try.

 

Step #1 Create a new button.  Put this code in the OnSelect property of the button.

 

ClearCollect(
myCollection,
{
job_title:"Cost Accountant"},
{job_title:"Senior Financial Accountant"},
{job_title:"Junior Financial Accountant"},
{job_title:"Administrative Assistant"},
{job_title:"Assistant Controller"},
{job_title:"Senior Controller"}
);

 

Step #2 Click on the button to create the collection

 

Step #3 Make a new gallery.  Put the following code in the Items property of the gallery.

 

Filter(myCollection,Not(IsMatch(job_title,".*Accountant.*")))

 

Step #4  The gallery will now show all records which do not include Accountant within the job title.

 

Note:  for your own example you can substitute "Consultant" for "Accountant"

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 

 

 

View solution in original post

Highlighted

Thank you so much. That is EXACTLY the expression I needed. I appreciate the quick response also!

Highlighted

@HodgsonIM 

No problem at all.  Best of luck building your app!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,854)