Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [spquery]

SPQuery represents a query in a list view.

3
votes
1answer
73 views

Use SPQuery or REST API to join two lists

I am using SP 2013 and trying to joint two lists which are linked through a lookup field in the second list. I have tried several things like XML and SpSiteDataQuery but I am not familiar with using C#...
0
votes
0answers
12 views

Stop breaking my views!

I have a complex query that is using a filter on a Hyperlink field. These have to be done by creating the CAML query within the view's .aspx. SharePoint Designer => Lists => ListName => ViewName =>...
0
votes
0answers
37 views

SharePoint Online Multi List Query

I have 2 lists one called Client and on called CombinedNotes. In combinedNotes I have a lookup field to Clients. In the Client list I have users assigned to Clients. I need to create a query that will ...
0
votes
1answer
93 views

Get all list with same name in all sub site using SP query

I want to know how to get the lists from all SubSites with the same name using SP query. Thanks in advance.
1
vote
1answer
39 views

Error in SpQuery Datetime comparison using javascript

I am trying to take the count of records in a list within a date period. my query render like this var qry = "<Where><And><Geq><FieldRef Name='Requested_x0020_Date' /><...
2
votes
1answer
99 views

How are the results of a SPQuery sorted by default if OrderBy is not specified?

Take this simple SPQuery for example: SPQuery query = new SPQuery(); query.Query = "<Where><IsNotNull><FieldRef Name='Modified' /></IsNotNull></Where>"; query.RowLimit = ...
3
votes
1answer
36 views

Is it possible to do analytics query to get a list of search terms which did not give any search results and the time when it was searched?

I have a requirement where i have to build a full-trust solution create a report which shows most popular search results or, most frequently searched terms, further i have to show all the search terms ...
2
votes
1answer
313 views

Site Column & List Column Default values

I have to find the default values of Site columns and Library/list columns using PowerShell script. The site contains 8 to 10 libraries and the default values are different on each library hence I ...
0
votes
1answer
2k views

Using SPQuery in Powershell script

I am trying to pick the list of documents from certain folder in a document library. The folder contains huge set of documents. To optimize performance we have been asked to use SPQuery command in ...
1
vote
1answer
20 views

SPList query result different from SPList column display

I'm doing an SPQuery on the 'Modified By' (Editor) column of a SPList. While my SharePoint list displays names like #Doe, John, my query result for this column is 1;#Doe John. Where does the 1; come ...
1
vote
3answers
103 views

Query to display multiple months based on start/end date

I am looking for the query for a calculated value based on start and end dates to display month, multiple months spanned. For example.... Start date: 01/01/17 End date: 04/15/17 Calculated Value ...
0
votes
1answer
69 views

How to build a querypacket query to also return pdf files from SharePoint 2010

I am very new to using querypacket search queries, so please provide info useful to a complete beginner. I have query like below. The issue is that the existing query will return me all documents ...
0
votes
1answer
349 views

SPQuery Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index

I need to process a query like this <Where> <In> <FieldRef Name='AgentId' /> <Values> <Value Type='Text'>7727839</Value> ...
0
votes
1answer
63 views

can i access to builtin alert me definitions(to user defined alerts )by web service or database query

I don't want to customize alert me in SharePoint like this link But i want to get alerts properties like: I want to know that Alerts defined on which list or Doc-Lib? When they want (email or SMS?) (...
1
vote
1answer
119 views

Using query to get SPListItem from Sub folder

In my project, I need to get the item from SharePoint library which contain many folder level. However, I don't know how to write the query to get the file from particular folder and inside the sub ...
1
vote
1answer
1k views

GetItems Ignores ViewFields in Query

I have created the following method to fetch list items from a list. The method does return the right items, but no matter what I provide in the viewFields parameter, it always returns all fields. ...
2
votes
2answers
306 views

SP - CAML Query with three AND operators

I have a CAML Query with range between two dates and one text from DropDownList. Where I'm wrong in this query: myquery.Query = " <Where> <And> <FieldRef Name='...
2
votes
0answers
93 views

