developer csom
3 TopicsProgrammatically "Apply label to items in this list or library"
I need to be able to programmatically set the default ComplianceInfo for a document library which via the UI is Settings \ Apply label to items in this list or library (Apply Label). I can see CSOM methods for a list item via ListItemAllFields.ComplianceInfo \ SetComplianceTag but I need to act as if the user has chosen a default compliance Label for the Document Library. Any ideas on what property or methods to use would be highly appreciated or perhaps a work around (other than a headless browser) would be great please. I previously posted this athttps://social.technet.microsoft.com/Forums/en-US/a0617140-5197-4908-8799-9e6021c8d70b/programmatically-apply-label-to-items-in-this-list-or-library?forum=onlineservicessharepoint but didn't get a real response ... surely this is possible / has been addressed by the PnP. Seems like a basic requirement.Solved9.1KViews0likes5CommentsGetting the folder Role of SharePoint Online document libraries
Hi I'm Yuki. We have granted a unique Role to SharePoint Online document libraries. I'd like to use PowerShell to get a list of the Role of all the folders in the document library. and I want to output the member (or users) list that has Role for folders to CSV. but,I can not create PowerShell script,because I did not have any knowledge. I am sorry to trouble you, but would you teach me the way? Thank you.1KViews0likes2CommentsHow to read site page contents?
I want to read the contents of the sitepages(.aspx) present in the site. How can I achieve it? Here is my pseudo code _context.Load(pageItem, tmp => tmp.DisplayName, tmp => tmp.ContentType, tmp => tmp.File, tmp => tmp.File.Versions, tmp => tmp.FieldValuesAsText, tmp => tmp.Folder.ServerRelativeUrl, tmp => tmp.FieldValuesAsHtml); _context.ExecuteQuery(); foreach (var fd in pageItem.FieldValuesAsHtml.FieldValues) { Console.WriteLine(fd.Key+" "+ fd.Value);//not having any field values } LimitedWebPartManager lwpmShared = pageItem.File.GetLimitedWebPartManager(PersonalizationScope.Shared); LimitedWebPartManager lwpmUser = pageItem.File.GetLimitedWebPartManager(PersonalizationScope.User); WebPartDefinitionCollection webPartDefinitionCollectionShared = lwpmShared.WebParts; WebPartDefinitionCollection webPartDefinitionCollectionUser = lwpmUser.WebParts; _context.Load(webPartDefinitionCollectionShared, w => w.Include(wp => wp.WebPart, wp => wp.Id)); _context.Load(webPartDefinitionCollectionUser, w => w.Include(wp => wp.WebPart, wp => wp.Id)); _context.Load( pageItem.File); _context.Load( _context.Web, p => p.Url); _context.ExecuteQuery(); foreach (var wpse in webPartDefinitionCollectionShared)//Collection returns zero items {} foreach (var wps in webPartDefinitionCollectionUser)//Collection returns zero items { }855Views0likes0Comments