I have a field in Nintex form where I have to write a number. If this number exists in a field of a SharePoint list I need to show an error message and avoid to submit the form. Can someone help me with this?
I don't see a way in the control settings to validate that but you could certainly check the value in the other list in a workflow.
Thank you, but i need to check it in the form, not in the workflow. I use to do this with Infopath. Thank you
Hernan Vlachovsky -
Depending on how many lookup values you have, I would lean more towards building some validation rules into the form. Otherwise you will need to build a list lookup on the form, store the lookup data in a control (to be validated against) and then upon submit, run your validation rule. Keep in mind though, you will need to figure out a way to re-trigger your list lookup when the user goes back and makes their needed updates to submit. That is where you will run into the most pain
I would either build rules into the form specifically for it or, as Roger Brown suggested, add it to your workflow. Simply accept all forms, validate the data, and kick it back to the [Created By] if changes are needed.
Hope this helps!
Thank you Jesse, i thought to put all the items in the list in a control and then execute a rule that check if the all values Contains the number that the user input, but, how can i do to put in a control all values of a lookup list separated by ; or another character?
I can't do that in the workflow, i need it in the form.
Thanks a lot by your time
You can achieve this requirement via out of the box validation on the column.
Go to List Settings --> Under Columns section --> click on your column name --> select "Enforce unique values" (this creates a indexed column).
Now, go to your Nintex form, and try entering a duplicate value to that column, and save, error message is shown, "The list item could not be added or updated because duplicate values were found in the following field in the list [Column Name].
Thank you Krishna, but the destination of the form where i input the number is not the list where I have to check if this number exists. In my country, each person has a unique number that identify it as a worker. When a person was fired, i can't re hire to this person, then, i put it number in one list and check against this list if the person exists. This is the idea and is a specific solution for rural workers where is very common to re hire a workers.
Hi Hernan, thank you for the additional information on your requirement.
If you are maintaining a separate list with list of worker fired along with their numbers, you can follow below approach.
1. Handle "lost focus" event on the text box where entering the number
2. Write a function to handle this event --> in that function, query the other list (list of workers fired) and check that number exists in that list.
3. Show error message if that number exists, otherwise proceed.
Let me know if this approach is useful and need any additional help in implementation.
Thank you Krishna. I will try it.
see similar question answered here - How to connect Forms with JS Function returning an argument
to adapt it to your case, you just need to check whether length(lookup(...)) returns a value greater then zero, which means the number appears in th elist.
note however a hint there why these kind of validations are not reliable.
Retrieving data ...