Skip to main content
Nintex Community Menu Bar
Solved

Create SharePoint group in Nintex for O365

  • May 25, 2017
  • 3 replies
  • 38 views
  • Translate

We have a requirement to create some SharePoint groups in sites immediately after site creation and apply those to lists and libraries within the new site with various permissions.

Is there a way in Nintex for Office 365 that we can create the groups and then apply those groups to lists and libraries with the appropriate permissions?

Best answer by TomaszPoszytek

To create a group you should use the Web Request action to call SharePoint REST API for "Users, Groups and Roles": Users, groups, and roles REST API reference  and make a POST request to the URL:

http://<server>/<site>/_api/Web/SiteGroups

Using the following headers:

content-type: application/json; odata=verbose
cookie: FedAuth={fedauth cookie};rtFa={rtFa cookie}

Optionally, you can use the "X-RequestDigest" token instead of the "cookie" header variable. To obtain FedAuth, rtFa or RequestDigest follow my post: Working with security credentials (RequestDigest, FedAuth, rtFa)

And the following body:

{ 
    '__metadata':{ 'type': 'SP.Group' }, 
    'Title':'Training',
    'Description':'Description of new group', 
    'AllowMembersEditMembership':'false',
    'AllowRequestToJoinLeave':'false', 
    'AutoAcceptRequestToJoinLeave':'false',
    'OnlyAllowMembersViewMembership':'true', 
    'RequestToJoinLeaveEmailSetting':'true' 
}

After you create your group you can then use the "Office 365 Set Permissions" action to grant the group specific permissions to your object and then using the approach Courtney described - add users to your group.

Just be aware, to put actions for a group creation and permissions granting inside an App Step action, so that thez will be executed with the elevated permissions thus won't face 401

Regards,

Tomasz

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+13

I don't know of a way in Nintex to create a group, however you are able to add users to a group and assign permissions to lists using that group using the "Update Item Permissions" and "Add User to Group" actions

Translate

TomaszPoszytek
Forum|alt.badge.img+17

To create a group you should use the Web Request action to call SharePoint REST API for "Users, Groups and Roles": Users, groups, and roles REST API reference  and make a POST request to the URL:

http://<server>/<site>/_api/Web/SiteGroups

Using the following headers:

content-type: application/json; odata=verbose
cookie: FedAuth={fedauth cookie};rtFa={rtFa cookie}

Optionally, you can use the "X-RequestDigest" token instead of the "cookie" header variable. To obtain FedAuth, rtFa or RequestDigest follow my post: Working with security credentials (RequestDigest, FedAuth, rtFa)

And the following body:

{ 
    '__metadata':{ 'type': 'SP.Group' }, 
    'Title':'Training',
    'Description':'Description of new group', 
    'AllowMembersEditMembership':'false',
    'AllowRequestToJoinLeave':'false', 
    'AutoAcceptRequestToJoinLeave':'false',
    'OnlyAllowMembersViewMembership':'true', 
    'RequestToJoinLeaveEmailSetting':'true' 
}

After you create your group you can then use the "Office 365 Set Permissions" action to grant the group specific permissions to your object and then using the approach Courtney described - add users to your group.

Just be aware, to put actions for a group creation and permissions granting inside an App Step action, so that thez will be executed with the elevated permissions thus won't face 401

Regards,

Tomasz

Translate

Forum|alt.badge.img+3

After a lot of trial and error, I just bumped into this Accelerator, which worked like a charm

https://gallery.nintex.com/5e30b379c1598d0045372b52/Create%20SharePoint%20Group

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings