4

I have following code but I need to make sure that CurrentStatus=true is part of the code so I dont get the entire list. Is it possible?

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
            <listName>States</listName>
            <viewName></viewName>
            <query></query>
            <viewFields></viewFields>
            <rowLimit></rowLimit>
            <queryOptions><QueryOptions/></queryOptions>
            <webID></webID>
        </GetListItems>
    </soap:Body>
</soap:Envelope>
2
  • What type of field is CurrentStatus?
    – Erin L
    Dec 4, 2015 at 16:54
  • And I'd recommend downloading and installing CAML Designer, camldesigner.com Dec 4, 2015 at 16:59

2 Answers 2

2

This xml worked. It's a Boolean field.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
            <listName>State</listName>
            <viewName></viewName>
      <viewFields>  
        <ViewFields>  
          <FieldRef Name="Title" />   
          <FieldRef Name="Zip" />  
         </ViewFields>  
     </viewFields>  
<query>
<Query>
  <Where>
    <Eq>
      <FieldRef Name="CurrentStatus" />
      <Value Type="Boolean">1</Value>
    </Eq>
  </Where>
</Query>
</query>

            <viewFields></viewFields>
            <rowLimit></rowLimit>
            <queryOptions><QueryOptions/></queryOptions>
            <webID></webID>
        </GetListItems>
    </soap:Body>
</soap:Envelope>
0

I think you are trying to get some list data from a SharePoint list via the SOAP Web service interface.

Your query is missing the proper format / values here is an update that might work for you .

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <listName>States</listName> <viewName></viewName> <query> <Where> <Eq> <FieldRef Name='CurrentStatus' /> <Value Type='Boolean'>1</Value> </Eq> </Where> </query> <ViewFields> <FieldRef Name='Title' /> <FieldRef Name='CurrentStatus' /> </ViewFields> <rowLimit>100</rowLimit> <webID></webID> </GetListItems> </soap:Body> </soap:Envelope>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.