Hi Everyone,
We are using app-id and secret for fetching List items and using OfficeDevPnP Nuget for it. We are the owner of SharePoint app and already give FullControl to collection. We are able to get the collection names, Field names of particular List but not ListItems. Sample code snipped for reference.
using OfficeDevPnP.Core;
using Microsoft.SharePoint.Client;
using (var clientContext = new AuthenticationManager().GetAppOnlyAuthenticatedContext(siteUrl, appId, appSecret))
{
CamlQuery caml = new CamlQuery();
caml.ViewXml = "5 ";
var requestItems = clientContext.Web.Lists.GetByTitle(listName).GetItems(caml);
clientContext.Load(requestItems);
clientContext.ExecuteQuery();
foreach (var item in requestItems) // requestItems count is 0, even its contain values.
{
Console.WriteLine(item["Title"]);
}
}
sudhanshu raiPosted Apr 29, 2020, 5:00 AM
sudhanshu raiPosted Apr 15, 2020, 2:58 AM
Arvind KushwahaPosted Apr 14, 2020, 11:19 PM
sudhanshu raiPosted Apr 14, 2020, 6:31 AM
Arvind KushwahaPosted Apr 13, 2020, 3:36 AM