Skip to main content
Version: 0.43

Application API

The application object is available in every Shesha script and gives access to the core services of your application. Use it to work with the current user, navigate between pages, read application settings, and perform CRUD operations on entities - all without writing custom API endpoints.

The Application API object shown in the script editor autocomplete.


Sub-Objects

The application object is divided into focused sub-objects. Each one covers a specific area of the application.

Sub-objectWhat it gives you
application.userCurrent user details and permission checks
application.navigatorNavigate between pages and forms, or get a form's URL
application.entitiesCreate, read, update, and delete entities by module
application.settingsRead and write application settings by module
application.utilsEvaluate template strings against data
application.formsPrepare form templates with dynamic replacements

application.forms

The forms sub-object lets you prepare dynamic form templates by substituting placeholders with runtime values.

Form type to use: Any form type - application is available everywhere standard script variables are.

Example - Prepare a form template with a dynamic replacement:

const result = await application.forms.prepareTemplateAsync('my-template-id', { clientName: data.name });