cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
arindam40
Helper I
Helper I

Cannot remove users from an Azure AD group based on SharePoint list item trigger

Hi,

I am trying to handle an Azure AD group for maintaining licenses, with Power Automate. This test group has more than 1000 users, but the actual group will have more than 18000 users.

My attempt is to create a Flow, where based on a new SharePoint item created, that user should be checked & deleted from The target AzureAD group.

But somehow, this flow keeps on running in a loop & never finish, while the other condition keeps sending me email that the user cannot be added.

My Flow looks like this:

PM2.png

Get group members could be a hurdle, so pagination enabled to 5000 users.

What is wrong in my logic? Its not even giving an error. Its simply does not finish & goes in an infinite loop.

 

Thanks

Arindam

1 REPLY 1

@arindam40 

 

Please upload larger screenshot, and/or more than one screenshot, the one there is too small.

 

It might actually not be an infinite loop, it might just be a loop that takes a long time to complete. I suggest two things:

 

1. Use a smaller list filtered to around 50 or so elements to test the Apply to Each.

 

2. By default, Apply to Each runs one at a time and serially. This might take long time to complete. You can change Apply to Each to process more items at once and in parallel, like this:

 

 

2a. Click ellipses to the upper right of Apply to Each Action Block header, then from the menu options that appear, click "Settings"

82221-aeach-01.png

 

 

2b. Under Concurrency Control notice the default "Off" - click the toggle switch to turn it "On":

 

82221-aeach-02.png

 

2c. Drag the slider called "Degree of Parallelism" towards the left or right below, which can be dragged up to a maximum of 50 (to increase, drag it towards the right). If it is set at the maximum, then 50 items at once will be processed by the Apply to Each - instead of 1 item at a time with Concurrent Control off. When ready, click on the "Done" button. 82221-aeach-03.png

 

 

Check if it helps @arindam40 

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,026)