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 / Model Driven App - How...
Power Apps
Unanswered

Model Driven App - How do I relate Users table with Teams table?

(1) ShareShare
ReportReport
Posted on by 87

Hi.

My model driven app has a field that should allow a dropdown of a subset of Users in the User table. These users are part of a Team that has a AAD security group as its members. I know the tables are not linked OOTB. All I really want is to filter the table of users based on who is a member, but it doesn't show any data when I add relational table "Team". 

I did see an article for this, but can't find it for the life of me.

Help appreciated.

Thanks.

John. 

I have the same question (0)
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @johnguilbert191 

    So you are talking about the AAD users table or the system users table?

     

    You can add custom view similar to the below:

    		fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" +
    			"<entity name='systemuser'>" +
    			"<attribute name='fullname' />" +
    			"<attribute name='systemuserid' />" +
    			"<order attribute='fullname' descending='false' />" +
    			"<link-entity name='teammembership' from='systemuserid' to='systemuserid' visible='false' intersect='true'>" +
    			"<link-entity name='team' from='teamid' to='teamid' alias='ab'>" +
    			"<attribute name='teamid' />" +
    			"<filter type='and'>" +
    			"<condition attribute='teamid' operator='eq' value='" + teamId + "' />" +
    			"</filter>" +
    			"</link-entity>" +
    			"</link-entity>" +
    			"</entity>" +
    			"</fetch>";
    
    		var layoutXml = "<grid name='resultset' object='8' jump='fullname' select='1' icon='1' preview='1'>" +
    			"<row name='result' id='systemuserid'>" +
    			"<cell name='fullname' width='300'/>" +
    			"</row></grid>";
    
    		if (formContext.getControl("fieldLogicalName") != null) {
    			formContext.getControl("fieldLogicalName").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);
    		}
  • CU17011032-0 Profile Picture
    87 on at

    Hi Mira.

    Appreciate the response.

    This is the System "User" table being used in a Model Driven App in a solution with Dataverse. I have seen that you should be able to filter this table based on which team users are in in the "Team" table. However, the team uses an AAD security group. I shouldn't need code surely - isn't it just a manual relationship setup between "Team" table and "User" table?

    Thanks.

    John.   

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @johnguilbert191

    I am might have misunderstood your request but let me try again so did you setup a team in dataverse from AD security group or do you want to set it up:

    https://learn.microsoft.com/en-us/power-platform/admin/assign-security-roles 

    But to Filter the users if you can elaborate more as I believe I am a bit confused.

     

     

     

  • CU17011032-0 Profile Picture
    87 on at

    OK. So I have a Solution. It has a Model Driven App. Dataverse in it has a system "Team" table and system "User" table. I have set up a Team that is assigned with a AAD Security Group for the users who I want to have access to the App and also be the list of users for a lookup in the App. All I want is a restricted view of "Users" who are part of the Team I have set up. Does this make sense?

  • ConnollyZ Profile Picture
    10 on at

    Incase anyone else needs this, to relate the user table to their respective team the tables in the dataverse connect through a bridge teammembership. 

    systemuser to teammembership to team

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
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard