cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Automatically add newly created user to required groups

Hi. I'm testing out Power Automate to see if we can streamline and simplify user creation for our bigger 365 tenants.

I've managed to set up a Flow that creates a new user based on a Sharepoint list. But I cannot figure out how to add the new user to all the required distribution/security groups. The item on my list allows for the selection of the actual groups (not just simply listed as a string).

Is there any way to automate this? Any action I can find requires the groups' ID.

Thanks for all the help and input in advance!

3 REPLIES 3
Community Support
Community Support

Hi @MarkG44 :

I'm not sure of I understand your needs , if there are any mistakes please tell me:

  • You create a new user in the tenant by creating a new record in the SharePoint List.( Through flow)
  • When creating this new record, you will also specify a group.
  • You want this new user to be automatically added to this group.
  • I assume that Group is a text column. When you specify a Group, you only need to fill in the name of the Group.

If so , The key is to get the Group ID through Group Name. Currently, Power Automate does not have any action to directly obtain the Group Id through the Group Name. The only way is to obtain the Group list first, and then find the corresponding Group Id through the Group Name.

Ive made a test for your reference:

My data source:

Column (click to edit)

Type

Title

Single line of text

Display Name

Single line of text

Mail Nickname

Single line of text

Password

Single line of text

User Principal Name

Single line of text

GroupName

Single line of text

 

v-bofeng-msft_0-1606101950647.png

 

My flow:

v-bofeng-msft_1-1606101950652.jpeg

 

There is currently no good way to get all the Groups in the organization, so I use "User Team" to list the Teams I belong to. If you need to get all the Groups in the organization, you need to use MS Graph to create a custom connector.

Here is the result:

 

v-bofeng-msft_2-1606101950655.jpeg

 

Best Regards,

Bof

Hi. You've understood my very poor description correctly! But what if the column containing the required Group or Groups is not just simply text/string, but "Person or Group"? Would it still require these weird, hacky workarounds?
I'm really surprised there is no easy, built in way to do this. 

Hi @MarkG44 :

I took this into consideration when I did the test yesterday. But the value of Group in "Person or Group" does not include GroupId and its displayname is somewhat different from the actual group name (the format is "GroupName Members"). So using the "Person or Group" column will not reduce the workload but will increase the difficulty (need to clear "Members" in displayname).

Best Regards,

Bof

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (8,038)