Crazy Question...

May 9, 2013 at 10:15 AM
I am looking to do what I will refer to as collision detection within a list. The goal here is to look at identical submissions based on several fields. Right now I am duplicating these fields in another list to do the collision detection but was wondering, instead of duplicating these items has anyone tried to use getlistitems on the same list? Another words, run the getlistitems within itself?

I wanted to ask this first before attempting to try it so I am not wasting my time, I see no reason why it won't work.

Regards,
Bob
Coordinator
May 9, 2013 at 12:49 PM
Hmm. Can you explain a bit more?

M.
May 9, 2013 at 1:49 PM
Edited May 9, 2013 at 2:43 PM
Marc,

Yes I can and thanks for the quick reply. I cannot get into too much detail as the project is very sensitive but here it is:

When an end user submits a new form there are certain fields within this form that I need to check to see if the identical data was entered into any prior submissions and if so provide what I am calling a "Collision", if this is detected I am going to redirect them to the prior submission to either update it or decline the new submission.

So, here is my question: Can I run getlistitems from this new form on the same list it belongs to or would I need to continue on the path I started with using a separate list with the duplicated fields to verify against? I am limited by space per site in my organization and prefer to keep everything at a minimum.

Bob
Coordinator
May 9, 2013 at 3:12 PM
You can nest calls however you need to. Each one os simply a request for some data. Yuo can query any list, including the current one.

Also keep in mind that UpdateListItems returns a copy of the item as you just wrote it.

M.
May 9, 2013 at 3:29 PM
Marc,

Thanks, as simple as this is it made my day! ;)

Bob