Describe a calculation in plain words and the E-form designer writes it for you, using the fields on your form. When you open it from a box, Apply puts the calculation in that box. Copy is always there if you would rather paste it somewhere yourself.


The feature is there for administrators when the site is licensed for AI and has a Configuration AI Limit above 0.


Where to find it

In the E-form designer, the Write a calculation with AI button sits beside the boxes that take a calculation:

  • Default Value in a field's settings.
  • Value in the Column Properties of a Table column whose Data Type is Label. Only a Label column calculates a value for each row.
  • The box that appears under a condition when the field chosen there is -Computed Values-: Field Required When, Field Enabled When, Field Disabled When, Field Visible When, Field Hidden When, Panel Toggled Closed When, a page's Hidden When, a Table's Row Enabled When, Row Disabled When, Row Visible When and Row Hidden When, the Show When of a tab or a Carousel slide, the Show When of a button option or the Execute When of a Multi-Action step, and a Timer's Run When.


You can also open it from the designer's toolbar: Advanced Actions > Write a Calculation with AI. Opened this way it is not tied to a field, so it adds an Inside table list. Leave it at Not in a table for an ordinary field, or pick a Table or Repeater when the calculation belongs inside one.


Writing the calculation

  1. Type what the calculation should do, the way you would explain it to a colleague. For example: quantity times unit price, less the discount. You can name fields by the label people see on the form or by their field name.
  2. Click Write Calculation, or press Ctrl+Enter.
  1. The calculation appears with Copy beside it and a short explanation underneath. The explanation also says when a setting has to change for the calculation to work.
  2. Click Apply to put the calculation in the box you opened it from. If that box already holds something, the window shows it under your description as Currently, and Apply replaces it. Like any other change in the designer, Ctrl+Z undoes it.


Opened from the toolbar, the window is not tied to a box, so it offers Copy only: copy the calculation and paste it where you need it.


To try a different wording, change the description and click Write Again.


Where the calculation is used

The designer already knows where the calculation is going, so the result is written in the right form for that box:

  • A field's Default Value gets an ordinary calculation that updates as the user fills in the form.
  • A Table column's Value gets a formula that runs on each row and uses that row's columns.
  • A field inside a Repeater gets a calculation that uses the other fields in the same entry.
  • A -Computed Values- condition gets a calculation whose result is compared with the condition's Value. The explanation says which operator and value to choose.
  • A Table's row condition gets a calculation that reads the same row, checked once for each row.


Checking the result

Before you see it, the calculation goes through the same check the designer runs on a field's own calculation. If that check finds a problem, a warning appears beside the calculation that reads There MAY be an issue with your computation. You can still apply or copy it and then correct it, or describe it again. Clicking the warning opens the E-form Calculations article.

If the form has no field the calculation needs, you get no calculation and the explanation says which field is missing.


TIPS

  1. Mention the fields by name or label and say what should happen when one is blank, for example: treat a blank discount as 0.
  2. A field that saves its value and holds a calculation needs Where to Get Initial/Latest Value set to Do Not Set Value / Compute Value, or a saved value replaces the calculation. The explanation reminds you when this applies.
  3. Save the form and use Open as Test to see the calculation work with real entries.


NOTE ON (AI): Writing a calculation with AI consumes tokens from the Builder pool and may incur extra fees. Check with your sales rep for more information. Please verify all results, as AI can make mistakes.