Skip to main content
Nintex Community Menu Bar

How to validate duplicate entries in Picker control using button

  • April 29, 2020
  • 3 replies
  • 137 views

Forum|alt.badge.img+4

Hi

I have a requirement where picker  control is having email ids and on submit button ,I need to validate if there are duplicate entries for the same. I am using K2 five and looking if I can apply this validation in smartform.

I have tried for loop for all in picker control and compared using advanced condition where if email matches the string but not able get what I want

Please help

3 replies

  • April 29, 2020
Hi,
To understand: is it one picker with multiple values (email) and you need to check if there is any duplicate or it is multiple picker in the form?
Regards,
JJ

Forum|alt.badge.img+4
  • Author
  • April 29, 2020
it is one picker control with multiple values(email) and after adding all email ids ,on submit button i need to validate if any duplicate entries exist or not

Hello,
To check whether a picker contains duplicates or not,
you have to retrieve each element of the picker in a loop and search for it in the rest of the picker (the right part to the element).
Here are the configurations :
NB: Our picker contains names instead of emails
1) a)  Create an expression that concatene an element to picker (with the ";") (see the image ex_element)

b) Do the same for the whole picker because in the control, the last element of the picker has no ";"  at the end. (see the image ex-Picker)

2)  Create an expression that retrieves the size of the remaining string to the right of the searched element (here dl_Element is a data label that contains the result of section 1a)) (see the image ex_length)
3) Create an expression that retrieves the right sub-string in relation to the searched element .(see the image ex_right)
 
4) Create a button and when the button is clicked, making a loop that retrieves each element of the picker and making the search using the expression mentioned in 3). (see the image Loop)
- The first data transfer transfers the expression from part 1) to a data label (dl_element in our case).
- The second data transfer calls expression 3) in a data label (dl_Right)
- The rule  "verification"  contains a advanced condition that checks if the searched element is contained in the data label dl-right
(see the image advancedcondition)
I use K2 5.1. I added the package for the view I've been testing. You can install it and see how it works.
       Mireille From Flow Factory