SPQuery returns wrong values

The Setup I have a list with 2 extra columns. Target Audience: Choice (Relevant/Everyone) Tags: Managed Metadata field (multiple) When I choose in the "Target Audience" field "Everyone", this item ...
2
votes
2answers
100 views

Query to a list doesn't work

I want to get the number of comments from the list "Comments" of a blog site. To do that, I have a query with this code: using (SPWeb oWebsite = oSiteCollection.OpenWeb(new Guid(WebId))) ...
0
votes
1answer
60 views

How get items in two subfolders?

I need get items from two different folders in a list on Sharepoint 2010, I already have the following code: SPList List = web.Lists["MyList"]; _titleFolderDispositivos = "firstfolder"; // ...
0
votes
0answers
40 views

List View Threshold error

I have a unique problem. I'm getting LVT error when running a script that displays every users' files that they have checked out across all libraries in a web scope in production. Here are a few ...
1
vote
1answer
941 views

what SPQuery.RowLimit return

In the below code what query.RowLimit = 3 will return. i guess if i got 10 values in query variable, then query.RowLimit = 3 will return first 3 values, Am i correct? or it will return somthing else? ...
0
votes
2answers
508 views

How to query large list and retrieve one field of all items?

Image a list with i.e. 20.000 list items. All items have the field ContainerId (indexed). I now want to retrieve all ContainerIds to do other stuff with those. SPQuery is limited to a maximum of 2000 ...
0
votes
1answer
357 views

GetListItemChangesSinceToken Folder Query option

I would like to get the list of folders and list items one level at a time, instead of querying all items under a SharePoint list. I plowed through SharePoint documentations and Stackoverflow and ...
0
votes
1answer
97 views

SharePoint 2010 Workflow Tasks SPQuery

I have a list item that gets triggered daily to send a workflow task. I created a web part to search based on different column values of the list item and the tasks. Currently: It goes through the ...
0
votes
1answer
875 views

How to get Single Record from Sharepoint Library when Items in library are more than List Threshold value?

I am trying to get single record from Large Sharepoint library using SPQuery/CamlQuery. The List View Threshold value and List View Threshold for auditors and administrators value is set to 2000. When ...
1
vote
2answers
2k views

DateRangesOverlap always returns all results

I have a problem with SPQuery and DataRangesOverlap. In my calendar there are three events that don't happen today. In SPQuery.query I want to exclude these events. Unfortunately all events are ...
0
votes
1answer
683 views

How Does Calender List DateRangesOverlap <Today/>,<Month/>,<Year/> and <Week/> exactly work?

I have a SharePoint calendar list which has some recurring events i wanted a report of about last two years. Following is the code that i have written SPQuery qryBookings = new SPQuery(); ...
0
votes
1answer
122 views

SPQUERY returns null value

Hi im using sp query to retrieve the items and using projectproperty.Title to get the web name dynamically ,but I got empty value in this data table. q.ViewFields = "<FieldRef Name='...
2
votes
0answers
179 views

Join SPQuery in list

List 1 "Posts", fields Title body #comments modified in this list #comments fields is look up from another list Comments: List 2 "Comments", fields title body comments post ...
0
votes
1answer
453 views

Performance : Caml query taking long time to load or something else

I have a CAML query which provides a result, if a SPfolder exists or not. When i do the item.Count it takes around 2sec for the line to execute . What is going wrong and taking long time to execute ...
0
votes
1answer
509 views

Powershell : Query Document Exclude Document Set

I have a Document Library contains multiple Document Sets, each of the Document Sets contains Files. Document Library ----> Document Set ----> Files My objective is to query all File Name only ...
0
votes
1answer
354 views

_ModerationStatus on list items is always draft from SPQuery

I am querying for list items in a timer job. The list has moderation enabled. It has various list items that have different approval status (e.g. scheduled, approved etc.). However the query always ...
1
vote
1answer
200 views

Best way of retrieving a collection of SPSite in code

