This project has moved. For the latest updates, please go here.

Read ListItem by passing view name

Oct 3, 2011 at 12:40 PM
Edited Oct 3, 2011 at 12:40 PM





I want to get my list items by view name.

How can I do that.

							        var count=1;
									   operation: "GetListItems",
									    async: true,
									    listName: "TopMenu",
										CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
									    completefunc: function (xData, Status) {
									        $(xData.responseXML).find("[nodeName='z:row']").each(function() {alert($(this).text());
									        var liHtml = "<li><a id=\"menu"+ count +"\" class=\"menu_trigger\" href=\"#\">" + $(this).attr("ows_Title") + "</a></li>";
									        count +=1;

Oct 3, 2011 at 11:35 PM

If you read over the documentation, it shows you how to set this type of query up.  Here's an excerpt from


A string that contains the GUID for the view surrounded by curly braces ({}), which determines the view to use for the default view attributes represented by the queryviewFields, and rowLimit parameters. If this parameter contains an empty string, the default view is used. If the view GUID is supplied, the value of the queryviewFields, or rowLimit parameter overrides the equivalent setting within the view. For example, if the view specified by the viewFieldsparameter has a row limit of 100 rows but the rowLimit parameter contains 1000, then 1,000 rows are returned in the response.

Oct 4, 2011 at 3:03 PM

Note that if you specify any other CAML parameters besides the ViewName, they will override the view settings.


Oct 18, 2012 at 11:39 AM

The following page explains how to extract the GUID for a View

It's the GUID that is the value for viewName