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 / New 365 group member t...
Power Automate
Answered

New 365 group member then create a SharePoint folder

(0) ShareShare
ReportReport
Posted on by 54

Hi PA community,

I am looking for some advise that I do not even know if it is possible. Not even sure where to start with the flow as I have had a look and could not find the answer, so here goes. 

Lets say I have a 365 group called 'staff' and then a SharePoint document library. Is there anyway that when new user 'a' is added to the group 'staff' it can create a folder for them in the SharePoint site?

 

Does anyone know if it is possible, the group will always stay the same. Thanks in advance. 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    I don't think there is a trigger that will fire when you add a new member to a group.  But you could create a recurrence flow that would run periodically (once an hour, once a day, or whatever) and in that flow compare the member list of the group with the folder list.  If a folder doesn't exist create one.  It wouldn't be instantaneous, but it could definitely be done that way.

  • PremierD Profile Picture
    54 on at

    Hi Pstork1,

     

    Thanks for the quick response, that would be a possible solution. I am very new to PA, would you be able to steer me in the right direction to at least try this method?  

  • Verified answer
    fchopo Profile Picture
    8,003 Moderator on at

    Hello @PremierD 

    There is a trigger when a user is added to a group, so it is possible to create the flow you want. Have a look at this example:

    HR.png

     

     1) When a new member is added to "Human Resources" group.

     2) If the user is added (removed is false)

    2) Get the user profile, using its id.

    3) Create a folder on a SharePoint site, in a document library called "Documents".

     

    Hope it helps!

    Ferran

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    OK, here's how it works.  Start out with a recurrence flow, get the members of the group, and list of folders in the library, then set a variable to track whether a folder exists or not.

    image.png

    Next loop through each user.  At the top of that loop set the variable to false, then check each folder and see if it matches the name of the user.  If it does set the variable to true, otherwise do nothing

    image.png

    after you check each folder check the variable.  If a folder was found for that user then do nothing.  Otherwise create a new folder.

    image.png

    Be sure that last condition check is inside the main loop, but below the inner loop.

     

     

  • PremierD Profile Picture
    54 on at

    That is brilliant, thanks very much for the rapid and really helpful response. 

  • PremierD Profile Picture
    54 on at

    Thanks also, I now have two options and will try both. I am sure they will both come in very handy.

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    The trigger is the better solution.  I just didn't remember seeing a trigger for that the last time I looked.

  • PremierD Profile Picture
    54 on at

    Hi,

    I have tried the flow and unfortunately it fails with the following , would you have any suggestions at all? Thanks

     

    failedrun.png

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    I looked at the screenshot for the example and @fchopo showed it using the UserId.  That field is actually a GUID.  You should be using the User Principle Name or Email value instead.

  • PremierD Profile Picture
    54 on at

    Hi,

    Thanks for reply, it only allows User ID, so a bit stuck. I tried adding fields below, but no change. I have removed the fields now.failedrun.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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard