I have a Calendar list which is being used to store events. Usually, the details are sent to user's asking them to register. We were facing instances where users were registering to same event multiple times which is causing some issues.
I would like to know if there's a way to eliminate these duplicates submitted by the same user.
Appreciate your suggestions.
Solved! Go to Solution.
how do your users register, is it just a list item they create?
If they register by creating a list item, you can create a workflow that will start on item creation and check for a similar item in the list. If the workflow finds one, he could delete the "old" entry or even create the new entry, if this is what you actually want. Or you can use a site workflow which runs peridodically and deletes any duplicates found. You will just have to decide for some kind of primary key, which indicates if entries are duplicates (like the users last name).
Otherwise please clarify how you users are registrating for an event.
There's an OOTB SharePoint column setting that requires all values in a column are unique. As Philipp Lucas says, you need to decide which column is your primary key to identify when a duplicate has been created, or in the case of my suggestion, is attempted.
The setting is under the Column settings page and like I said prevents the input of duplicate values for that particular field.
Thank you for the reply. As mentioned, I have already exhausted the unique value option. In my scenario, if I go by column based approach, there is a high possibility that none of the users can register for an event. Hence, this was ruled out.
The other option is to use a combination of two values, Event Name + Username (single line of text). However, I can't enforce uniqueness on this.
So I would like to use workflow to get the required output
You can use jquery to validate duplicate registration before they submit the form. The idea is to query the calendar list and see if current user has already registered or not. If the registration already exists, display an on screen message and redirect user back to the calendar list itself (or to the registration form that the user has already completed.
How about forcing the users to make a conscious decision rather than programmatically managing it?
There's every chance that a user might miss-spell or know an event by a different name. So how about a change in tact? Use a query on the form so that when the user selects the date a section on the form displays the events taking place on that date and that would make them consciously check the event doesn't already exist.
Hello Chandra Shekhar,
As Philipp's idea you can achieve with following steps:
Create a list workflow and trigger it with item start
Workflow actions include: Query the same list with conditions on your requirement basis, for eg: userName is current item userName and event is cuurent item event. Save ID 's of result into a collection variable.
If you get more than 1 as a result of this Query, that means you have duplicates, so loop through the collection variable and delete all other items than the current item.
Thank you very much for the suggestions and I did follow your suggestions to create a list workflow that triggers when event creation. I'm putting up some screenshots to help others
Step 1: Query the list and store it in a collection variable. Though it's not a compulsory requirement but I found it useful it there's a filtering criteria
Step 2: Collection operation to count the ID's and store them in number variable
Step 3: Use Run if condition to check if there are more that one item with the same filter criteria from Step 1
Step 4: Use the Delete item action to remove the recently created duplicate
Hope this helps folks. Thank you