cancel
Showing results for 
Search instead for 
Did you mean: 
simon_stevens
Nintex Newbie

Create SharePoint group in Nintex for O365

Jump to solution

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?

Labels: (1)
Reply
2 Replies
courtney_shelto
Nintex Newbie

Re: Create SharePoint group in Nintex for O365

Jump to solution

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

Reply
Highlighted
Automation Master
Automation Master

Re: Create SharePoint group in Nintex for O365

Jump to solution

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 solution in original post

Reply