Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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. –  PirateEric Nov 9 '11 at 13:01
add comment

2 Answers

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: 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
add comment

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
add comment

Your Answer

 
discard

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.