cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

So, I'm completely new to Nintex / SharePoint related stuff.

I would like to compare the user input in a Nintex Forms field to already existing items in the same list.

 

Maybe my example will make it somehow clearly.

 

In a contact list, I got the column 'company name'.

 

When a user tries to create a new contact, and puts the company name 'Smith' in the field, I'd like the field to check the contents of the column 'company name', wheter the company name already exists or not.

 

Note: The user should still be able to create the contact, it should just be a reminder / note that this company name is already in the list.

 

While browsing the net, I figured that i might have to use JavaScript (which I don't know...)

 

Any help or tips are appreciated.

 

Greetings

Labels: (2)
Tags (1)
Reply
8 Replies
Workflow Hero

Re: How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

This can be achieved without even touching JavaScript. Follow the steps below to implement the validation:

 

For my scenario, I have two lists - "Test" as my main list and "Customer" as the customer list. The scenario works the same way with a single list. Just adjust the formula accordingly.

 

Scenario

When I type a customer name in the Title field of my Test list form, the calculated value field is supposed to show me a message highlighting that the customer already exists.

 

Solution

  1. Open the form you want to customise in Nintex Forms designer
  2. Drop a Calculated value control onto the form. We will use it to display a message saying that the customer already exists in the list
    2014-08-07_11-16-00.png
  3. Double click the Calculated value field and put in the following formula:If(isNullOrEmpty(lookup("Customer","Title",Title,"Title")),"","Client already exists in list")

    The formula explained:
    Lookup([NAME OF CUSTOMER LIST],[COLUMN WITH CUSTOMER NAME],[CUSTOMER NAME FIELD IN CURRENT FORM],[COLUMN WITH CUSTOMER NAME]) - this gets the customer's name from the customer list if the customer exists. Otherwise it is blank
    isNullOrEmpty(Lookup()) - returns true if the lookup (formula above) performed is null or empty
    if(isNullOrEmpty(Lookup()),[MESSAGE WHEN CUSTOMER DOES NOT EXIST],[MESSAGE WHEN CUSTOMER EXISTS] - shows the first message (blank in my scenario) when the customer does not exist, otherwise show "Client already exists in list"
  4. Save and test

 

NOTE: the formula will only validate when you navigate out of the title field

 

Preview

 

Customer does not exist

2014-08-07_11-25-55.png

Customer does exist

2014-08-07_11-26-15.png

 

Hope that helps

Reply
Not applicable

Re: How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

Hello Patrick,

thank you so much for this answer! I was able to get it to work the way I want it to!

Is it possible to change the color of the text that is being written in the calculated value control?

I cant seem to find it in the settings.

Thanks once again!

0 Kudos
Reply
Workflow Hero

Re: How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

when you click on the control, you will notice the ribbon bar changing to the ribbon bar for the calculated value field. One of the things you can adjust there is the font style. That will do the trick for you.

Alternatively you can use CSS and apply a CSS class to the control, which you'd have to implement first under Form Settings.

0 Kudos
Reply
Not applicable

Re: How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

Maybe I should've had a closer look before asking.

I saw it a couple of seconds after asking this.

Still thanks for your time!

0 Kudos
Reply
Workflow Hero

Re: How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

Hi Patrick,

I tried to implement your solution, but it does not work.

I am trying to check if a person already exists in my list an the field is a people picker.

Any ideas?

Thanks in advance for your help.

Trish

0 Kudos
Reply
Workflow Hero

Re: How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

Hi Patrick,

One more thing, the function works in edit mode, but I would like it to work dynamically on the client side.

Thanks for your help.

Trish

0 Kudos
Reply
Workflow Hero

Re: How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

Hi Patrick,

I followed your steps , still not able to get the result. How can we debug this?

Thanks in advance

0 Kudos
Reply
Workflow Hero

Re: How can I compare the input in a Nintex Forms field to already existing items in the same list?

Jump to solution

Thanks Patrick , it fulfilled my requirement.

0 Kudos
Reply