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!