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.)

  • 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

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?

| 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: spservices.codeplex.com – Anita Boerboom Nov 10 '11 at 7:02
  • The Marc at spservices.codeplex.com is the same Marc from sharepoint.stackexchange.com/users/82/marc-d-anderson. 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.

| improve this answer | |

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.