Which columns needs to be the same for it to be classed as a duplicate?
If this was me, I would query the current list where:
comparison column A = item property: comparison column A
AND
comparison column B = item property: comparison column B
AND
comparison column C = item property: comparison column C
AND
comparison column D = item property: comparison column D
AND
ID <> item property: ID
and store ID in a collection variable called vCollIDs. I would then use a collection operation to count the number of items in the collection. If the count is 0 then you know there is no duplicates and can proceed, else it means it's a duplicate and can change the status. Do this check with a Set a condition action.
Does that make sense?
Not sure but will give it a try this afternoon after I have finished conducting training. Thank you.
Hi Renee
I whipped up a quick example for you. I have a simple list with the following columns:
What I want is for a workflow to kick off on item creation or update to check if there is an item in the list with the same four columns (first name, last name, favourite child and second favourite child). First thing I do is create a workflow and change the starting settings:
This will mean that my workflow starts on item creation and update.
The first thing I want to do is compare my current item with all other items in the same list. I need to collect all the IDs for items that match (and are not my current item):
As you can see I have selected to return the ID field and place it in a collection variable I have named vCollDuplicateIDs:
The next thing I do is count the number of items in the collection. If the count is zero then we know there are no duplicates. To do this I have created a number variable called vNumCount:
And I use this in the collection operation action to get the count of vCollDuplicateIDs:
So I now know how many items are exactly the same as the current item in my list.
Now I want to do something different in case a duplicate is found, and if one isn't. So I use the set a condition action to analyse the value of vNumCount:
So I am checking does the number of duplicate items exceed zero (i.e. a duplicate was found). If it does, I update the status to Duplicate Identified and if it doesn't I update the status to Approved.
This is the final workflow:
I added a few items. You can see the first two are Approved as no duplicate was found, but the third one has been marked as Duplicate Identified:
Please let me know if you need any further assistance.
Thanks Cassy
I will give this a try - the other solution above did not work for me. I probably got it wrong!
Hi Cassey
I have created exactly what you created above before and it is not working. Is it because it is the Salary ID which is the identifying column rather than ID. ID is just a auto-increasing number that is assigned to the item in the list when it is added. The other difference is that I had does not equal 0 with the branches swapped around. No means that is a duplicate and Yes means it isn't.
Yahoo - I think I got it. Please ignore my earlier comment!
So it worked? And you have the solution you need?
Is anyone still managing this question? I created a workflow to delete dupes and it works....problem is it is deleting the NEW version and I need it to delete the old.
will it be the same configuration for site workflow?Thanks