How to share a SP list item to an external user, using Nintex (Office 365) workflow?

  • 27 March 2018
  • 4 replies
  • 9 views

Badge +3

I have the following list. I need to share the list items to the corresponding emails using workflow. 

 214027_pastedImage_1.png

I already set up the external sharing options for my site. and I can able to share this item manually. How can I atomize this action using Nintex workflow?


4 replies

Userlevel 7
Badge +17

Currently, SharePoint isn't actually sharing anything externally in O365. Azure AD is sharing to external users. So setting the permission on a list item is actually assigning an existing user in Azure AD to the item. The Sharing mechanism is actually handled by Azure AD. When you share via the UI, you are starting an event handled by Azure AD to create the guest user if it doesn't exist into the directory, then assign the SharePoint permission to the item or site. 

But, there is a not very well known client side api for sharing in Microsoft.SharePoint.Client.Sharing namespace () 

This could potentially be called via REST calls and not the permission assignment action. 

Userlevel 7
Badge +17

SharingResult result = ctx.Web.ShareDocument("https://contoso.sharepoint.com/docs/sample.doc", "someone@example.com", ExternalSharingDocumentOption.Edit,true, "Here's your important document");

This requires PnP components from PnP/Samples/Core.ExternalSharing at master · SharePoint/PnP · GitHub 

Badge +3

Thanks for your response. I also tried the same. But it is only for the document. Not for list item. I try to share the list item link via this document share method as following in Azure.

DocumentSharingManager.UpdateDocumentSharingInfo(ctx, fileUrl, userRoles, false, true, true, message, true, true);
But it is sharing all items on the list.
Userlevel 7
Badge +17

Can you use Microsoft.SharePoint.Client.Web.ShareObject instead?

Reply