Add Permissions activity does not work - Help

I need help. My site is Sharepoint 2013. I am trying to create folders to a library and add contribute permissions to AD groups for the created folder. I made use of Create Folder activities, Get Children and Add permission. Everything work fine until the Add permission.which was faulted. The call stack is as per attached image - permissions1.

.
The details of the exception errors are as follows:
Type: Microsoft.SharePoint.Client.Server Exception
Value: RemoteException wrapping Microsoft.SharePoint.Client.ServerException: Group cannot be found.
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
at UiPathTeam.SharePoint.Utils.AddPermission(ClientContext ctx,
String groupName,
ListType listType,
RoleType permission,
String internalListName,
String folderPath,
Boolean queryInBatch)
at UiPathTeam.SharePoint.Activities.Permissions.AddPermission.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Exception ActivityInfo is:
Value: “Name”: “Add permission”,
“Id”: “1.10”,
“InstanceId”: “20”,
“TypeName”: “UiPathTeam.SharePoint.Activities.Permissions.AddPermission”

@Diana_Mincu can you please have a look at this, please?

Hello,

From what I can gather from the snap of your code, you might have set the folder names to the parameter corresponding to your Library name.

I am not sure how are you setting the rest of the parameters (I was only able to replicate the exact error you are receiving when I set a name that doesn’t exist for the GroupName parameter), however, please find attached a sample of using the Add Permission activity. You can use the Get Permission activity to check that the permission has been added to your folders
AddPermissionTesting.xaml (14.5 KB)
Please let me know if this is helpful!

Hi, Diana and Radu
Thanks for your xaml file. I have tried as suggested but still encounter error when Adding Permissions. The error message encountered when I tried to Add Permissions is as follows. Your help is much appreciated. I have uploaded the xaml file. Please help to see if there is any problem with my coding in the file that had caused the error. Thanks so much. UpdatePermissions.xaml (21.7 KB)

Exception Name: $exceptionDetails Type: Microsoft.SharePoiny.Client

RemoteException wrapping Microsoft.SharePoint.Client.ServerException: File Not Found.
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
at UiPathTeam.SharePoint.Utils.AddPermission(ClientContext ctx,
String groupName,
ListType listType,
RoleType permission,
String internalListName,
String folderPath,
Boolean queryInBatch)
at UiPathTeam.SharePoint.Activities.Permissions.AddPermission.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Exception Name: $exceptionActivityInfo ype UiPathTeam.SharePoint.Activities
Value=

“Name”: “Add permission”,
“Id”: “1.10”,
“InstanceId”: “42”,
“TypeName”: “UiPathTeam.SharePoint.Activities.Permissions.AddPermission”

Here is the xaml file. I have masked out sensitive info such as url, password etc.

Hi, @radu_bucur @Diana_Mincu
Thanks for your help rendered.

I used Add permissions for a library that contain folders and documents. I used Get children to get the folders and documents at the library level and then Add permissions to add permissions tofolders and documents. I encountered exception error - File cannot be found each time a pptx, pdf etc is encountered. Nevertheless, the permission got added. I do not encounter that error when permissions were added to folder. Would like to find out how to overcome that exception prompt. Please help!!

Bee

See below for exception error

Exception Name: $exceptionDetails Type: Microsoft.SharePoiny.Client

RemoteException wrapping Microsoft.SharePoint.Client.ServerException: File Not Found.
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
at UiPathTeam.SharePoint.Utils.AddPermission(ClientContext ctx,
String groupName,
ListType listType,
RoleType permission,
String internalListName,
String folderPath,
Boolean queryInBatch)
at UiPathTeam.SharePoint.Activities.Permissions.AddPermission.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Exception Name: $exceptionActivityInfo ype UiPathTeam.SharePoint.Activities
Value=

“Name”: “Add permission”,
“Id”: “1.10”,
“InstanceId”: “42”,
“TypeName”: “UiPathTeam.SharePoint.Activities.Permissions.AddPermission”

Hi @Bee1, unfortunately, adding permissions for individual Files and List Items is out of scope of the current package.
We only developed our activities to add permissions to Folders/Lists/Libraries (the documentation explains this)
Adding permissions to individual files is not ideal, so I would suggest you simply move the file in a folder with the specific permissions you need.

However, if you really need this feature, we can try our best to include it into a future version of the package. (if you could explain your usecase, that would be great)
Thanks!