Try to use this caml:
<FieldRef Name="Author" LookupId="True" />
this also might work, but first is preferable:
<FieldRef Name="Author" LookupId="True" />
Default lookup query uses the value instead of lookup Id
The typical query looks like
<FieldRef Name='RefCountry' />
To query by ID you have o setup LookupId='TRUE' attribute ...
It is more a caml question than an SPServices question.
Often one uses or and and operators to combine multiple values, which, like @rjcp3 said, can be messy.
There is another operator, less known, IN operator to choose a range of values (see the xml example below).
AFAIK there is no way to query SharePoint using SQL syntax. You have the following options:
Use the REST services (_vti_bin/ListData.svc)
Use the SharePoint web services
Use Search (Search has a SQL like syntax)
Some custom stuff that "exports" your data (using method 1-4) to a queryable SQL db
I think your best option are #2 - the REST/OData ...
If you use CAML to get list items (which is the fastest way of retrieving items), it is just enough to get ids of items to be able get the count:
var title = "<Eq><FieldRef Name='Title' /><Value>task 00001</Value></Eq>";
var q = "<Where>" + title + "</Where>";
var lst = web.Lists["Tasks"];
var query = ...
Use below code to get User name:
new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupValue;
For User ID:
new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupId;
Query in your case is a string, which means that you are using the SPList.GetItems(String) overload.
That method accept a list of fields to load, not a query. You should be using one of the overloads that accepts an actual SPQuery object.
Well I've found a solution, not very friendly but works, is based on this article
So basically the article says that you need to identify in the query how to include everything that has any value:
Text values consist of alphabetical characters (a..z) and numerical characters (0..9) and use a NOT at the beginning to exclude all the possible values...
I am going to cover a few things as I don't know exactly what you're doing here.
Create a calculated column to display the first letter of your field using formula - lets call this "FirstLetter"
Optionally, you can then use the Group By feature to show a collapsed/expanded list on [FirstLetter] - (see "The By Last Name View" here ...
Using SharePoint SQL directly is not supported by Microsoft, so for example the internal structure may change in an update, which may break your query and you will be left to fix it alone. Any updates to the database(s) and Microsoft will no longer provide support for your farm.
You can easily use SharePoint list data in SQL Server Reporting Services by ...
For SPQuery, use SPQuery.Folder to define the folder:
SPFolder folder = list.RootFolder.SubFolders["Folder 1"];
SPQuery query = new SPQuery();
query.Folder = folder;
Then, to define content type, you should include the following condition into your Where clause:
SPContentType contentType = list.ContentTypes["MyContentType"];
query.Query = "<Where>&...
You should use the Internal Name of the column, so its probably:
Easy way to check the internal name is from the url when you edit the column, and check the "Field=" part of the URL:
Replace %5F with underscore, or just ...
This is the limitation of REST API Filter that it cannot filter the Hyperlink fields.
So whats the workaround?
You can use CAML with REST to achieve what you want.
The CAML query will be like:
<View><Query><Where><Eq><FieldRef Name='URL'/><Value Type='URL'>url</Value></Eq></Where></Query></...
I found this to be the easiest way...
SELECT * FROM OPENROWSET ('Microsoft.ACE.OLEDB.12.0', 'WSS;IMEX=1; DATABASE=http://portal/sites/Team/;LIST=On Call;VIEW=;RetrieveIds=Yes;', 'SELECT * FROM LIST')
You'll need Microsoft Access Database Engine 2010 installed.
Here's a connection string reference.
It could be achieved by generating url for the asset on the client side and passing it to iframe for displaying asset content in Content Editor web part.
Clear ContentLink property
Put in Content property of the following code:
<iframe width="100%" id="assetContent" frameborder="0"></iframe>
Use the following code:
using(SPSite site = new SPSite("http://example/site/"))
using (SPWeb web = site.OpenWeb())
SPWebCollection webCollection = web.GetSubwebsForCurrentUser();
foreach (SPWeb web in webCollection)
if (web.Properties["SiteCategory"] == "SomeCategory1")
Use SP.ListItem.attachmentFiles to retrieve the collection of attachments that are associated with the list item.
How to retrieve list items with attachments using JSOM
var ctx = SP.ClientContext.get_current();
var web = ctx.get_web();
var list = web.get_lists().getByTitle(listTitle);
var items ...
You can retrieve it from the DataProvider object. Which is accessible from within your display template.
This returns an object which gives you the whole search query context, like: keyword, sorting, refinement, ...
In your case you want to extract the keyword, which you can retrieve from the property like this:
You should use <Contains> instead of <Eq> in your caml query:
var query = "<Query><Where><Contains><FieldRef Name='Category' /><Value Type='Text'>" + value + "</Value></Contains></Where><OrderBy><FieldRef Name='ID' Ascending='False' /></OrderBy></Query>";
It is possible to create a filter based on the current user. If you're defining a ReadItem method, then you can even do this with the wizard in SharePoint Designer. It's a little more tricky if you want to do the same thing with a ReadList method.
This blog post goes into great detail about the process of adding a UserContext filter to a ReadList method. ...
Follow these steps;
Place the standard CQWP onto the page.
Export the web part (in the web part pane, click edit -> Export and save the file to your PC)
Open the webpart you just exported in Notepad or some other plain
Find the property
Embed your CAML query into a CDATA section, the above query will now
look like this;
< ![CDATA[ < ...
Probably you're looking for the SPList.Fields.GetFieldByInternalName method. This will allow you to get the field by it's internal name, like this:
foreach (string fieldName in list.Views['Viewname'].ViewFields)
var field = list.Fields.GetFieldByInternalName(fieldName)
// do whatever you need with SPField object
Strategies for accomplishing this query while working around the constraints:
Shorten your query: Do you really need to update 5k records at the same time? Prefer to reduce updates to those actually being changed. If still too big for a successful update then you can break up the records and only update 1k at a time.
Change your connection method from ...
Your code is fine.
Url is property of the item and its not affected by your parameter in GetItems.
Test with a field (not property) that is not included in the parameter you pass in GetItems.
Normally it should throw an exception (ArgumentException).