Expression フィールド
ブラウザーまたはサーバー上の JavaScript で計算される値です
プロパティ
expression フィールドで使用できるプロパティを、用途別にまとめています。
| 属性 | 説明 |
|---|---|
| basic | |
| name string / 必須 / 一意 | Field name
This attribute represents the name of the form field. |
| type string / 必須 | Field type
Other attributes might only be available for some field types. 値: expression |
| label string | Field label
A friendly name/label for the field. Note: if not set, the field name is used as label, but not when type is html. Since 6.0.3: Supports placeholders for dynamic labels (e.g., |
| placeholder string | In-field help value
Some form fields allow an in-field hint value. Since 6.0.3: Supports placeholders for dynamic hints (e.g., |
| help string | Field help message
Some fields require additional help information. This help message will be shown below the field. Since 6.0.3: Supports placeholders for dynamic help text (e.g., |
| data | |
| value any バージョン 4.0.17 で追加 | A fixed value (any type) for the expression
To manually populate an expression field (dictionary, array, number, boolean, string). |
| default many | Default value
The type of the value depends on the field type.
For |
| evalDefault boolean バージョン 4.0.5 で追加 | Evaluates default value
A default can be treated as javascript and can thus hold expressions like 既定値: false |
| expression string | A javascript expression.
By default this javascript is evaluated on the server side and limited to predefined functions (for security). However in combination with tip: use the alias |
| runLocal boolean | Run an expression locally
When running expressions, by default they are run remotely on the server. 既定値: false |
| refresh boolean|string | Allow a manual or auto refresh
A query or expression is by default run once (if it doesn’t contain any dependencies). 既定値: false |
| editable boolean | Makes an expression editable
An expression is by default readonly. 既定値: false |
| dbConfig string, array or object | A database connection
When you want to query data from a database, you will need the proper connection information. |
| query string | The query to select data from a database
This is typically a classic SELECT statement. Every |
| jq string バージョン 6.1.4 で追加 | Transform database query results with jq
Apply a jq expression to transform the result of a |
| interaction | |
| dependencyFn string バージョン 4.0.0 で追加 | The dependency logical function
This attribute represents the logical function between multiple dependencies. 選択肢:
|
| dependencies list / elements=object | Show/hide this field based on the values or other fields
Each dependency element is either an object with the following 2 attributes:
Or with the following 2 attributes:
Use in combination with attribute |
| output | |
| output boolean バージョン 6.2.0 で追加 | Include field value as extravar
Form fields are by default sent as extravars. 既定値: true |
| model string or array | Extravar modelling
By default, a field is sent as a root-extravar. |
| asCredential boolean | Send credential as extravar
Use the value of this field to search for a credential with the same name Since 4.0.16, you can use this in combination with the 既定値: false |
| security | |
| noLog boolean バージョン 2.2.3 で追加 | Disable backend logging
Disables logging in the backend, to hide passwords for example. 既定値: false |
| validation | |
| required boolean | Required field
Makes the field required. 既定値: false |
| minLength number | Field minimum length
Forces a string-field to be at least x long. Since 6.0.3: Supports placeholders for dynamic validation (e.g., |
| maxLength number | Field maximum length
Forces a string-field to be maximum x long. Since 6.0.3: Supports placeholders for dynamic validation (e.g., |
| regex object | A regular expression validation
Enforces a validation where the current field must match a regular expression. This field requires an object with 2 attributes:
|
| notIn object バージョン 2.2.4 で追加 | A list validation (can not be in list)
Enforces a validation where the current field can not be one of the values in a list (referencing another field). This field requires an object with 2 attributes:
|
| in object バージョン 2.2.4 で追加 | A list validation (must be in list)
Enforces a validation where the current field must be one of the values in a list (referencing another field). This field requires an object with 2 attributes:
|
| validIf object バージョン 2.2.4 で追加 | An field based validation (field must be true)
Enforces a validation where a referencing (expression) field must be true. This field requires an object with 2 attributes:
|
| validIfNot object バージョン 2.2.4 で追加 | An field based validation (field must be false)
Enforces a validation where a referencing (expression) field must be false. This field requires an object with 2 attributes:
|
| sameAs string | An field based validation (field must be same as other field)
Enables a validation where the value of this field must match the value of another field. Perfect for password entry, for example. |
| ignoreIncomplete boolean | Allow form submit on non-evaluated placeholders
When an expression-based field has placeholders, 既定値: false |
| visualization | |
| icon string | Field icon
Some formfields can hold a nice looking icon. The icon name is a free fontawesome 6 icon. You can find more information at www.fontawesome.com |
| group string | The field group name
With this attribute you can group fields together. |
| line string バージョン 4.0.3 で追加 | The field line name
With this attribute you can group fields in a single line together. |
| width string バージョン 4.0.3 で追加 | The field width
With this attribute you can set the width of a field. 選択肢:
|
| isHtml boolean | Renders text as html
If an expression value has html tags (for example ), it will render the value as such. The html is sanitized before it is rendered: 既定値: false |
| hide boolean | Hides an expression field
Set to 既定値: false |
例
expression フィールドの YAML での例です。
Expressions
YAML でのフィールド定義です。
since expressions are so diverse, there is a separate section on expressions with examples.