I have also tried to add external user using the action and got a The specified user email@email.com could not be found.
Speculating only, but my guess is that sharing with external users with the action is probably not supported because in Office 365 sharing to external users works very differently to sharing with internal users.
Sharing with external users: why doesn’t the user show up in the SharePoint group immediately? – Hannah's SharePoint
thank you, I discussed with Nintex Support who confirmed from developers that it does not allow updating the permissions for External Users, however I am still investigating since the action does a CSOM call to the permission and CSOM is the equivalent of adding users manually to the permission, and manually works .
So I will test the CSOM independently from the workflow and report here.
I have some good news from developer working with me. I need to test and will post today.
sorry for the delay.
Here is the results, thanks to Nintex Support we have more clarity on what the action does:
- "The manual adding of permissions to an external user is actually a bit different than adding them to an internal user.
When you add permissions to an internal user you use the Microsoft.SharePoint.Client.RoleAssignment method to assign the permissions to the user. (...)
- When you add permissions to an external user Sharepoint uses the "WebSharingManager.UpdateWebSharingInformation" method to send the invite to the user " (Nintex support)
So we used a Nintex workflow action to call the REST API referred above BuildUserRoleAssgnments, but it didnt' work. So we went back to basics: trying manually and
- we now have this issue: adding an external user manually is returning an error (screenshot) and this seems to be a bug (have reported it to Microsoft Support)
So we need to pass this first manual step before continuing on the same but via REST.
More to come when I have an update. ..
gUPDATE] the error above only shows if the external is added to the item but was never shared to the entire site. If sharing the site first (eg. low level read) then there is no error.
Latest update; thanks to a developer in my team who did more research:
- The REST method to use in order add external users to a site is WebSharingManager.UpdateWebSharingInformation
- Unfortunately that method is only available to use via CSOM or JSOM.
Below is a blog post explaining why the method can't be used in REST, this is because it is expecting the parameter 'web' http://sharepointfieldnotes.blogspot.co.uk/2015/12/whats-new-in-sharepoint-2016-remote-api.html
Now we know that Nintex Workflow HTTP web service action can only make a REST call. Hence, not feasible from Workflow.
If anyone still needs a running solution, I have done this for a different project:
- create a page on SharePoint that includes your Javascript with CSOM code that adds the permission and runs as soon as the page loads or a click of a button.
- send an email to your user and request them to click a link on that email, which points to that page above.