I have a page where the user will be entering a data in a textbox, and click submit, and it brings all site collections that url contains this data in textbox, I am currenlty doing a Linq query to ...
3
votes
2answers
1k views

SPQuery - Which fields (ViewFields) are required to Update the list item?

In an SPQuery, which fields are required to update a list item? SPQuery query = new SPQuery(); query.Query = @" <OrderBy> <FieldRef Name='ID' Ascending='true' /> </...
2
votes
2answers
1k views

Sharepoint field not found exception

I am querying a SPList in sharepoint 2010 and populating the corresponding grid view: <asp:DataGrid runat="server" ID="gridView" AutoGenerateColumns="false" AlternatingRowStyle-BackColor="...
23
votes
3answers
33k views

CAML query limitation of values in IN operator

I have less than 5000 items in my library. I want to get 530 items by ids. So I am using following query. <Where> <In> <FieldRef Name="ID" /> <Values> <...
1
vote
1answer
102 views

Is there any benefit of using multiple lists to store documents versus a single library in large lists?

Background: We are migrating a legacy system into Sharepoint and will look to migrate around 300 000 documents. There is some metadata which inherently diferentiates the documents from eachother. ...
0
votes
1answer
963 views

Which of these is the best way to get a list item collection?

Performance-wise which of these methods is the best way to get a list item collection, and why? SPList list = web.getlist("listurl"); SPListItemCollection items = list.getItems(query); foreach(...
2
votes
2answers
9k views

Using SPQuery with SPList.GetItems(SPView)

I have a web-part which displays a variety of items in a spgridview based on a SPView. Additionally, I have implemented a search module which when a keyword is entered should get all items that has a ...
0
votes
1answer
300 views

CAML query to select users IDs

I'm trying to select users ids from custom tasks lists. All users are in one SP Group and I need to collect users Ids that doesn't have tasks. query.Query = string.Format("<And><Membership ...
0
votes
2answers
1k views

Filter List for DateTime using CAML against Calculated Field

In WSS 3.0, I have a list with a Calculated Field, 'MaxDate'. It gets the greater of two other dates, Notional Date and Override Date. I am trying (and failing) to build a CAML query to get all items ...
2
votes
1answer
2k views

SharePoint 2013 list items paging

I'm trying to make a webpart with list items paging. I followed this link http://www.directsharepoint.com/2011/03/step-by-step-guide-to-implement-paging.html and on SharePoint 2010 server it works ...
0
votes
1answer
219 views

How to list all alements by CAML to SPGridView

Is it possible to display the listitems retrieved from a CAML query in a SPGridView? How can I implement it?
0
votes
1answer
36 views

quick way to access splistitem in different list?

I have 2 lists: listA and listB listA has 2 fields: Title (text) PortalID (text) listB has 3 fields: Title (text), listAField(lookup to listA Title field) UserID (text) I have a UserID value and ...
3
votes
2answers
3k views

SPQuery works on libraries under the list view threshold, but not over

So I am building a webpart which enumerates all doclibs in the current web, grabbing all checked out files and listing them in a table, allowing a user to apply some required metadata and check in ...
1
vote
1answer
890 views

SPQuery on null lookupfield

I have a contact list with a company lookup field and I need to retrieve those without any company associated so I was thinking can I put it like this: <Query> <OrderBy> &...
3
votes
2answers
3k views

Caml Query - skip X first results

Let's assume I have list with 100 items. Is it possible to write CAML query to get 5 items, but skip 10 items from the beggining? Something like LIMIT and OFFSET in SQL?
3
votes
2answers
2k views

Get SPQuery TotalItems from query

I want to get the total number of items that match my Query, BUT also limit the results. So say I have 100 items in the list. 50 of the 100 items in the list match my query. I want to only get 10 of ...
1
vote
0answers
389 views

SPSiteDataQuery without subfolder items?

I'm trying to use the SPSiteDataQuery to return the contents of several lists across a site collection. The problem I'm having, though, is that while there are only a few documents at the root level ...