I have a SharePoint list with a Nintex workflow which tests a number of conditions. I want to test whether the new item or the edited item is a duplication of a previous entry. I have created the following Query list action using a collection which lists all the entries based on Salary ID, Full Name and Webinar Name. I can see them listed when it runs but am not sure how to progress from here. If the item is a duplicate, I want it to have the status of wait list so that the administrator can accept or reject the item. I know that I need a For Each with a Target and an index etc but am not sure how to test whether one equals the other items:
Not sure where to go from here.
Solved! Go to Solution.
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
comparison column B = item property: comparison column B
comparison column C = item property: comparison column C
comparison column D = item property: comparison column D
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?
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.
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.
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.