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 Platform Community / Forums / Power Automate / Azure Group Members Sy...
Power Automate
Unanswered

Azure Group Members Sync to SharePoint List

(1) ShareShare
ReportReport
Posted on by 33

I need to sync an Azure groups members with a SharePoint List, it must have logic to not create an item in the SharePoint list if the member already exists in the list.

It should also be able delete a list item from the list if a user has been removed from the Azure group.

 

My current flow works when testing, the items are created but it throws errors because of unique columns such as email and username.

Categories:
I have the same question (0)
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @JazzyN20  i think you need to add Get items action with filter query to first check if user is already added to the list or not.

  • JazzyN20 Profile Picture
    33 on at

    Thanks @annajhaveri but I am already playing around with the get items action, it is more the question of how to get it to all work

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @JazzyN20  can you share structure of your SP list (columns and column type). Do you have filter query on Get Items? Also if you can share your existing flow screenshot i can advise how you can take it further?

  • JazzyN20 Profile Picture
    33 on at

    JazzyN20_0-1616603063400.png

    I have no filter yet, the list is small so no need to filter but the final solution will have over 1000 items.

    I have added a column to my contacts list named 'GroupID', this is for the object ID of the user in the O365 group can be added so I have a shared record in common to perform the conditional check. It is the condition logic that I am struggling with. Thanks

  • Verified answer
    annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @JazzyN20  yea for final solution when list will have 1000 items, you should put a filter query o Group ID

     

    So first you will need to identify the users from AD group which are not added to SharePoint list, to do that follow below steps:

    1. Add select action after Get Items, and configure it as below screenshot, for From parameter select value (list of items) from Get Items dynamic content and for Map parameter, click on little icon on right of the input box, instead of Title column you can use the column which stores email of user in the list

    annajhaveri_0-1616676089599.png

    2. Again add select action, and configure it as below screenshot, for From parameter select Group Members from  dynamic content and for Map parameter, click on little icon on right of the input box and select Group Member Mail

    annajhaveri_1-1616676802709.png

     

    3. Now add filter array action and select the second Select (group members) output in the From parameter, then in left side of value use  join(body('Select'), ';') expression, select does not contain from dropdown and on right side of value user item() expression as shown in below screenshot

    annajhaveri_2-1616676943593.png

     

    Now you will have array of list of users (email) which are added to AD group but not added to SharePoint list

     

    to add the remaining users to the SharePoint list configure apply to each and create item action as below screenshot:

     

    annajhaveri_4-1616677408628.png

     

     

  • JazzyN20 Profile Picture
    33 on at

    Sorry for the silence, been busy but I will have a look this week and come back to you

  • JazzyN20 Profile Picture
    33 on at

    Hi Anna

     

    I do not see this final option...

    JazzyN20_0-1618226600732.png

     

  • JazzyN20 Profile Picture
    33 on at

    So i typed in the expression 'item()' and hit save. It then populated the filter array value as per you instruction but i know receive this Flow error for the first filter array value you specified of  join(body('Select'), ';')...

     

    JazzyN20_0-1618234160456.png

     

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    Just type in item() in the expression and click on Ok button as shown below 

     

    annajhaveri_0-1618234252069.png

     

  • JazzyN20 Profile Picture
    33 on at

    Hi Anna

     

    I have this working now, thank you.

    I do have an issue with the final 'Create Item' action . When using the 'Current Item' value, this only inserts the Email Address from the AD group into my SharePoint List.

    The other fields such as 'Contact Name' cannot be accessed. If I use the 'Current Item' value then it inserts the email address value. How do I map these over too?

    JazzyN20_0-1618244379552.png

     

    I tried simply inputting the AD Group Action get values but this then inserts another Apply to Each branch inside the existing one, when the flow is run it tries to create all of the items - one run for each and every value passed from the array!

     

    JazzyN20_1-1618244426550.png

     

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard