web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Advanced Filtering of ...
Power Apps
Unanswered

Advanced Filtering of a Dataverse dataset in a PowerCAT Details List component

(0) ShareShare
ReportReport
Posted on by 105

This is a long and detailed post, so thanks for reading if you do!

 

Problem statement: I have a bug that I can't work out - I'm trying to implement some multi-layer filtering of a collection. When the app first loads, I get the correct list of results in my DetailsList control. Then if I change one of the fields that make up my filter criteria in the app, the results filter appropriately, awesome! But then when I remove the filter criteria that I just added, the results go away and nothing shows up again until I have selected a value for each filter criteria (assuming there is actually a result that matches those criteria). In the onChange property of all fields used for filtering, I am ClearCollecting the appropriate collections in the exact same manner as I did in the OnStart to get the initial results, but something doesn't seem to be working. Full details below!

Cosmic_Kitchen_0-1717519655796.png

 

The app runs in the context of a single contact record in dataverse. The purpose is to collect some professional information about the contact and display a list of jobs that we have in our system that would be a good fit for them. There are different options for filtering these jobs - a user could select to view the Contact's profile specific jobs (where the results are ) or they may search all jobs for that Contacts category (where the initial list is only filtered off of 1 field value from the contact record)

 

Additionally, once the initial filter results from Dataverse are stored in a collection, I want to give users the ability to narrow down those results with a series of combobox controls that allow them to select specific accounts, locations, etc. and have only those jobs be displayed.

 

The approach I took was to structure 3 different collections. 

 

My first collection, col_allCategoryJobMatches, is populated from a dataverse table on start of the app with the following statement, which includes some housekeeping filters that always need to be in place as well as adding and populating the columns that will be displayed in the PowerCAT Details List control of results.

If(
 !IsBlank(_thisCandidate.Category),
 ClearCollect(
 col_allCategoryJobMatches,
 AddColumns(
 Filter(
 Jobs,
 Status = [@'Status (Jobs)'].Active,
 'Job Status' = [@'Job Status'].Open,
 Category = _thisCandidate.Category
 ),
 account,
 'Account ID'.'Account Name',
 rank,
 'Account ID'.'Account Rank',
 city,
 'Account ID'.City,
 state,
 'Account ID'.State,
 shift,
 Shifts,
 pay,
 Text(
 'Total Weekly Wages',
 "$#,##0.00"
 ),
 start,
 'Start Date'
 )
 );

 

Once I have this initial collection, I collect col_candidateProfileJobMatches. This collection takes col_allcategoryJobMatches and filters it based on 3 other fields (single and multi-select comboboxes) in the app. 

ClearCollect(
 col_candidateProfileJobMatches,
 Filter(
 col_allCategoryJobMatches,
 IsBlank(cmb_candidateSpecialty.Selected) || 'Unified Specialty'.'Unified Specialty' = cmb_candidateSpecialty.Selected.'Unified Specialty',
 IsBlank(cmb_candidateDesiredLocation.SelectedItems) || state in cmb_candidateDesiredLocation.SelectedItems,
 IsBlank(cmb_candidatePreferredShifts.SelectedItems) || shift in cmb_candidatePreferredShifts.SelectedItems,
 IsBlank(_targetPay) || If(
 tgl_targetPayDealbreaker.Checked,
 'Total Weekly Wages' >= Int(inp_candidateTargetPay.Value),
 'Total Weekly Wages' >= Int(inp_candidateTargetPay.Value) - 150
 )
 )
 );

 

Finally, I check the condition of which Job Search Type the have selected in a combobox and collect the final collection col_displayedJobMatches. If they select to view profile specific matches, then this collection is populated by filtering col_candidateProfileJobMatches based on any of the real-time results filters. If they have selected all Category jobs, then I create col_displayedJobMatches the same way, but using the original col_allCategoryJobMatches as the source.

If(
 cmb_jobMatchMode.Selected.Value = 0,
 ClearCollect(
 col_displayedJobMatches,
 Filter(
 col_candidateProfileJobMatches,
 IsBlank(cmb_jobFilterAccount.SelectedItems) || account in cmb_jobFilterAccount.SelectedItems,
 IsBlank(cmb_jobFilterAccountRank.SelectedItems) || rank in cmb_jobFilterAccountRank.SelectedItems,
 IsBlank(cmb_jobFilterCity.SelectedItems) || city in cmb_jobFilterCity.SelectedItems,
 IsBlank(cmb_jobFilterState.SelectedItems) || state in cmb_jobFilterState.SelectedItems,
 IsBlank(cmb_jobFilterShift.SelectedItems) || shift in cmb_jobFilterShift.SelectedItems
 )
 ),
 ClearCollect(
 col_displayedJobMatches,
 Filter(
 col_allCategoryJobMatches,
 IsBlank(cmb_jobFilterAccount.SelectedItems) || account in cmb_jobFilterAccount.SelectedItems,
 IsBlank(cmb_jobFilterAccountRank.SelectedItems) || rank in cmb_jobFilterAccountRank.SelectedItems,
 IsBlank(cmb_jobFilterCity.SelectedItems) || city in cmb_jobFilterCity.SelectedItems,
 IsBlank(cmb_jobFilterState.SelectedItems) || state in cmb_jobFilterState.SelectedItems,
 IsBlank(cmb_jobFilterShift.SelectedItems) || shift in cmb_jobFilterShift.SelectedItems,
 IsBlank(cmb_jobFilterUnifiedSpecialty.SelectedItems) || 'Unified Specialty' in cmb_jobFilterUnifiedSpecialty.SelectedItems
 )
 )

 

Happy to engage and supply any other information as needed. Thanks community!

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard