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

From what I know, we can use SPServices to query all the list, store it into a javascript array and then make comparison to find duplicates items (using Javascript) in a SharePoint 2007 List.

(I am looking for a command in SPServices that can immediately identify duplicates without having to store into a array and identify the duplicates items.)

share|improve this question
There's always the function SPRequireUnique you can use on forms to ensure unique values are entered into the list. – Eric Alexander Nov 9 '11 at 13:01
up vote 0 down vote accepted

I'm not aware of such an awesome SPServices function...

SPServices is querying a list to get values. Caml is used for querying and you can't specify not getting duplicates. The only way is to get it in an array and check clientside for duplicates.

What's the problem with storing the values in an array and check afterwards for duplicates?

share|improve this answer
Actually there is no problem for me to store the values in an array and check afterwards for duplicates. I was just wondering if anyone who is so technology-expert that he/she can make SPServices to immediately identify duplicates without having to store into an array, can probably share with the community. – Anderson Karu Nov 10 '11 at 1:06
You can always contact Marc: – Anita Boerboom Nov 10 '11 at 7:02
The Marc at is the same Marc from Wow. nice to know that. – Anderson Karu Nov 10 '11 at 8:57
Correct! Awesome guy! – Anita Boerboom Nov 14 '11 at 22:01
As Anita points out, there's nothing in CAML that allows you to not get duplicates. That means that a call to GetListItems will return the duplicates and you'll have to remove them yourself. Anything I built into SPServices would do the same thing. – Marc D Anderson Nov 15 '11 at 10:30

You didn't specify where this is going to be used. There is a function, SPRequireUnique that you can use on the New/Editforms to ensure unique values are submitted.

share|improve this answer

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.