You want a field that computes its value from other answers, such as the oil used between two readings. You need a Draft or a Pending revision and the option SAVE of the object structure MXAPIINSPFORM.
1. Give the fields an alias. A formula names a field by its alias, with a colon before it, such
as :OILSTART. Open the question and type the alias in Alias, or click Propose. An alias has
the capitals A to Z and the digits, a capital first, at most 25 characters, and it is unique in the
revision. The box names any other character and keeps what you typed until you change it or press
Escape. Manage would store an underscore, and the inspection app does not read it in a formula.
2. Add the calculated field. Add a question: Question below the form, or Enter at the end of a question’s text. In the line + response field:, open more… and choose Formula calculation.
3. Write the formula. In Formula, a colon opens the list of the fields a formula may name, with their label and type. A calculated, upload, signature or geolocation field is not offered. A field without an alias gets one when you pick it.

A colon in the formula box lists the fields a formula may name.
The box checks the formula while you type: an alias that no field has, the field’s own alias, a
function Manage does not allow, a decimal comma, and two values without an operator. Three
functions are a case of their own: Manage takes max, min and random, and the inspection app
computes no value from them, so the field stays empty on the device. The form check calls them an
error too. For the larger of two values write if(:A > :B, :A, :B). A moment later
Manage checks it too. A formula that Manage refuses is an error of the form check, in the tab Check
and in the outline. It waits, and it is saved when it is fixed. A decimal number takes a point, such
as 1.5. The link Functions and signs a formula may use under the box opens the editor’s Help at
the list of functions and signs.
Rename an alias and every formula that names it changes with it, as one step to undo. The preview computes the result from the answers you give there, as the inspection app does.
Test the formula under the box takes a value for each field the formula names: a number, a text,
a choice, a value of a domain, a meter reading, a date, a date and time, or a time. It shows the
result as the inspection app computes it, or why there is none. The values stay in the test, and the
preview keeps its own answers. Dates, times and now() count in your browser’s time zone, as the app
counts in the device’s.
Form scripts are automation scripts that the inspection app offers as actions. The tab Form lists the scripts that Manage offers, the ones whose name holds MXAPIINSPECTIONRES, as IBM’s Form settings dialog does. Each line shows the name, the description and Added or Not added. Type in the box above the list to find a script. On a Draft or a Pending revision, Add and Remove change the open revision, and Undo takes the change back. Other revisions show the list read-only. Without the option READ in the object structure MXAPIAUTOSCRIPT, the tab shows the form’s scripts by name and says why the list is missing. The editor copies the scripts into a revision, a copy and a file.
