I am passing this XML:

<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
        <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
                <Query xmlns=''>
                        <FieldRef Name='ows_Book_x0020_Number' />
                <ViewFields xmlns=''>
                    <FieldRef Name='Book_x0020_Number' />
                <QueryOptions xmlns='' />

All that I want are the distinct Book_x0020_Number values. Is there any way to do this?


I am calling the web service using jQuery. Any solution would have to be using jQuery or a feature of the web service itself.

  • As far as I know that is not possible in the XML alone. Is this from client side code or .Net code? I am just wondering what context it is being used in. Apr 21 '11 at 17:34
  • This is on the client side. I am using jQuery. Apr 21 '11 at 17:36

It is not possible to get distinct values directly from the GetListItems web service.

Since this is on the client side, you will need to get the full list of results and then get the distinct values using JavaScript + jQuery.

  • This is what I ended up doing. Apr 21 '11 at 18:12

Have you ever used SPServices? This will allow you to do these calls without writing the soap stuff yourself. I use it and if for example I am populating a dropdown, I will sort the return and iterate using the jQuery each option and then check to see if it is unique by testing it against the last option in the iteration.


Answer from StackOverflow


  • Unfortunately using a DataView is not an option. Apr 21 '11 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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