Skip to main content

refresh()

Last updated 14/01/2026

Definition

The

is a function on the

Form
object that reloads or updates the form with the latest data. Optionally, you can refresh forms in the form hierarchy using the
includeParents
parameter

Examples

The following functions demonstrate how you can use the

refresh()
function on the
Form
object.

Refresh a specific page unconditionally

This code refreshes the Measurements page immediately, regardless of any conditions.

JavaScript
Refreshes the Measurements page
const form = getCurrentForm();
const measurementsPage = form.getPage("Measurements");

// Refresh the page to get the latest data
measurementsPage.refresh();

Conditional refresh based on a field value

This code only refreshes the Measurements page if the specific field, MeasurementType, matches the condition.

JavaScript
Refreshes the Measurements page if the MeasurementType is Length
const form = getCurrentForm();
const measurementsPage = form.getPage("Measurements");

// Check if the measurement type is Length
if (form.getValue("MeasurementType") === "Length") {
// Only refresh if it is Length
measurementsPage = refresh();
}

Refresh during a specific form event

This code refreshes the page every time the form is shown.

JavaScript
Refreshes the page when the form is shown
const form = getCurrentForm();
const measurementsPage = form.getPage("Measurements");

// Refresh when the form is shown
if (form.event() === "OnShow") {
measurementsPage.refresh();
}

Using the optional includeParents parameter

This code gets the current form, reads the value in the MeasurementType field, including checking any parent forms, and refreshes the Measurements page only if the type is Length, so that page updates to reflect the latest data.

JavaScript
Refresh including the optional includeParents parameter
const form = getCurrentForm();
const measurementsPage = form.getPage("Measurements");

// Read a field
const measurementType = measurementsPage.getField("MeasurementType").getValue();

if (measurementType === "Length") {
measurementsPage.refresh(true);
}