If you need to perform calculations, assign values, or insert text into a field conditionally, Jotform provides a powerful feature called Update/Calculate Field conditional logic. This feature enables you to dynamically change form field values based on specific conditions.
To insert text or calculation into a field
- In the Form Builder, go to Settings at the top.
- Select Conditions on the left.
- Add a new Update/Calculate Field condition.
- Set DO to Calculate a field’s value.
A new section will appear where you can edit and build your formula.
Performing Calculations
The Update/Calculate Field conditional logic allows you to perform calculations conditionally. In the following example form, the conditional logic will output the product of two fields only if the first one is filled.
Here’s what the conditional logic looks like:
- IF: Multiplicand
- STATE: Is Filled
- DO: Calculate a field’s value — Multiplicand * Multiplier
- SUMMARY: Product
The field labels’ trailing [0-9] indicates that their values are numeric.
Inserting a Text
Aside from dynamic values, you can also assign or insert specific texts into a field conditionally using Update/Calculate Field by entering the value in your DO statement. In the following example form, the conditional logic will insert “Hello World” into the Output field when “Yes” is selected.
Here’s what the conditional logic looks like:
- IF: Insert “Hello World” into Output?
- STATE: Is Equal To
- VALUE: Yes
- DO: Calculate a field’s value — “Hello World”
- SUMMARY: Output
See also:
Send Comment:
10 Comments:
112 days ago
Hi, I am trying to add free text to the bottom of a multiple choice choice field. I followed the steps on the below and can't seem to replicate it? I also have a multiple choice option which has several questions, however within this I want to only allow the user the option the answer the either the first or second option not both. Is there a way to do this?
Thanks.
130 days ago
is it possible to get the cake cost by first dividing the quantity used to purchased quantity and then their quotient will be multiply to the purchase cost. and then purchased cost added to the Total other expenses to get the Capital. and then Capital multiply to the desired profit margin to get the product. and then Product added to the capital to get the suggested cake price. thank you sooo much, hope there's a wayyyyyy
223 days ago
I am calculating Seed Funding Requirement
Equation
Discretionary Income - Initial Investment = Funding Requirement
If the Funding Requirement is a Negative Number how do I make it show up on the form as positive?
302 days ago
I set up my calculations and go to preview the form and it isn't working... it is supposed to populate a text box with a name and populate the email based off the text box. Can you help?
327 days ago
How do I set up and early bird price and a higher price after the date of April 1?
More than a year ago
When do calculations happen?
For example, if I have 3 fields such as:
Cost of item
Number ordered
Total cost
Where I set the Total cost = Cost x Number,
But if the user then goes back to change the cost of the item, does it automatically recalculate the Total Cost?
More than a year ago
Quick Question how would you do discount off Percentage off?
More than a year ago
Hi
I am having a challenge directing my form to a thank you page after submitting. I have set a thank you page but the form goes straight to a calculation after submitting instof a thank you page that I have created and checked.
More than a year ago
Üdvözlet!
Vasúti kocsik számozásával kapcsolatban van egy kis problémám:
1 - Mivel a vasúti vagonok számozása egy 12 számjegyből álló számsor, aminek az utolsó szájegye az ellenörző szám, amivel a kocsiszám hellyeségét tudjuk igazolni.
Ezt a számot szeretném kiszámíttatni a programmal, de sajnos nem igazán tudom, hogyan kell.
2 - Az ellenörző számot a következő képpen kell kiszámolni: : a páratlan helyen álló számokat 2-vel szorozzák, a páros helyen állókat 1-gyel, és mindegyik szorzatban veszik a számjegyek összegét; majd az így kapott 11 számot összeadják, végül a 12. jegyet úgy választják meg, hogy az előbbi összeghez hozzáadva 10-zel osztható számot kapjanak. Pld, ha az 51553930016 tizenegy-jegyű számból indulunk ki: a 11 jegyű szám: 5 1 5 5 3 9 3 0 0 1 6 szorzó: 2 1 2 1 2 1 2 1 2 1 2 szorzat 1 0 1 1 0 5 6 9 6 0 0 1 1 2 a jegyek összege: 1 1 1 5 6 9 6 0 0 1 3 akkor az összeg: 1+1+1+5+6+9+6+0+0+1+3= 33, tehát az utolsó, 12. jegy a 7 lesz. A vasúti kocsi 12 jegyű száma: 515539300167.
Ezt hogyan tudnám kiszámíttani az űrlapon???
3 - Valamint: a telefonos alkalmazásban ezt hogyan tudom megjeleníttetni, úgy hogy a 12 számjegy elférjen???
Nagyon várom a választ!
További szépnapot!!
More than a year ago
I have a registration form for a camp where participants state their gender (male/female/undetermined). Total space in the camp is 80 spaces. I would like to stop registration for males or females (plus undetermined) at 40 each gender.
How can I do this using the calculate function? I tried, but it won't let me add to more than one counter.