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 / Reading filters, setti...
Power Apps
Answered

Reading filters, setting filters and controlling columns

(2) ShareShare
ReportReport
Posted on by 1,039

When creating Dataset controls, it's quite common to be want to have full control over the columns and filtering so that the data can support the custom visual being rendered.

 

Currently:

1. If we add a custom control to a view, this works well until the user uses the 'Quick Find' box, and then the columns are reset to be the 'Quick Find' view rather than the view columns for the specific view. This isn't specifically an issue with PCF since it's always been the case, but it's particularly troublesome for custom visuals - especially in light of not being able to hide the quick find box on home page grids.

 

2. If the dataset control wants to control it's own filtering, there is no supported way of reading the current filtering and adding more filters. I can see functions to get/set filters but there isn't any documentation around these.

 

I have the same question (0)
  • ScottDurow Profile Picture
    1,039 on at

    Bump!

    It would be good to get some documenation around 'addFilter' and confirmation that using 'addColumn' to work around the Quick Find issue is fully supported.

  • AnqiChen Profile Picture
    Microsoft Employee on at

    hi Steve,

     

    Yes, thanks for bring this up!

     

    1) We do not have well documented the 'addColumn', as well as other data-set code, essentially it adds the 'attribute', then call refresh, then next time the column & all the column data will sync down. I apology for the inconvenience bring to u. In the mean time, feel free to post question in forum or directly send me email  achen@microsoft.com.

     

    2) Regarding the view changed to QuickFind view but the instance not expired. This worth more discussion. I will follow up on this

     

    3) I think to achieve ur demand, please see if you could use <property-set>, which will always sync down the designated column regardless the column is on the view. It's view agnostic.

     

    Let's say in manifest, it's

    <data-set name='data-set1'>

       <property-set  name='property-set1' /> 

    </data-set>

     

    Once u bing the 'property-set1' to any data-type combatible attribute,  say 'field1',of that entity through customization UI. Then 'field1' is always in columns and its data will sync down regardless how we switch the view.

     

    And the filtering logic could be written directly use 'property-set1', not 'field1'. I will share a sample code by today.

  • ScottDurow Profile Picture
    1,039 on at

    Really interesting! I'll give it ago. 

     

    Thanks @AnqiChen !

  • AKhaing Profile Picture
    45 on at

    <property-set> under <data-set> is really interesting to me. Thanks for sharing.

  • AnqiChen Profile Picture
    Microsoft Employee on at

    1) Attached is the sample code, which will indicate how to use the <property-set> to do filtering. It actually used to do sorting as well

    The code is at about line 229. I have provided two options

     

    2) Regarding the issue that whenever it switch to QuickView, then switch back. The instance has been reinitialized. This is by our design because the view has changed, so it should be reinitialized

     

    3) If one want to keep consistency between the switch, we could use  context.mode.setControlState to cache the info. And you could get the info once init at the 'state'

     

    Feel free to let me know if there are more questions

  • ScottDurow Profile Picture
    1,039 on at

    Excellent stuff - thanks @AnqiChen  - sample shows using the filtering which is really good. Would you be able to create a sample showing how to use property-sets inside a dataset to ensure the columns are always available nomatter what the view selected?

    Currently we use addColumn but I expect that this causes an extra refresh of the data.

     

    Regarding the quick search - when showing a PCF I would have expected that it simply adds a filter and refreshes rather than switching - but this behaviour has been like this since forever!

     

    Once we have the ability to hide the quick search then I guess it'll make things easier. Currently it's a jarring UX for the user if they search and their entire view is refreshed.

  • Verified answer
    AnqiChen Profile Picture
    Microsoft Employee on at

    hi Scott,

     

    the sample control I attached previously has a <property-set> in the manifest

    <data-set name="simpleTableGrid" display-name-key="SimpleTableGridProperty">
    <property-set name="searchField" required="true" display-name-key="SearchField_Display_Key" description-key="SearchField_Description_Key" usage="bound" of-type-group="SingleLineGroup" />
    </data-set>

     

    Once you import the control, at customization time, you choose to configure the property-set to any candidate field of that entity (No need to guarantee the field is on the view). Then that field will be synced down in   context.parameters.simpleTableGrid.columns. And value will sync down associatedly.

     

    Would u mind to try it?

  • Bhuvita Sisodiya07 Profile Picture
    78 on at

    Is it possible to render PCF control for QuickFind results of view?

    @ScottDurow 

  • ScottDurow Profile Picture
    1,039 on at

    Yes - but you will need to bind the control to the quick find results because it's a different view.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello, Packaging of solution works only with .Net framework 4.6.2 not 4.7.2 ?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 528

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard