New answers tagged

0

You cannot use this kind of complex query is you don't have column 'Yellow' and its count. Assuming your ripeness column has value Yellow you can use below code. ClientContext ctx = new ClientContext("https://sharepoint.blah.com"); List list = ctx.Web.Lists.GetByTitle("Log"); ctx.Load(list); ctx.ExecuteQuery(); CamlQuery query = new CamlQuery(); query....


0

Considering that you have a column named 'Yellow' and typed number, and you wish to get all items have more then 3 in their 'Yellow ' column. ClientContext ctx = new ClientContext("https://sharepoint.blah.com"); List list = ctx.Web.Lists.GetByTitle("Log"); ctx.Load(list); ctx.ExecuteQuery(); CamlQuery query = new CamlQuery(); query.ViewXml = "<Where&...


1

Unfortunately I think the answer is no. The JSOM is great and yes like you say similar to the SP JSOM (same backend processquery, similar syntax etc etc), however the methods all simply map back to the old server side PSI API methods. That is the same for JSOM, CSOM and REST (REST being the unlucky one as not all methods have been mapped). The problem you ...


0

Try below. const options: ISPHttpClientOptions = { headers: {'odata-version':'3.0'}, body: `{'query': { '__metadata': {'type': 'SP.CamlQuery'}, 'ViewXml': '<View><Query><OrderBy><FieldRef Name="ID"" /></OrderBy></Query></View>' }}` }; return this.context.spHttpClient.post(...


1

Two Options! the function works properly but uses some strange string sorting on decimal values the function is not running at all, because the name in your FieldRef is propable wrong. I have something in mind that 'space' in Fieldnames ist masked as '_x0020_'. So maybe it works better with FieldRef Name='Order_x0020_By' [ inofficial option 3: I'm wrong ...


1

Even collListItem contains one item only, it's a collection https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj245102(v=office.15). So iterate the collection to get the first one. var collListItem; function QueryLastNewItem() { var clientContext = new SP.ClientContext(); var List = clientContext.get_web().get_lists()....


0

You should first convert string to Int using parseInt function. Below is your modified code. var collListItem; function QueryLastNewItem() { var clientContext = new SP.ClientContext(); var List = clientContext.get_web().get_lists().getByTitle('Tracker'); var query = new SP.CamlQuery(); query.set_viewXml("<View><RowLimit>1</...


0

I removed the step of getting the item's ID since I can pull what I need from that item once it's loaded without having the ID, I also changed the format of the query (if writing it as multi-line each line needs to be in quotes with a "+" on the end. I also inserted the query directly into query.set_viewXml() rather than creating a variable for it. Now it's ...


0

I tested with the code snippet and actually, the CAML Query have done groupby as expected: using (var clientContext = new ClientContext("https://zheguo.sharepoint.com/sites/dev")) { clientContext.Credentials = new SharePointOnlineCredentials(userName, securePassword); Web web = clientContext.Web; ...


Top 50 recent answers are included