getPage()
Last updated 13/01/2026
Definition
The getPage() is a function on the Form object that returns a FormPage object
that represents any page on a form.
Examples
The following functions demonstrate how you can use the
getPage()
function on the Form
object.
Get a page and log it
This code gets the currently active form, retrieves the page with the Page ID of Details from that form, and logs the caption to the Five Inspector.
Get the Details page caption on the current form
const form = getCurrentForm();
const detailsPage = form.getPage("Details");
// Logs the form page caption for the Details page to the Five Inspector
five.log(detailsPage.getCaption());
Access a field's value on a page
This code reads the value in the FirstName field on the Details page and logs it to the Five Inspector.
Read the value in the FirstName field on the Details page
const form = getCurrentForm();
const detailsPage = form.getPage("Details");
// Access a field called FirstName on the Details page
const firstNameField = detailsPage.getField("FirstName").getValue();
five.log(value);
Refresh a page conditionally
This code checks the MeasurementType field on the current form and refreshes the Measurements page only if the value is Length.
Conditionally refreshes the Measurements page
const form = getCurrentForm();
// Get the Measurements page
const measurementsPage = form.getPage("Measurements");
// Check the MeasurementType field value
const measurementType = measurementsPage.getField("MeasurementType").getValue();
// Conditional logic using refresh()
if (measurementType === "Length") {
// Refresh the page to reflect latest data
measurementsPage.refresh();
}