
hello Team,
I am trying to make a flow which does the following:
1. Gets the Group Members from Azure AD
2. Get the items from the sharepoint list.
3. If the user already exists, it should skip it, if it does not exist, then it shud create the object in the list.
4. This is where i am stuck - If the user is NOT there in the Group members, but IS there in the Sharepoint list, then the flow should delete that object from the list.
The flow looks some thing like this.
Now, i have tried mutilple things, i even created a separate flow which runs after the first above flow, to check if the items existing in the list are there in the group, if not, then delete. But for some reason, either the entire list gets wiped out or i get the diference.
The problem is as follows:
Group 1 has following uses:
User1, User2, User3, User4, User5.
If I will run the flow, it will create the list based on the above users.
Now lets say, I remove User2, and add User6 to the group and I run the flow again, the list will contain following users:
User1,User2,User3,User4,User5,User6.
Due to this, i cannot complete my task. Please need urgent support on this.
An alternative option for you is to create a except on the two arrays of list items and guests. I have detailed a quick way to perform an except here using a filter array action.
Once you have your two filter arrays, you can run an apply to each on both groups, one to add a new user and another to delete from list.
Hope that makes sense.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien
P.S. take a look at my new blog here