Default Value of Field with variables
You can set the default value of a field as a variable. Use default value including $variable
with care.
Should not create a dependency cycle
If you are not sure whether the dependent
$variable
is available before the evaluation, do not use this feature. For example, you should not have$this.attr(…)
as the default value since when a record data is read from the backend, the value order is not guaranteed.Recommended best practice: only use
$global
and$currentStage
in the default value expression.
Status
Release Available | Status | Framework Name |
---|---|---|
2.10.5 | Current | MUI and Mint |
Code JSON
Copy
"fields": [{
"fieldName": "FirstName",
"fieldUi": {
"fieldType": "string", "label": "First Name",
"defaultValue": "$global.attr(userInfo).attr(firstName);" }
}, {
"fieldName": "LastName",
"fieldUi": {
"fieldType": "string", "label": "Last Name",
"defaultValue": "$global.attr(userInfo).attr(lastName);" }
}...]