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 / Filtering View based o...
Power Apps
Unanswered

Filtering View based on Current User "Country" attribute

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a question, related to Views (not Lookup or SubGrids):

On the Product View, I would like to display only the Products that have the Country equal to the Country of the Current User.

 

From my understanding, we cannot add JavaScript on Views.

How could this be achieved? 

 

The Products do not have Users as Owners.

 

Thanks!

I have the same question (0)
  • - Matt Bayes - Profile Picture
    91 on at

    Hi Mielleux,

     

    This is an interesting requirement, as we can't setup views out-of-box (OOB) that compare attributes together. In this example, you are looking to display all Products where the Country is equal to the Country of the Current User. 

    In order to achieve what you want, I'd say there are probably two options:

     

    1. Create a view using something like the FetchXML Builder in the XrmToolbox and import that into your Dataverse environment. This is technically unsupported, and the view would not be customizable from within the Dataverse once imported, but it could possibly solve your issue.

    2. The second option is to manage this using related tables to the Product and User. For example, I would probably create a Country table and relate that to the Product table. I would also then relate the Country table to the User table. Both of these associations would be related via a many-to-many relationship.

      Once those are setup, you would have to create all of the appropriate Country records in the system and associate the appropriate ones to both the Products and Users. What this would accomplish is having a list of Products with their associated Countries, as well as a list of Users with their associated Countries.

      When creating the view, you would have to show all Products where the associated Countries associated Users "User" attribute equals current user.

     

    I would have to setup a test for myself to see if it would work, but unfortunately through your original request I don't think it would be possible without using related tables to manage the data.

     

    If you have any questions let me know!

    Thanks!

     

    Matt Bayes

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard