web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

List Group Members

(0) ShareShare
ReportReport
Posted on by 315

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?

 

Power Automate Screenshot.png

Categories:
I have the same question (0)
  • Verified answer
    Alex-W Profile Picture
    315 on at

    I solved this issue on my own and learned something in the process.  The "value" from the List group members action is formatted as JSON.  Even though I can look at the JSON output and read what's in it, the condition does not seem to be able to do that.  So, I had to use an expression that converts the JSON to string.  Once I did this, the condition was able to determine if the user's email address was already in the value output.  

     

    This is the expression I used: 

     

    string(outputs('List_group_members')?['body/value'])

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard