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

Retrieving columns details

May 31, 2011 at 8:14 AM

Before using SPServices I was using $.ajax and call to owssvc.dll

Trying to get list items from a specific view I was getting something like this.

<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <s:Schema id="RowsetSchema">
- <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">
- <s:AttributeType name="ows_Organization" rs:name="Organization" rs:number="1">
<s:datatype dt:type="string" dt:maxLength="512" />
- <s:AttributeType name="ows_Unit" rs:name="Unit" rs:number="2">
<s:datatype dt:type="string" dt:maxLength="512" />
- <rs:data>
<z:row ows_Organization="XX" ows_Unit="YYYY" ows_Title="WWWW" ows_Site_x0020_URL="https://" ows_TechOps_x0020_Function="B" ows_TechOps_x0020_Collaboration_x002="T" ows_ID="22" />
So I had my z:row AND the RowsetSchema, means list of columns and attributes.
By using SPService and the GetListItems service I only get the z:rows
Which service should a use to retrieve the columns ?
May 31, 2011 at 8:40 AM

I use the "GetList" webservice to get information about the list itself. I am not sure if this will get you the same information, but I have found it quite useful!

May 31, 2011 at 12:16 PM

Dan's right: you can get the information about the list using GetList. Generally speaking, you should know what you are trying to retreive and how to use it. If you're just grabbing whatever's in the list and trying to build generalized handling, then I'm curious (as I was in your other thread) what you are trying to accomplish.

BTW, knowing what your columns are means that you can make far more efficient calls to GetListItems by specifying only the columns you need in the CAMLViewFields.