How to compare fields and return a success or error message

Good Day All,
I have a form with few fields. What i want is that when a field is entered, it should look up to another field and make sure both fields tallies. For instance, i have 3 fields, The first is
Total Number of People
Total Number of Boys
Total Number of Girls.
When you enter the total number of People, and also the total number of Boys and Girls, It should check the total number of People and also the sum of the total numbers of Boys and Girls and compare both, If correct it tells you it is ok else, it tells you to go check your data.

I have been able to do the following, You have if(${calculation}=${ind}) where calculation is the total sum of Boys and Girls, and ind is the total number of People. see attached image for better understanding. from my formula, it shows You have Ind=calculation. I want an error message prompt instead. Like "You have an error, Kindly check’

Thanks.error

Hi @caslas

Welcome back to the community. You may do this by making it a constraint as the example below.

Constaint.xlsx (9.3 KB)

Let me know if you need any help.
Best,
Yasser

1 Like

Thanks Yasser for the prompt response. Kindly note that the image i presented is just a demo. This is like a bunch of Demographic breakdown. ie,Age (1-5) , Number of Females, Age (10 -20), Age (30-40) etc. So constraining only the last field might bring confussion to the enumerator thereby forcing him or her to enter any number of her choice. Kindly re-look into this please.

I also came across an instance where you can use if statement to this . e.g if(${calculation}=${ind},true,else) Dont know if you can make sense out of this. Thanks.

Hi @caslas,

Backing up with what @Ysr3322 has advised maybe this discussed previously should help you solve your issue (for your later concerns):

Have a great day!

1 Like