Is it Possible to get distinct values from GetListItems?


  • I am Passing the XML for getting List item and binding to dropdown. Here i have shown the code..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
     <html xmlns="">
         <script src="" type="text/javascript"></script>
        <select id="input2" style="width:30%"><option>Any</option></select>
        <script type="text/javascript" language="javascript">
             $(document).ready(function () {
                 var soapEnv =
      "<soapenv:Envelope xmlns:soapenv=''> \
      <soapenv:Body> \
      <GetListItems xmlns=''> \
      <listName>as</listName> \
      <viewFields> \
      <ViewFields> \
      <FieldRef Name='Team_x0020_name'/> \
      </ViewFields> \
      </viewFields> \
      </GetListItems> \
      </soapenv:Body> \
                     url: "../_vti_bin/lists.asmx",
                     type: "POST",
                     dataType: "xml",
                     data: soapEnv,
                     complete: processResult,
                     contentType: "text/xml; charset=\"utf-8\""
           var select = $('#input2');
             function processResult(xData, status) {
                 $(xData.responseXML).find("z\\:row").each(function () {
                     select.append("<option>" + $(this).attr("ows_Team_x0020_name") + "</option>");    

    I need to get the distinct Values. Is it Possible or not from the above code?

    Please help.

    Thanks in advance.

    Tuesday, June 25, 2013 10:14 AM


All replies