cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
arindam40
Regular Visitor

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
poweractivate
Community Champion
Community Champion

@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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,035)