I am trying to write a flow that adds a user to multiple groups and verifies the user is not already in the group before executing the Add member to group action.
I have two SharePoint lists:
- List 1 contains the user's email address and an Action choice column with Add and Remove. If the Action column is set to Add, the flow runs.
- List 2 contains all the groups I manage with GroupName, GroupID, and Select columns. If the Select column is set to Yes, the flow filters the list with the Get Items action.
In addition to Get Items, the flow also has the List Group Members action which retrieves the group members based on the output of the Get Items action. I am now trying to write a condition that checks if the user on List 1 is already in the group members list, and this is where I need help. The condition I have tried is using the value from the List group members action, does not contain the user's email. Even though the user is in a group that I am using for the test, the condition comes back as true. I have also tried body from the List group members action, and it did not work. If I select any other dynamic content from the List group members action, it converts to an Apply to each which causes the condition to be true multiple times.
How can I write the condition or update the flow to check if the user is already in a group?

Report
All responses (
Answers (