method for querying list data

learn more… | top users | synonyms

2
votes
2answers
2k views

“Person or Group” fields shows HTML instead of Display Name only

In Sharepoint Designer, I have a Data View Web Part which pulls data from a list. (In a normal situation) if I select a Person or Group field explicitly within the CAML for the Data Source, the ...
2
votes
3answers
1k views

CAML query filter for HTML BR tag

I am trying to create a CAML query that selects all list items that do not have just a BR tag in them. Whenever I create a query filter: <And> <Eq> <FieldRef Name="ThreadId" ...
2
votes
3answers
167 views

Need a way to identify files which have no checked in version

I wrote a script that traverses a collection, it's document libraries and gets a list of all files. I'm trying to find all the documents which do not have a checked in version and require a user to go ...
2
votes
1answer
245 views

CAML Query Custom Ordering

I have looked around a bit, but have not found any reference to this particular issue. Is it possible to specify a custom ordering in a CAML query? What I mean by this is, say I have a list with a ...
2
votes
1answer
635 views

CAML query join and sort by column of projected fields

I am trying to execute the following query: query.Query =<Where> <IsNotNull> <FieldRef Name='Product' /> </IsNotNull> </Where> <OrderBy> <FieldRef ...
2
votes
1answer
222 views

Can we query and fetch data from LIST between different subsites using CAML Query.?

Have LIST created under one site, can the same LIST be used to fetch data from other site using CAML Query.? eg: Consider a LIST "xxx" created under SitePages/AAA/Lists/ Can i access the LIST "xxx" ...
2
votes
1answer
779 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?
2
votes
1answer
589 views

CAML query speeds

So I have a list of about 75,000 items. I want to know if I perform a CAML Query that returns a couple of hundred items, is that going to be slow? (slow = 10+ secs, med = 5-9 secs, fast 0-4 secs) ...
2
votes
1answer
134 views

Help Return Lists With With No List Items

This is my first time posting and I'm looking for some help, so hopefully someone has an answer. I used the search, but didn't find anything. I created a custom list definition, and content type ...
2
votes
5answers
859 views

How to get the nth record using CAML from list

How to get the nth record (lets say 133rd) from the 1000 records (or unknown number of records) by using CAML query.
2
votes
2answers
358 views

How to Add a ListItem?

I am able to add an item to a list using the CAML below. Now I need to modify it to make sure I can add an attachment as well. What is the syntax to add an attachment? <?xml version="1.0" ...
2
votes
1answer
2k views

COM exception while querying document library

I have a need to get collection of SPLitsItem currently viewed to user. My solution is a ribbon button which calls custom application page in LAYOUTS via javascript in custom action. Application page ...
2
votes
1answer
1k views

CAML query Lookup column value

I have a simple list represent a hierarchy. The list columns: ID, Title, Parent, other columns. Where Parent is a lookup column back to the list itself and get information from the Title column. In a ...
2
votes
1answer
323 views

Duplicates of SPListItem when two quick requests occur

We got code, running on page load. That code asks certain SPList for its items by CamlQuery, which gets only items with specific (current) user in one field (field A) and with some value in other ...
2
votes
1answer
2k views

How to make a CAML Query union?

I have a webpart with several CAML Querys that look like this: SPSiteDataQuery qry = new SPSiteDataQuery(); qry.Lists = "<Lists ServerTemplate='104' Hidden='TRUE' />"; qry.Webs = "<Webs ...
2
votes
4answers
2k views

CAML query to find a value that does not begin with

I want to build a CAML query to search for all title fields that do NOT begin with a certain value: something like this: Where Title NOT BeginsWith 'myvalue'. How can i do that in my CAML query?
2
votes
2answers
3k views

What does the GetListItems query option IncludeMandatoryColumns do?

I found myself working with the Lists.GetListItems method fairly often. Unfortunately, I have never understood what the IncludeMandatoryColumns query option actually does. The documentation seems to ...
2
votes
1answer
3k views

ClientContext + camlQuery.ViewXml

I use SP Client and want to return ListItemCollection which will be filled with items from specific view which I choose. I get ViewQuery string by sending view index in viewcollection. Problem is in ...
2
votes
1answer
1k views

How can I use managed metadata field in the where clause of CAML?

How can I use managed metadata field in the where clause of CAML?
2
votes
2answers
552 views

Retrieve using CAML the currently published version of a document

I want retrieve the currently published version of a document from a document library using CAML. Can anyone tell me how I can achieve this? I need it to get the currently published version ...
2
votes
2answers
959 views

Caml query to get the next event from calendar

I'm facing a problem building a caml query for the calendar list. Here is my caml query SPQuery query = new SPQuery(); StringBuilder sb = new StringBuilder(); ...
2
votes
0answers
620 views

IsNull not working in CAML query for indexed fields

So for example I have field 'TestField' which is indexed. How can I caml for items where 'TestField' value is null? My example down here will fail and won't find what I am querying for. <Where> ...
2
votes
1answer
913 views

Search document from document library usin CAML query

I have document library which have folder and sub folder. the folder and sub folder level is more than 5. like as follow : Document Library |-> Folder-1 | -> Folder-1-1 | ...
2
votes
1answer
210 views

ContentTypes and Site Columns via Visual Studio / CAML Query Updates broken

I've been using CAML queries to do list updates for quite some time, but recently they've stopped working, and I have no idea why. Even an extremely simple query seems to be failing. For example the ...
2
votes
0answers
56 views

How to avoid loosing complex query in a view?

In a custom list definition bound to a custom content type, I attached the out of the box AssignedTo field. In the schema, I defined a view with this query : <Query> <OrderBy> ...
2
votes
0answers
217 views

How to (caml)query a list on metedata in the MetaInfo field

