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
Highlighted
Super User
Super User

Re: Gallery filter to excluded records that contain specific text.

@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
Highlighted
Super User
Super User

Re: Gallery filter to excluded records that contain specific text.

@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

Advocate I
Advocate I

Re: Gallery filter to excluded records that contain specific text.

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

Highlighted
Super User
Super User

Re: Gallery filter to excluded records that contain specific text.

@HodgsonIM 

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

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,180)