1 - Create a SharePoint list with the accounts that you would like to include the SP group.
2 - Create a MS Flow workflow with the following steps:
A) Include a "Get Items" step to retrieve all the accounts from the SP list containing the accounts,
B) Include a "Send an HTTP request to SharePoint". From the Microsoft URL https://msdn.microsoft.com/en-us/library/office/dn531432.aspx we see that the javascript REST call to add a user to a group is the following:
executor.executeAsync({
url: “<app web url>/_api/SP.AppContextSite(@target)/web /sitegroups(7)/users ?@target='<host web url>'”,method: “POST”,
body: “{ ‘__metadata’: { ‘type’: ‘SP.User’ }, ‘LoginName’:’i:0#.w|domain\\user’ }”,
headers: {
“accept”: “application/json; odata=verbose”,
“content-type”: “application/json; odata=verbose”
},
success: successHandler,
error: errorHandler
});
No comments:
Post a Comment