Is there a property that indicates a ListItem has been shared?
-
18-02-2021 - |
Question
I need to extract sharing information for list items, I'm currently doing this with ObjectSharingInformation.GetObjectSharingInformation
using the securableObject overload and passing the list item.
This works and I'm able to extract the info I need. However, I have to call this for every list item even though I know there are very few list items that have actually been shared. This results in many unnecessary requests and 429 Too many requests
responses. I'm handling these with incremental retries but would like to avoid them altogether.
So, is there a property or field value I can check on the list item I already have that would indicate that the item has been shared? I'd like to limit my calls to GetObjectSharingInformation
to only those items I know have actually been shared.
Solution
There is no specific property for if an item “have actually been shared”.
Consider using ObjectSharingInformation.SharingLinks
to retrieve only items with Sharing Links generated.
See a reference here for SharePoint Online: Generating Sharing Links Report And Removing Sharing Links Using SharePoint Online CSOM.