Skip to main content

Global Object

The Global object is available when building backend API steps or writing frontend JavaScript within Applications. It holds metadata such as the current URL, the end-user accessing the application, or the browser's local storage. This metadata can be used to reference a user's groups in code or access the query parameters to dynamically pass data between applications. Use CMD/CTRL + k to pull up the Global object as well as other available variables in backend API steps or when writing JavaScript inside frontend components.

Application created and deployed times are presented in ISO 8601 string format. These can be modified into other formats such as with JavaScript's moment library:

{{moment(Global.deployedAt).format("MM/DD/YYYY HH:mm:ss")}}

Available metadata

Metadata type
Property
Description
Full Path
ApplicationcreatedAtThe application creation time in ISO 8601 string (UTC)Global.createdAt
ApplicationdeployedAtThe application deployment time in ISO 8601 string (UTC)Global.deployedAt
ApplicationmodeThe mode the application is in when the user views it EDIT, PREVIEW, or PUBLISHEDGlobal.mode
GroupsgroupsAn array of all the permissions groups in your Superblocks organizationGlobal.groups
ProfilesavailableReturns the full list of profiles defined in Profile Settings for the current mode of your App, Workflow, or Scheduled Job.
Ex: When viewing your deployed Application, this will only list the profiles set up for the Deployed mode
{{Global.profiles.available}}
ProfilesdefaultReturns the default profile for the current mode of your App, Workflow, or Scheduled Job{{Global.profiles.default}}
ProfilesselectedGives you the currently selected profile that will be used when executing APIs. This value will change when calling the Set Profile action{{Global.profiles.selected}}
URLfullpathA string representation of the full URL of the applicationGlobal.URL.fullpath
URLhostThe host component of the URL (e.g. app.superblocks.com)Global.URL.host
URLpathnameThe path component of the URL (e.g. /applications/123/pages/456)Global.URL.pathname
URLqueryParamsAn object containing key-value pairs representing the query parameters present in the URL.Global.URL.queryParams
URLstoreDEPRECATED: Use Frontend Variables instead.
An object containing key-value pairs representing the contents of the browser's local storage
Global.URL.store
UseremailThe email associated with the end-user viewing and using the applicationGlobal.user.email
UsergroupsAn array of all the groups of which the end-user viewing and using the application is a memberGlobal.user.groups
UseridThe id associated with the end-user viewing and using the applicationGlobal.user.id
UsernameThe name associated with the end-user viewing and using the application (see warning below)Global.user.name
UserusernameThe username associated with the end-user viewing and using the applicationGlobal.user.username
Versionscurrent.deployedAtThe application deployment time in ISO 8601 string (UTC)Global.versions.current.deployedAt
Versionscurrent.deployedBy.emailThe email of the user who deployed the current version of the applicationGlobal.versions.current.deployedBy.email
Versionscurrent.descriptionThe description of the currently deployed version of the applicationGlobal.versions.current.description
Versionscurrent.tagThe version tag of the currently deployed version of the applicationGlobal.versions.current.tag
info

When using {{Global.versions}}, you will not see any information populated until the Application has been deployed. That is, it is expected that the object appears empty when viewing the application in Edit and in Preview mode.

caution

Display names, which are viewed via {{Global.user.name}}, are only available for users who Login with Google or via SSO.