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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add the ability to CDS...
Power Apps
Unanswered

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
    55 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,338 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard