2

I am trying to add a user to a security group via a SharePoint 2013 workflow I am currently trying to do this using the Call HTTP web service action and I have 3 dictionary's built. All of this is done inside of an App Step.

Unfortunately I am getting an error back from the Response Content which I am having to email to myself, the error code reads:

{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified."}}}**

This is currently how my workflow looks: Call HTTP web service My call to the web service looks like the followingand I am currently using POST as the Request Type

https://site.sharepoint.com/sites/sitecollection/_api/web/sitegroups/getbyname('group name')/users

Inside of all of the dictionary's I have the following: Dictionary's

The LoginName string is set to be the user who created the current item in that list. This will be the login name of that current user.

I have had this issue for over 3 days and if anyone can help I would really appreciate it.

  • 1
    Shouldn't it be __metadata? Two underscores, not one. – wjervis Jun 17 '15 at 12:38
  • That is perfect it worked, I am not unfortunately getting a new error message: {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}} Thank you very much for your help!! – Adam13Hylo Jun 17 '15 at 13:31
  • 1
    Also a user wouldn't necessarily have permission to add themselves to a group, you would need some sort of permission elevation to do that – Eric Alexander Jun 17 '15 at 13:32
  • The workflow is running in App Step, this should elevate users permissions! – Adam13Hylo Jun 17 '15 at 13:33
  • Did you enable app permissions for workflow, and then give it manage permissions on the web? – wjervis Jun 17 '15 at 13:56
1

I would like suggest to use 3rd party solution Workflow Actions Pack to solve this task. It contains Add User to SharePoint Group workflow action.

Moreover it allows you dramatically extend functionality of SharePoint Designer, because it contains more than sixty additional workflow actions.

Please have a look at full list of workflow action in documentation section.

I have to mention that I one of developers of this product and I'm very proud for our product and our customer service.

0

enter image description here

  1. First Build: Accept and Content-Type
  2. Second Build: type
  3. Third Build: __metadata and LoginName
  • Using Third Build, I am not able to update "People/Group" and "Hyperlink" columns. Is it a bug or am i doing anything wrong? – George Feb 9 '18 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.