labasmuse
Forms Fledgling

Validation of two "single line textbox" controls with numbers.

Jump to solution

Unfortunately, I cannot create a validation rule which triggers when the condition is true.

I would like to compare two "single line textbox" controls with numbers with the "greaterThanOrEqual"-function. I have created a rule which never triggers.

What I want is that the validation rule triggers if the "to" value is less than the "from" value.

I tried to compare the controls in many way, amongst others with the greater than operator. Control is invalid if "from" > "to".

However nothing works. Does anybody can give me a hint or have the solution. I would greatly appreciate it.

Kind regards

Andy

0 Kudos
Reply
15 Replies
emha
Automation Master
Automation Master

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

have you set both control's datatype to integer?

Reply
labasmuse
Forms Fledgling

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

Hi Marian,

thank you very much for your question. How can I set the control's datatype? With the connected list column? I cannot find a setting in the control with which I can set the datatype to Integer. Apparently in Nintex for Office 365 there is a way (http://help.nintex.com/en-US/O365/O365Forms/Form%20Controls/Single%20Line%20Textbox%20Control.htm) but cannot find such a setting possibility in Nintex for SharePoint 2013.

Reply
emha
Automation Master
Automation Master

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

ok, in that case datatype is taken over from list field (if you haven;t connected it to list filed, you would be allowed to configure it manually).

salary_from list field is of Number datatype as well?

can you clarify whether Basic_actual_salary_from reference in your rule is named control or list field?

as well, do you test in NEW or EDIT form?

Reply
labasmuse
Forms Fledgling

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

Ok. That means the daty type is numer because it is taken over from list field. Yes if I do not connect it to list field I could configure it to Integer.

Yes salary_from list field is of Number datatype as well.

Basic_actual_salary_from reference in my rule is a named control. I tested it in NEW and in EDIT form. Nowhere it works. However the column name and the control name have the same name. Maybe this causes problems. I will test it and give feedback.

In NEW form I cannot compare with a field. Therefore I tried to compare controls which are connected with list columns. But this seems not to work with the rules. 😞

I just see that there is a column validation in the column list field. Is this an alternative.? I will try and give feedback (see below).

Thank you for your help. Your  input makes me to reconsider the things... I greatly appreciate it.... 🙂

Reply
labasmuse
Forms Fledgling

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

Unfortunately nothing helps.

In the list field column validation I cannot refer to another column ("The formula cannot refer to another column....") and the Nintex rule never triggers. I would be happy if somebody could help me here....

Reply
emha
Automation Master
Automation Master

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

just to be sure before we dig into it deeper: validation doesn't fire when you submit form?

or do you expect it to happen when you change values?

Reply
labasmuse
Forms Fledgling

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

Yes validation does not fire when the form is submitted.

When I want to edit the form (change the values) and then submit the form. Validation does not fire either.

In short, the same problem for the NEW and EDIT form.

Reply
emha
Automation Master
Automation Master

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

ok.

have you resolved this?

However the column name and the control name have the same name. Maybe this causes problems. I will test it and give feedback.

let's try following

- add 4 calculated value controls on form and set up their formulas as follows (make sure you use named controls!)

- basic_salary_from

- basic_salary_to

- basic_salary_from+basic_salary_to

- greaterThenOrEqual(basic_salary_to,basic_salary_from)

type in some values into basic_salary_from and basic_salary_to controls and watch how calculations evaluate.

post results.

Reply
labasmuse
Forms Fledgling

Re: Validation of two "single line textbox" controls with numbers.

Jump to solution

Yes I have resolved that but this is not the cause (unfortunately):

Like you suggested:

4 calculated values were added. All the calculations behave like they should. This works. Therefore it seems to be weird that the validation rule is not triggered althout the condition is false.....

 

But the validation rules again fail, both in the rule which compares the controls 

- basic_salary_from

- basic_salary_to

  and the calculated control rule "greaterThanOrEqual(basic_salary_to,basic_salary_from)". In the calculated control rule the value is false!

{Self} is here the the calculated value control at the end "greaterThenOrEqual(basic_salary_to,basic_salary_from)"

Thank you very much for your help, Marian.

Reply