System functions – reference¶
This page lists every system function nexxcite provides, with its meaning and the value it returns. System functions are used with the System Function expression, inserted into a text expression or picked from the group "System Functions" in the quick reference list of a setting.
1. System functions at a glance¶
| Group | Functions |
|---|---|
| Ids and time | NewGuid, ServerDateTimeLocal, ServerDateTimeUtc |
| Current user | CurrentUserId, CurrentUserRecId, CurrentUserName, CurrentUserEmail, CurrentUserDefaultGroupId, CurrentUserDefaultGroupName, CurrentUserGroupRecIds, CurrentUserApiAccessToken, CurrentUserRoleIds, CurrentUserRoleNames |
| Current session and request | CurrentCulture, CurrentTimeZone, CurrentTimeZoneOffset, CurrentUrl, CurrentHttpHeaders |
| Current record | EntitySetIsNew, EntitySetHasPendingChanges, EntitySetRecId, EntitySetTypeDefId, EntitySetTitle, EntitySetPluralName, EntitySetEntityDisplayName, EntitySetJson |
| Control, form, dashboard | AssociatedFieldValue, AssociatedFieldRequired, AssociatedControlDisabled, AssociatedValidValue, AssociatedValidValueLabel, AssociatedModalId, AssociatedFormDefId, AssociatedDashboardDefId |
| Server | GetSystemTempFolderPath, GetSystemTempFileName |
| Other | LoremIpsum |
A function name that does not exist returns an empty value.
2. Ids and time¶
| Function | Returns |
|---|---|
NewGuid |
A new, unique id. Every evaluation returns a different id. |
ServerDateTimeLocal |
The current date and time in the time zone of the application server |
ServerDateTimeUtc |
The current date and time in UTC |
Note that ServerDateTimeLocal is the time of the server, not of the user's browser.
3. Current user¶
| Function | Returns | Without a signed-in user |
|---|---|---|
CurrentUserId |
The id of the signed-in user (the user under Admin Studio → Access → Users) | empty |
CurrentUserRecId |
The id of the user's profile record – the record of the user in the user profile entity. Use this one to compare with fields that link to users. | empty |
CurrentUserName |
The display name of the user | empty |
CurrentUserEmail |
The e-mail address of the user | empty |
CurrentUserDefaultGroupId |
The id of the record of the user's default group | empty |
CurrentUserDefaultGroupName |
The name of the user's default group | empty |
CurrentUserGroupRecIds |
The ids of the records of all groups the user is a member of, as a JSON array | [] |
CurrentUserApiAccessToken |
A new access token for the REST API, issued for the signed-in user (see below) | empty |
CurrentUserRoleIds |
The ids of the user's roles, as a JSON array | – |
CurrentUserRoleNames |
The names of the user's roles, as a JSON array | – |
To check a single role, the rule CurrentUserHasRole of a Modify Value
expression is often simpler than searching the JSON array.
Access token for the REST API¶
CurrentUserApiAccessToken issues a token with exactly the permissions of the signed-in user, for
example to call the nexxcite REST API from an HTTP request command. Every evaluation issues a new
token and registers an API session for it. Use it only in something that runs on purpose – an
action – and never in a caption, grid column or other place that is evaluated over and over. The
value is empty when no token can be issued (nobody signed in, user locked, no signing key
configured). See API access and credentials.
4. Current session and request¶
| Function | Returns |
|---|---|
CurrentCulture |
The language and region the user chose for the session, for example de-DE |
CurrentUrl |
The full address of the current request. Empty outside a request (for example in background processing). |
CurrentHttpHeaders |
The HTTP headers of the current request as a JSON array of objects with name and values. Empty outside a request. |
CurrentTimeZone |
The time zone of the user's browser, as an IANA time zone id, for example Europe/Berlin |
CurrentTimeZoneOffset |
The current offset of that time zone from UTC, for example +02:00 or -05:00 |
CurrentTimeZoneOffset includes daylight saving time: for Europe/Berlin it returns +01:00 in
winter and +02:00 in summer.
The browser reports its time zone when the application is opened. Where there is no browser –
background processing such as a scheduled action, a call of the REST API – or the browser reports a
time zone the application server does not know, both functions return the time zone of the
application server, the same one ServerDateTimeLocal uses.
CurrentTimeZone can be passed directly to the rule ConvertTimeZone of a
Modify Value expression, for example to show a time stored in UTC in the user's
local time.
5. Current record¶
These functions describe the record the expression is evaluated for. Without a current record they
return an empty value or false.
| Function | Returns |
|---|---|
EntitySetIsNew |
true if the record has not been saved yet |
EntitySetHasPendingChanges |
true if the record has changes that have not been saved yet |
EntitySetRecId |
The id of the record |
EntitySetTypeDefId |
The id of the record's entity |
EntitySetTitle |
The title of the record, computed with the title expression of its entity. Empty if the entity has no title expression. |
EntitySetPluralName |
The plural name of the record's entity |
EntitySetEntityDisplayName |
The display name of the record's entity |
EntitySetJson |
The record as JSON: the entity, the record id, whether it is new or has changes, its field values (by storage name) and the related records that are currently loaded, each with their field values |
EntitySetJson contains only those relationships that happen to be loaded at the moment of
evaluation. It is not a complete export of everything related to the record.
6. Control, form and dashboard¶
These functions only have a value where nexxcite provides it – typically in an expression that belongs to a form control. Elsewhere they return an empty value.
| Function | Returns |
|---|---|
AssociatedFieldValue |
The value of the field the control shows |
AssociatedFieldRequired |
Whether the field of the control is required |
AssociatedControlDisabled |
Whether the control is disabled |
AssociatedValidValue |
Only in the expression that sorts the valid values of an input block: the valid value being sorted |
AssociatedValidValueLabel |
Only there as well: the text the valid value is shown with |
AssociatedModalId |
The id of the dialog the form is shown in |
AssociatedFormDefId |
The id of the form |
AssociatedDashboardDefId |
The id of the dashboard |
7. Server¶
| Function | Returns |
|---|---|
GetSystemTempFolderPath |
The path of the temporary folder of the application server |
GetSystemTempFileName |
The path of a new temporary file on the application server. The file is created (empty) by every evaluation. |
Both are meant for actions that write or read files on the server, for example together with the File Contents expression.
8. Other¶
| Function | Returns |
|---|---|
LoremIpsum |
A placeholder paragraph of about 70 words, starting with "Lorem ipsum dolor sit amet" |
LoremIpsum always returns the same text. It is meant for layouts and tests – for example to see
how a label or a card looks with a long text.