Hi
I have about 200 teams where we have internal users (usertype Member) and external users (usertype Guest).
I want to extract all guests from these 200 teams and put the guest-users in a security group.
I can do this by making a flow that follow this logic:
1. Get all teams IDn (i have them stored in dataverse)
2. For each team-ID fetch that teams members.
3. For each member in current team, if usertype = guest then keep going
4. For each member in current team that is a Guest, do a filter array and filter the security groups all members on the current guest user from teams.
5. If i get a result in the filter that is larger than 1, then the user is already in the security group. if i get a result of 0, then the guest user from the team needs to be added to the security group.
That is the flow for adding members to the group.
After that flow i do a child flow and run these steps.
1. Get all teams IDn (i have them stored in dataverse)
2. For each team-ID fetch that teams members.
3. Put the team members into an variable array (append to array)
Loops all 200 teams and build a huge array with all teams members.
4. Then for each member in the security group do a filter array that checks if each user in teh security group exist in the huge array of members (variable array).
5. If result of the filter array is larger than 0 then user do exist in one of the teams and nothing more is done. But if the result of the filter array is 0, then remove the member from the security group since it is not found in one of the teams.
--
This seems to work. I have not yet tested it on all 200 teams tho...
But i do not like the flow... it feels to complicated and i am afraid i am doing something wrong. That i will reach some limit in how large an array can be by pushing in 200 teams members into one large list.
I am looking for tips if i can do this in a smarter and more effective way. Running this flow for all 200 teams will most likely take well over 60 minutes to complete.