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 / Dataverse Views - Can ...
Power Apps
Answered

Dataverse Views - Can I Use a Variable From My Canvas App and Send to the 'Filter By' In My View?

(0) ShareShare
ReportReport
Posted on by 228

I am building a canvas app with a Dataverse data source.  I have a gallery where the Items property is set to a Dataverse view which has a filter and it works as expected.  

// This code works in the ITEMS property of my gallery
Filter( AssignedUserss, 'AssignedUserss (Views)'.'DIApp Home User Dashboard' )

 But the filter in my Dataverse view uses a hard-coded email and I need it to be the logged in user (i.e., User().Email).  Can I pass a canvas app variable to the filter in the DV view to replace the hard-coded email value?    
Dataverse - DI App HM User Dashboard View - FILTER.png
If that is not possible, then can I remove this filter from this DV view and perform the additional filter in the ITEMS property of my gallery (i.e., modify the gallery ITEMS formula in the code snippet shown above)?  This is a new concept for me so I appreciate any suggestions.  

I have the same question (0)
  • 365-Assist Profile Picture
    2,324 Moderator on at

    Good question . There doesn't seem to be an out of the box answer. In fact someone has posted it as an Idea. Give it a Vote. Make CDS Views accept parameters - Power Platform Community (microsoft.com)

     

    A work around could be to create lookup column using the User Table

    365Assist_0-1655274782633.png

    Then just create a filter based on that column

    365Assist_1-1655274836427.png

     

    ---------------------------------------------------
    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    Subscribe: https://www.youtube.com/channel/UCFpvUlpx84FuIPOdInGKMTw
    Twitter: https://twitter.com/assist_365

    Regards
    Darren Lutchner - 365 Assist

  • Verified answer
    Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @cmanning ,

     

    Right, this is not possible to add as a dynamic parameter on the view.  You might want to look at adding a search on to your filter, something like this:

    Search(Filter('AssignedUserss', 'AssignedUserss (Views)'.'DIApp Home User Dashboard'),emailtosearch.Text,"solutionprefix_assigned_email")

    where you would have the field for the email you are trying to search for (probably the User().Email or something like that) and then the name of the column from the Dataverse table in the double quotes. 

  • cmanning Profile Picture
    228 on at

    @dpoggemann - Thank you for the solution!  Below is the working code.  I'm glad to know what I initially wanted to do (pass a variable to a DV view) is not possible until MS decides to make that feature available. 

    Search( Filter( AssignedUserss, 'AssignedUserss (Views)'.'DIApp Home User Dashboard' ), User().Email, "cr4de_assignedemail" )

     

  • cmanning Profile Picture
    228 on at

    @365-Assist - Thank you for your response and for providing the link to the feature request (I upvoted it)!

  • DaveBraben Profile Picture
    6 on at

    I can't believe this requirement hasn't got a high profile with concerns around delegation. I can only suggest the use of startswith() as this is delegable. However, it requires a string value. There's a lot of hacky code out there where users are creating string fields and then extracting a string from their required filter value and then using an automated Power Automate to then save it as a string.

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard