f365, JavaScript runtime API overview
The author-facing JavaScript surface every form exposes. Read field values, hook events, call SharePoint, show dialogs, all from the form's code drawer.
The f365 object is the author-facing JavaScript surface every
SharePoint Forms365 form exposes. Authors write JavaScript in the designer's Code
drawer or per-field event slots; that JS receives f365 as a parameter:
A minimal form-level handler
(f365) => {
f365.events.onLoad(() => {
f365.field('SubmittedOn').value = new Date().toISOString();
});
};
The surface
| Property | Description |
|---|---|
f365.field(key) | Property-style field access, value, visible, enabled, required, etc. See the field reference. |
f365.control(id) | Non-field components, buttons, linkedLists, headers. See the control reference. |
f365.events.* | Form-level event bus, onLoad, onChange, onBeforeSave, onSave, onValidate. See the events reference. |
f365.data() | Bulk read or write across all fields. See the data reference. |
f365.user.* | Current user, group membership, person lookup by id/email/login. See the user reference. |
f365.format.* | Locale-aware formatting, date, currency, number, bytes. See the format reference. |
f365.ui.* | showAlert, showConfirm, showToast, showDialog, showProgress. See the ui reference. |
f365.nav.* | goTo, goBack, refresh, redirectAfterSave, closeForm. See the nav reference. |
f365.http.* | Typed get/post/put/delete with JSON parsing. See the http reference. |
f365.theme | Read-only CSS-custom-property snapshot. See the theme reference. |
f365.setTimeout / setInterval | Tracked timers, auto-cleared on form unmount. See the timers reference. |
f365.context | formId, listId, itemId, displayMode, currentUser, webUrl. See the context reference. |
f365.sp | Pre-bound PnPjs SPFI for arbitrary SharePoint calls. See the sp reference. |
f365.version | Runtime version constant. See the version reference. |
Type definitions
Ambient TypeScript definitions ship at docs/forms365-internal.d.ts in
the SharePoint Forms365 source tree. Drop the file into your project's
typings/ folder for IntelliSense in VS Code while authoring form JavaScript externally.
Related
Related articles
- f365.field, accessing form fields
Read and write field values, toggle visibility/enabled/required, listen for events, focus, blur, validate.
- f365.events, form-level event bus
Subscribe to form lifecycle events, onLoad, onChange, onBeforeSave, onSave, onSaveError, onValidate, onCancel, onModeChange, onPageChange.