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.
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
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?
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.
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.
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);
}