Introduction
What
...
are Hash Variable?
Panel |
---|
borderColor | green |
---|
borderWidth | 1 |
---|
titleBGColor | #ddffcc |
---|
borderStyle | solid |
---|
title | Definition |
---|
|
Hash Variables gives users greater flexibility and freedom in accessing useful information or relevant run-time values from the system. A hash variable is a special hash-escaped keyword that can be used in : - Form Builder
- Datalist Builder
- Userview Builder
- Supported plugin configuration properties
- Activity name in Workflow Designer
- External Form URL when mapping an activity to an external form
to return the value of some useful runtime variables from Joget components. |
...
Here's some examples:
Code Block |
---|
|
#date.{envVariable.dateFormat}#
#user.{variable.username}.firstName#
#form.tableChild.field1[{form.tableParent.childId}]# |
Form Hash Variable by Index
You can pass an index or primary key value to a Hash Variable for retrieval.
The syntax for the inner Hash Variable is wrapped by a pair of [square brackets] .
Code Block |
---|
language | java |
---|
title | Syntax / Format |
---|
|
#form.myTable.fieldId.[primaryKeyValue]# |
Here are some examples:
Code Block |
---|
|
#form.contact.name.[007]# |
Escaping the Resultant Hash Variable
The parsed/returned Hash Variable may cause incompatibility with the current context/environment such as syntax error in a script.Therefore Therefore, one may pass in additional parameters into the hash variable declared to escape certain characters.Before Before ending a hash variable with a hash "#", add a question mark character "?" followed by the required format. You may include multiple by defining semicolon ";" separated values.
...
Code Block |
---|
|
#envVariable.script?java#
#envVariable.script?nl2br;json#
#form.table.users?separator(, )# |
Panel |
---|
borderColor | purple |
---|
borderWidth | 1 |
---|
titleBGColor | #ddccff |
---|
borderStyle | solid |
---|
title | New Feature |
---|
|
nl2br and separator are new features in Joget v6. |
List Of Joget DX Hash Variables
Workflow Assignment Hash Variable
...