Is it possible to wite a CAML-query to filter documents with certain info in the MetaInfo field? The information is only stored as property in MetaInfo, not in a field of it's own. Context: I have a ...
1
vote
2answers
8k views

CAML Query on “Person” field type

I would like to query list and get items that were created by specific user, in my list I have the fild "User" of type Person I tried this but it didn't work: <Where> <Eq> ...
1
vote
4answers
12k views

CAML Query to retrieve announcement items in descending order based on ID # - Not Working

spQuery.Query = " <OrderBy> <FieldRef Name='ID' Descending='True'/> </OrderBy> <Where> <Eq> <FieldRef Name='Title' /> <Value ...
1
vote
3answers
6k views

Get field value from item in SPListItemCollection

I am confused with SPQuery. How can I use it to get listitem values. Let's say I have a list "Cinema" with 20 columns but i only want 4. Film ID Film Name Film Type Film Review How can i get all ...
1
vote
3answers
76 views

CAML query rertieve all items from a SharePoint list

I have a JavaScript piece of code that I use to retrieve list item from SharePoint by selected options from drop-down list. Depending the selection it would assign a value to a CAMLQuery variable. ...
1
vote
5answers
152 views

Translating a SQL query to CAML query

I am new to CAML query and as much as I have expected it to be simple like SQL I have found it quite frustrating to deal with. I have a simple query SQL query I am trying to translate into CAML but do ...
1
vote
2answers
2k views

Using the Now() function in CAML Query?

i am trying to get the 3 most upcoming events from the current date and time (The current data and time refers the time everytime my web part loads. Basically it is not a fixed date and picks up the ...
1
vote
2answers
1k views

Unable to return items under folder using CAML

I have a folder in the default "Images" library under my site, called Menu Icons: /PublishingImages/Menu Icons I want to retrieve only the images under this folder, and not all images under the root ...
1
vote
1answer
954 views

SP2010 JSOM: updating with CAML where clause

So I learned and have used the following to update a list item by ID using Javascript Client Object Model: function updateItem(passedID) { var ctx = new SP.ClientContext.get_current(); var myList = ...
1
vote
2answers
644 views

SharePoint 2010 - Find WebPart in WebApplication

I´m searching for an good way to find the ContentQuery WebPart in my WebApplication. My plan is to write a PowerShell script and create a url list. I found the following possible ways: SharePoint ...
1
vote
2answers
3k views

Caml Query for Order By List for web service call not ordering

I'm calling web service List.asmx using Jquery and getting results using this but its not ordering by DisplayOrder. This is the caml query. <soapenv:Envelope ...
1
vote
1answer
7k views

How to reterive list item values using CAML query?

I have one Date and time column and text colum. I need to retrieve list item value based on this both column using CAML query.. For ex: Columname---> Date value for date would be-6/1/2013 and ...
1
vote
2answers
135 views

How to write a caml query that filters by .pdf or folders?

How can I write a CAML query (for javascript ecma) that filters by only pdf documents or folders in sharepoint 2010? (this is for document libraries) Thanks.
1
vote
2answers
599 views

CAML Query for Values Not “In” (with sufficiently different title to let me post the question)

I have the following CAML query: <Where> <In> <FieldRef Name='ObjectID' /> <Values> <Value Type='Integer'>71</Value> <Value ...
1
vote
2answers
744 views

How to update a list item from web service using a where clause?

I have a scenario where I need to update a list item, but I don't know the internal ID of the list item - hence the following won't work for me: batchElement.InnerXml = "<Method ID='1' ...
1
vote
4answers
396 views

Filter list data using SPServices, CAML Query, and dropdown list

I'm trying to create a table using SPServices to fetch the data, and filter it using CAML Query and a drop down list. I would like to create three conditions: A. If no item from the list is selected, ...
1
vote
2answers
98 views

Why does my console output contain html tags for some field values?

I created a custom list which contains different field values e.g. Text Choice Note Currency Peoplepicker Using the following code I print the field values to console: List mealList = ...
1
vote
2answers
246 views

Error in my CAML Query? COMException (0x80004005)

I was wondering if anyone could verify or see an error in this CAML query: SPQuery query = new SPQuery(); query.Query = string.Format( ...
1
vote
2answers
2k views

Building CAML query with AND and Order by Clause

Hi I am trying to build a query using caml query builder - Below is the query (The query = get the values only whose address = 1234st AND LastName = Doe) - I believe the placement of AND operator is ...
1
vote
1answer
1k views

How to get caml query to return list items created by the current user?

I want a caml query that only retrieves items created by the user currently logged in. I tried this specifier = "<Eq><FieldRef Name='AssignedTo'/><Value ...
1
vote
3answers
2k views

how to query multiple lists using CAML

I have requestID, date column in 4 different lists. I want to build a webpart which shows user requests of different types therefore i need to query multiple lists with column requestID and date. How ...
1
vote
1answer
100 views

I need help with creating CAML

I have a document library MyLib and i need to find specified file in it . query.Query = @" <Where> <Eq> <FieldRef ...
1
vote
1answer
3k views

Adding IsNotNull and ViewFields in CAML Query

Trying to add IsNotNull parameter and ViewFields paramter but throwing an error. Am I inserting incorrectly or missing something to make sure this executes correctly? Seems like View is bring back all ...
1
vote
2answers
670 views

comparing and modifying items in a list

Ok, so adding to my previous question here - I want to get certain columns from a sharepoint list, then compare values of those columns to items in my own c# list and, if they're different, modify ...
1
vote
2answers
5k views

Create CAML SPQuery to order by ItemChildCount in descending order

How do I create a CAML query to display all items on the list order by ItemChildCount? Somewhat like this: Select * from table order by itemChildCount descending