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:


  

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.