
Announcements
I have a flow that starts with a form where responder identify training sessions they wish to attend, then automatically adds responders to a Team, and then sends them an email confirmation with further information. But if someone who is already a member of that Team submits the form then the flow breaks.
Is there a way to filter whether they are members of the Team first, then if not add them and send the email? And if they are already members, then they just get sent the email?
Any help would be greatly appreciated!
Thanks.
Hi @sp86,
You could use a Graph API call to list the members of a group. In that same call you can filter for the correct group. After that you can filter the members and check if the responder is already listed as member.
Below is an example
Uri for the graph call. Make sure you change the question to your specific training session question.
https://graph.microsoft.com/v1.0/groups/?$filter=displayname eq '@{outputs('Get_response_details')?['body/r3bb27b19ab6b4849b0955f236014b841']}'&$expand=members
Expression for the From field of the Filter Array action
outputs('Send_an_HTTP_request')?['body']['value'][0]['members']
Check in the condition if the user is not listed as member
length(body('Filter_Array'))
If that is the case use the below for the add a member to the team action
outputs('Send_an_HTTP_request')?['body']['value'][0]['id']