TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sudhanshu rai
NA
26
926
Not Get ListItems using SharePoint AppOnly Authentication
Apr 13 2020 12:30 AM
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 = "<View><Query><OrderBy><FieldRef Name='Created' Ascending='false' /></OrderBy></Query><RowLimit>5</RowLimit></View>";
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"]);
}
}
Reply
Answers (
5
)
How can i search the records based on Job Id and job title
html.Dropdownlist