Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations
Retrieving all properties for a Sharepoint list

When we call the GetListItems or GetListItemChanges methods in Sharepoint's Lists Web Service, we pass an XmlNode parameter specifying which fields we want to return, in this format:

<ViewFields>
   <FieldRef Name="ows_ID"/>
</ViewFields>

Now, if we leave this field as null, we get a certain set of properties back - Name, Last Modified and so forth. Basic, commonly used properties. However, if we want to return ALL properties, and we don't want to explicitly state them, we need to pass an XmlNode with an empty-but-valid ViewFields XML:

XmlDocument doc = new XmlDocument();
XmlNode viewFields = doc.CreateElement("ViewFields");
XmlNode results = wsLists.GetListItemChanges(myListGuid, viewFields, since, null);

Now I get a whole handful of properties to read to my heart's delight.

All info via Karthikeyan's blog.

Published Sunday, June 03, 2007 10:33 PM by Avner Kashtan

Filed under: , , ,

Comments

# Links (6/4/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff@ Monday, June 04, 2007 9:17 PM

Pingback from  Links (6/4/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

Links (6/4/2007) « Steve Pietrek’s SharePoint Stuff

# re: Retrieving all properties for a Sharepoint list@ Wednesday, September 12, 2007 8:59 AM

Great post - why wasnt this in the MS docs.

RJT

# Retrieving all properties for a Sharepoint list@ Tuesday, November 27, 2007 5:34 PM

Pingback from  Retrieving all properties for a Sharepoint list

Retrieving all properties for a Sharepoint list

# re: Retrieving all properties for a Sharepoint list@ Thursday, January 03, 2008 4:18 AM

Hello,

Why would you want to leave that property null?

John

www.listpropertiesnow.com

John

Leave a Comment

(required) 
(required) 
(optional)
(required)