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 / How to filter table vi...
Power Apps
Answered

How to filter table views dynamically based on Current User Information

(0) ShareShare
ReportReport
Posted on by 34

This is my first time creating a model driven app, the system is a approval system where tasks should only be seen by approvers if they belong to a certain department. so end user interface is a  power pages portal and the admin portal is the model driven app. we have a table called Assignments and for every assignment there is a corresponding department. just a snippet of the relevant tables for my question. 

 

pics.jpg

 

 

I created a view of the main Assignment table called "Items for review" . What i need is filter out the items that are assigned to the current department of the currently logged in user. so if the user's department is HR then that person should only be able to see the HR assignments items. I cant seem to find a way to filter the view dynamically, it only gives me the hardcoded options for department which is in the choices. 

 

 

 

I have the same question (0)
  • Verified answer
    Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @pageflourin ,

    Dataverse utilizes a security model for dynamically filtering data based on ownership of records.  You mentioned "assigned to the department".  If you have a lookup on the table that is the department then this is not something you are going to be able to dynamically filter in the model app as this is not tied to the security model.  Also if you are trying to lock the user from not updating these records you will not really be able to do unless you leverage the Dataverse security approach.

     

    Some thoughts here...

    1. You could setup Owner Teams that actually relate to Groups in Azure Active Directory for the departments.  https://learn.microsoft.com/en-us/power-platform/admin/manage-group-teams.   Setting this up would provide the ability to assign users to the groups in AAD and this would automatically assign them to the respective teams in Dataverse.  You can then assign the ownership of the table's records to the Team.
    2. Assigning ownership of the records will then apply the appropriate user level security and you can then utilize role based security to define what you want to have happen with the table's records.  Example is you could have some users in a role where they will only be able to view, edit etc. records they own (or their team owns) and create other roles that will allow the users in that role to view, edit, etc. all records.  https://learn.microsoft.com/en-us/power-platform/admin/wp-security-cds#tablerecord-ownership 

    There are many additional advanced features around security including:

  • pagets Profile Picture
    34 on at

    Hi @dpoggemann , if my understanding is correct apologies if im wrong. 

     

    1) I created Owner Teams for each department we have (HR, IT, Finance...)  for the approvers

    2) In the table, are we able to assign the records created to the specific Owner Teams depending on the "department" input from the created record. is this the "Owner" field which is autopopulated with "SYSTEM" ?

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

    Hi @pageflourin ,

     

    Yes, the Owner field on the entity, this is on all User Owned entities.  Example in my demo below where 1 record assigned to Team (Team A) and other two assigned to the System Administrator.

    Screenshot 2023-05-10 at 4.26.58 AM.png

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard