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 / How to remove users fr...
Power Apps
Answered

How to remove users from Team dataverse table

(1) ShareShare
ReportReport
Posted on by 24
I have the measure owners grid in model driven and i have scope and measure tables. If i add scope owner and scope backup these will add automatically as measure owners to this grid. for that used relate rows action in power automate and provide the relation and teams table. It is working good when i create the scope. If i update the existing scope owner and scope backup then it is not removing the existing users and not adding the updated one. for that used unrelate rows. Please help me on this.
Categories:
I have the same question (0)
  • Verified answer
    MParikh Profile Picture
    521 Super User 2026 Season 1 on at

    The issue is the relationship type behind your Measure Owners grid. With Team Template set to Measure Access Team, the grid uses Dataverse Access Teams, not a standard N:N relationship. Relate Rows works on Add because Dataverse silently provisions the access team buffer and adds the user as a member. Unrelate Rows does not consistently reverse this through the same path. The supported way to manage access team membership is through two unbound actions: AddUserToRecordTeam and RemoveUserFromRecordTeam.

    Add a user

    In Power Automate, use Perform an Unbound Action with these inputs.

    • Action Name: AddUserToRecordTeam

    • Record (Target): the Measure record reference, for example /cr123_measures(recordGuid)

    • SystemUserId: the user GUID

    • TeamTemplate (Target): /teamtemplates(teamtemplateGuid) for Measure Access Team

    Remove a user

    Same action shape, with Action Name set to RemoveUserFromRecordTeam and the same three parameters.

    Why your update flow fails

    The Dataverse trigger gives you the modified Scope row but no previous values. You need both old and new to compute the diff. Three patterns work.

    1. Shadow columns. Add hidden columns scopeowner_previous and scopebackup_previous on Scope. Compare current values against these on update, perform the removes and adds, then write the current values into the previous columns at the end of the flow.

    2. Read current access team members. Query teammembership for the record's access team filtered by team template, compute the diff against the new Scope Owner and Scope Backup, then call Remove and Add for the deltas only.

    3. Full reset. List all current members on the access team, remove every one, then add the new Scope Owner and Scope Backup. Simplest logic, more API calls.

    4.  

    Pattern 2 is the most reliable for production.

    Steps:

    1. Trigger on Scope row modified, filtered to scopeowner and scopebackup columns.

    2. List Measures related to this Scope.

    3. Apply to each Measure.

    4. List team members on the access team for the record using the Measure Access Team template.

    5. Build the desired set as new Scope Owner GUID plus Scope Backup GUID.

    6. For each user in current minus desired, call RemoveUserFromRecordTeam.

    7. For each user in desired minus current, call AddUserToRecordTeam.


    8.  

    Thank you!
    Proud to be a Super User!
    Don’t forget to Accept as Solution if this guidance worked for you.
    Your Like motivates me to keep helping

  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    MParikh's answer covers everything. The key insight is that Relate/Unrelate Rows doesn't work reliably for Access Teams you need the dedicated unbound actions.

    One small addition: when querying current team members in Pattern 2, use the List Rows action on the teamsmembership table (not teammembership) and filter by teamid.
    You can get the access team ID by calling RetrieveAccessTeamTemplate or by storing the team template GUID when first setting up the relationship. This makes the member diff query straightforward.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard