You are viewing limited content. For full access, please sign in.

Question

Question

How can I compare two fields between them?

asked on March 1, 2018

Hi all,

 

I'm trying to create a web form using Database.

The actually webform should to add a new model in the model's database.

Before to add the new model, I should to check if the model doesnt already exist in the database.

The difficulty is :

We can have 2 model's name from different brand.

Exemple :

id_model | model | fk_Brand

1 | example1 | 1

2 | example1 | 2

 

So I can't just check the model, I need to check the model AND the brand.

In my example, I need to check if id_marque = fk_marque

 

But idk how to compare 2 fields in the same form.

2 0

Answer

SELECTED ANSWER
replied on March 6, 2018

OK, I see what you mean. You will have to create a SingleLine field in your form (ie: ModelCheck, where you would have an IF statement to create a result, such as =IF(Field1=FIeld2,"Yes","No"), which will create a Yes, No result. Then in your Field Rules, you would show the Red Box when ModelCheck is Yes.

 

I typically create a section at the end of each form called Hidden, where I put these type of Fields that I need but do not want to see. I then have a Hide Rule for this section where I hide the Section which in turn hides all of the fields in it.

2 0

Replies

replied on March 4, 2018

Hi Olivier

I'm thinking you are using a Field rule to show the red box stating there is a duplicate. In that case a field rule can have more than one criteria to make that evaluation.

When making the field rule, add the 2 criteria and change the setting "When any" to "When all" which means that both criteria must be true for the rule to apply.

 

0 0
replied on March 6, 2018

Hi Steve,

 

thanks for your help.

The difficulty is not about the start (When any, When all, or Always) ; it's about the condition.

 

If I should resume, this is should be like that :

When any : Field A = Field B then : Show Message

How can I check if "Field A = Field B" ?

0 0
SELECTED ANSWER
replied on March 6, 2018

OK, I see what you mean. You will have to create a SingleLine field in your form (ie: ModelCheck, where you would have an IF statement to create a result, such as =IF(Field1=FIeld2,"Yes","No"), which will create a Yes, No result. Then in your Field Rules, you would show the Red Box when ModelCheck is Yes.

 

I typically create a section at the end of each form called Hidden, where I put these type of Fields that I need but do not want to see. I then have a Hide Rule for this section where I hide the Section which in turn hides all of the fields in it.

2 0
replied on January 6, 2023

Fields comparison is supported for field rules using new form designer in Forms 11 Update 3.

You can see other changes of Forms 11 Update 3 from  https://support.laserfiche.com/kb/1014413/list-of-changes-for-laserfiche-forms-11-update-3 and get Forms 11 Update 3 from Laserfiche 11 package  https://support.laserfiche.com/kb/1014263/software-versions-and-fixes-included-in-the-laserfiche-11-download-package

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.