SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am passing this XML:

<soap:Envelope xmlns:soap='' xmlns:xsi='' xmlns:xsd=''>
        <GetListItems xmlns=''>
                <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.

share|improve this question
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. – spevilgenius Apr 21 '11 at 17:34
This is on the client side. I am using jQuery. – Abe Miessler Apr 21 '11 at 17:36
up vote 3 down vote accepted

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.

share|improve this answer
This is what I ended up doing. – Abe Miessler 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.

share|improve this answer
I haven't but it looks very cool. I'll give it a look – Abe Miessler Apr 21 '11 at 17:59

Answer from StackOverflow

share|improve this answer
Unfortunately using a DataView is not an option. – Abe Miessler Apr 21 '11 at 17:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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