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 Automate / Enable/Disable users t...
Power Automate
Unanswered

Enable/Disable users temporarily while exporting records

(0) ShareShare
ReportReport
Posted on by 34

Hi,

I'm trying to build a flow that disables users temporarily in order to export records from a model-driven app. I've seen several 

 

There will be one admin user who will be in charge of exporting records, the process should only take 10-20 min. Then the admin user can enable the other users after completion.

 

So ideally a manual trigger (button) that when clicked it disables specific users, lets the admin do what they need to do and then they can click the button to enable user access again. 

 

Is that possible via flow? Or is there a diff/better way?

Categories:
I have the same question (0)
  • JonDoesFlow Profile Picture
    1,304 on at

    @brushb Yes it is possible. I take you are using Dataverse, you could find the user in the Users table and then set their status. There is a field called Status on that table. 

    You can look them up either using their User GUID in the Model Driven app or if you don’t have that, use the get user profile Office 365 action and list rows on the Users table. Use that ID in a search for the Azure AD Object ID. 

     



    ---------------------------------------------------------------------------


    If I have helped you with an answer, please accept this post as a solution and thumbs up my reply. Thanks !

    Blog - JonDoesFlow
    Twitter - JonDoesFlow
    YouTube - JonDoesFlow

  • brushb Profile Picture
    34 on at

    Excellent. Yes I'm using Dataverse, and I did find the User table with the status.

     

    So for the action steps of the flow:

    1. Manually trigger flow - It can be the flow dropdown in the ribbon right?

    2. List rows? I always get confused by the dataverse options 

    - There are only a few users that will need to get disabled, so can i list their guids manually? Or should i put the "get user profile" as the second action step?

     

    Thank you again, im fairly new to this

     

  • JonDoesFlow Profile Picture
    1,304 on at

    The trigger can be anything you like. 

    list rows yeah on the User table, and pass the user ID from the record. 

  • brushb Profile Picture
    34 on at

    This is what i have so far. 

    List rows - just indicated the user table

    Apply to each - the value was automatically chosen
    Get row by ID- i selected the unique identifier which is the guid

    brushb_0-1698080309685.png

     

  • JonDoesFlow Profile Picture
    1,304 on at

    @brushb Has that worked ? 

  • brushb Profile Picture
    34 on at

    No, i need to specify which users get disabled but where do i do that

  • JonDoesFlow Profile Picture
    1,304 on at

    So I would imagine that needs to be part of the trigger ? Maybe doing an instant flow isn’t the right trigger ? 

  • JonDoesFlow Profile Picture
    1,304 on at

    So I think in your manual trigger, capture the person’s email address. Pass that through the office 365 Get User Profile action. That will provide you with an ID. 

    the use the list rows step, to look through the User table and filter it by the Azure Active Directory object ID that you get from the Get user profile step. 

    you can then set its status. 

  • brushb Profile Picture
    34 on at

    I created a field for enable/disable which is a yes/no field on a form. 

    But here's what i have so far. For the office365 i put the users email. 

    brushb_0-1698156535537.png

    Then added a new action thats a condition:

    brushb_1-1698156970585.png

    If yes = set status to yes (not shown in pic)

     

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard