Workflow Hero

Change error message for Unique value validation

Is there a way to display an error message to the users to indicate that the submitted item is not unique?

I've a form that has two values inserted : Field A, FieldB. and another calciulated value that gets compiled in runtime to concatenate (FieldA)+ (FieldB). The calculated field is connected to a list item field whose properties is set to be unique field. So the form shouldn't submit the item if it found an existing item with the same value (FieldA)(FieldB) already exists. 

Now my problem is two things: 

1) the generic message that gets displayed by sharepoint when trying to submit a unique item is "Something went wrong, please try again".

2) It goes back to the original form but it clears the value of one of the fields (Sql request)

I want to be able to display a customized message and somehow show the previously selected value from the sql request only when sharepoint fails to submit due to the unique value validation. Note that: I'm able to keep the value that was previously selected from the sql request on a calculated column but I only want to show it when the form fails to submit...


0 Kudos
1 Reply
Automation Master
Automation Master

Re: Change error message for Unique value validation

you can create a validation rule based on lookup() function checking calculated value control value against concatenated list list field value like


it will not avoid to submit duplicate value to sharepoint absolutelly (if more users will be about to filling form at about the same time) but it should capture most of the cases.

see an example of such a validation 

0 Kudos