Skip to main content

Interface

Use the Interface to trigger actions on the Facilio UI — navigate to pages, open forms, show notifications, and invoke widget-specific triggers.

navigateTo#

window.facilioApp.interface.navigateTo(options) — Navigate to a path within Facilio.

Params

KeyDescription
pathPath to navigate to
queryQuery parameters (optional)

Example

window.facilioApp.interface.navigateTo({ path: '/workorder/list', query: { view: 'active' } });

openSummary#

window.facilioApp.interface.openSummary(options) — Open a module record summary.

Params

KeyDescription
moduleFacilio module link name (e.g. workorder, alarm, asset)
idID of the record to open
newtabOpen in new tab (optional, default: false)

Example

window.facilioApp.interface.openSummary({ module: "workorder", id: 1112334 });

openListView#

window.facilioApp.interface.openListView(options) — Open a module list view with optional filters.

Params

KeyDescription
moduleFacilio module link name (e.g. workorder, alarm, asset)
viewLink name of the view (optional, default: all)
filtersJSON-stringified filter object. Same format as fetchAll filters (optional)
newtabOpen in new tab (optional, default: false)

Example

window.facilioApp.interface.openListView({  module: "alarm",  view: "active",  filters: JSON.stringify({ message: { operator: "contains", value: ["Too cold"] } }),});

getCurrentPage#

window.facilioApp.interface.getCurrentPage() — Get the current Facilio app page URL.

Web only

getCurrentPage is supported on web only. Not available on mobile.

Returns an object { url: string } — the URL of the page where the widget is embedded.

Example

if (!window.facilioApp.isMobile()) {  const { url } = window.facilioApp.interface.getCurrentPage();  console.log('Current page:', url);}

openForm#

window.facilioApp.interface.openForm(options) — Open a form.

Params

KeyDescription
moduleFacilio module link name
formDetailsObject with field values to prefill the form
newtabOpen in new tab (optional, default: false)

Example

window.facilioApp.interface.openForm({ module: "workorder", formDetails: { subject: "New work order", priority: { id: 955 } } });

openQRScanner#

window.facilioApp.interface.openQRScanner(options) — Open the QR code scanner.

Mobile only

openQRScanner is supported on mobile only.

Params

Options object passed through to the scanner (see widget documentation for supported options).

Example

window.facilioApp.interface.openQRScanner({ /* options */ });

fullscreen#

window.facilioApp.interface.fullscreen() — Enter fullscreen mode.

Web only

fullscreen is supported on web only.

Example

window.facilioApp.interface.fullscreen();

trigger#

window.facilioApp.interface.trigger(namespace, options) — Invoke widget-specific actions.

Supported trigger functions depend on the widget type. Each widget page documents the triggers available for that widget (e.g. form widgets support getValue, setValue, getFormData; Custom Button supports hide, resize, reloadData, setCloseEvent, clearCloseEvent; Topbar supports show, hide, showHeader, setUnseenCount, setIcon, setTitle, resize; Dialer supports open, close, maximize, minimize, resize, setBadge, setTitle, setTheme, startRinging, stopRinging; PDF Template supports updateTemplateSettings).

Params

KeyDescription
namespaceTrigger name (e.g. resize, getValue)
optionsOptions object for the trigger

Return values

Method / triggerReturns
trigger('getValue')Primitive fields (string, number, etc.): raw value (e.g. "Hourly maintenance"). Lookup/picklist: { id: number } (e.g. { id: 2627 }).
trigger('getFormData')Record-like object with field names and values (e.g. { subject, description, siteId, client, assignment, ... }). Same structure as a record.
trigger('getFormMeta')Form metadata object: { id, name, displayName, sections, fields, moduleId }.
trigger('getCurrentRecord')Direct record object (not wrapped).
navigateTo, openSummary, openListView, openForm, notify, openURL, fullscreenSome may return true/false; treat as void — no action needed based on return value.

Example

// Resize a dialog (Custom Button widget, web only — use size: XS|S|M|L|XL)window.facilioApp.interface.trigger('resize', { size: 'L' });
// Get form field value (Form Sidebar / Form Background)window.facilioApp.interface.trigger('getValue', { fieldName: 'subject' }).then(data => { /* ... */ });

See each widget page for the triggers supported by that widget.

notify#

window.facilioApp.interface.notify(options) — Show a notification on the Facilio interface.

Params

KeyDescription
titleNotification title
messageNotification message
typesuccess | warning | info | error
durationDuration in milliseconds (optional)
positiontop-right | top-left | bottom-right | bottom-left (optional)
link{ url, target } — optional link on the notification

Example

window.facilioApp.interface.notify({  title: 'Fire alarm detected',  message: 'Fire alarm detected at some location',  type: 'warning',  duration: 2000,  position: 'top-right',});
// With linkwindow.facilioApp.interface.notify({  title: 'Alert',  message: 'View details',  type: 'info',  link: { url: 'https://example.com', target: '_blank' },});

openURL#

window.facilioApp.interface.openURL(options) — Open a URL.

Params

Options object (e.g. url, target) passed through to the browser.

Example

window.facilioApp.interface.openURL({ url: 'https://example.com', target: '_blank' });

triggerDownload#

window.facilioApp.interface.triggerDownload(fileId, fileName) — Trigger a file download.

Params

KeyDescription
fileIdID of the file to download
fileNameOutput file name for the download

Example

window.facilioApp.interface.triggerDownload(55744684, 'report.pdf');