getValue()
Last updated 13/01/2026
Definition
The
It is recommended to use
Examples
The following functions demonstrate how you can use the
Read and log a form field value
This code reads and logs the value in the MeasurementType field on the current form to the Five Inspector.
const form = getCurrentForm();
// Get the value in the MeasurementType field
const measurementType = form.getValue("MeasurementType");
// Could output: "Length", "Weight", etc
five.log(measurementType);
Conditional behaviour
This code gets the current form, reads the value of the MeasurementType field, and checks whether it is Length. Based on the check, it logs a message in the UI indicating whether the value is Length or not.
const form = getCurrentForm();
const measurementType = form.getValue(MeasurementType);
if (measurementType === "Length") {
five.message("This measurement is a length");
}
Multiple field values together
This code gets the current form, reads two values from the form, checks that both values exist, calculates an area and logs the result to the Five Inspector.
const form = getCurrentForm();
const width = form.getValue("Width");
const height = form.getValue("Height");
if (width && height) {
const area = width * height;
five.log("Area:", area);
}