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 / Add the ability to CDS...
Power Apps
Answered

Add the ability to CDS Views - to filter by a parameter

(3) ShareShare
ReportReport
Posted on by 207

Being able to use Views defined on the CDS entities is great for Power Apps, however, you still have to fetch all your rows and use filtering within the app to limit the data presented to the user. I would like to be able to pass a parameter to the CDS view in order to limit the rows fetched from the server.

I have the same question (0)
  • SeanHenderson Profile Picture
    1,104 on at

    You can customize your view to filter down to specific records. The filter is found in the bottom right of the view creator. 

     

    Annotation 2019-12-16 105547.png

     

    ---
    Please hit the "Accept as Solution" button if my post answered your question! If my post was helpful please consider giving it a "Thumbs Up."

  • barlowse Profile Picture
    207 on at

    Yes - the filtering is available - but it is a static filter - I am looking for a dynamic filter - where I can pass a variable from a Pwer App to the View.

  • frederikbisback Profile Picture
    222 on at

    Somebody, I need to same. I need to have the possibility to add a variable name. So that I can pass a value from the powerapps selection to the view. Thanks  

  • greggdavenport Profile Picture
    57 on at

    This feature would be extremely helpful

  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @barlowse,

    It is not possible out-of-the-box to have a dynamics filter in the entity list page (clicking the entity from the sitemap). For what exact scenario are you trying to have a dynamics filter? There are probably a few workarounds, for instance:

    • If you want to dynamics filter a view for a lookup field that it's possible with the addCustomFilter function

     

    formContext.getControl(arg).addCustomFilter(filter, entityLogicaName)

     

    • For a subgrid on a form, then you can dynamics filter based on the related record
    • Or you can filter a subgrid on a form with SetParameter but it is an unsupported customization
    • You can have some pre-build views and toggle them as need be

    Hope this helps

     

     

  • barlowse Profile Picture
    207 on at

    Thanks for the reply Eric. I am building canvas apps on custom cds tables.
    I guess to put it simply, I am looking for something like a stored procedure in SQL that I can pass a variable piece of data to and have the server do all of the filtering. Using custom views on the cds table will only get me so far, because it has to be a known value. The best workaround I have been able to do is, to use a static field that I populate with a value for example "Record 1", and then build my view using this field in the filter. However if this field has hundreds of different values - I have to build that many custom views. Which is not ideal. 
    Power Automate could preform the feat for me, but I have not had positive experiences using a flow in a canvas app and the time it takes to return results has not been less than acceptable.

  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @barlowse, thanks for clarifying. Since you're using canvas apps, options are:

    1. custom views but since you have lots of values it doesn't scale well like you mentioned
    2. apply the filtering directly in you canvas app with the filter expression, but you'll need to find a way to determine what that value (i.e. "Record 1") is. Would it be possible determine in the app and store value in a variable to reference in the other places?
  • Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    Think Filter is the only method provided.

     

    Filter('Contacts', _accountid_value = GUID("record_guid"))

  • Verified answer
    barlowse Profile Picture
    207 on at

    Filtering is what used with the views, so its working. Also I added an Idea here https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Make-CDS-Views-accept-parameters/idi-p/525667

    for consideration.

  • Sandra Soniec Profile Picture
    128 on at

    @barlowse I have a similar need and also voted for your proposal. I have a set of category fields for my records in dataverse. The use of the OOB filter would work but involves too many clicks for my end users (and some of them have difficulties defining queries for related data). We try out a custom page where uses can select desired categories and use power automate flow to compose a fetchXML query, which retrieves the desired records.

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 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard