Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

What are Hash Variables?

English

Hash

Variables provide users with the flexibility to access relevant runtime data from the system, making applications more adaptable and dynamic. Acting as placeholders, they enable the dynamic display of information from various sources within the application. By avoiding hardcoded values, hash variables promote customization and flexibility, enhancing

variables in Joget are placeholders used to dynamically display data within applications. They allow users to insert dynamic content without hardcoding values, which enhances flexibility and customization. Hash variables can fetch and display data from various sources such as forms, workflows, and the system itself. They promote customization and flexibility by avoiding hardcoded values, ultimately improving the user-friendliness of Joget applications

in Joget

.

A hash variable is a special hash-escaped keyword that can be used in :

...

Figure 2: Property Assistant - Nested Hash Variable

List Of Joget DX Hash Variables

Workflow Assignment Hash Variable

System-wide Hash Variable

Panel
borderColorpurple
bgColorwhite
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

This is a new feature in Joget DX 8.2.

The System Variables menu introduces system-wide Hash Variables, which allows users to create and define custom hash variables that can be used in Property Assistant. This means that system-wide hash variables can be used in any app as it is not tied to any specific app.

System-wide Hash Variables can be accessed in Property Assistant using the #sysVariable.KEY# hash variable, where KEY is defined in the System Variables settings page.
Image Added

List Of Joget DX Hash Variables

Workflow Assignment Hash Variable

NameDescription
Prefixassignment
Description

To get workflow activity information of the current assignment.

Attributes
  • #assignment.processId#
  • #assignment.processDefId#
  • #assignment.processDefIdWithoutVersion#
  • #assignment.processName#
  • #assignment.processVersion#
  • #assignment.processRequesterId#
  • #assignment.appId#
  • #assignment.activityId#
  • #assignment.activityName#
  • #assignment.activityDefId#
  • #assignment.assigneeId#
Scope of Use
  • Elements within and part of a Process.
    1. Activity Name.
    2. Form mapped as part of process activity mapping.
    3. Email Tool
NameDescription
Prefixassignment
Description

To get workflow activity information of the current assignment.

Attributes
  • #assignment.processId#
  • #assignment.processDefId#
  • #assignment.processDefIdWithoutVersion#
  • #assignment.processName#
  • #assignment.processVersion#
  • #assignment.processRequesterId#
  • #assignment.appId#
  • #assignment.activityId#
  • #assignment.activityName#
  • #assignment.activityDefId#
  • #assignment.assigneeId#
Scope of Use
  • Elements within and part of a Process.
    1. Activity Name.
    2. Form mapped as part of process activity mapping.
    3. Email Tool configuration as part of process tool mapping.
Sample Attributes

To display the assignee's name:

#user.{assignment.assigneeId}.firstName# #user.{assignment.assigneeId}.lastName#

...

NameDescription
PrefixuserviewKey
Description

Userview Key Hash Variable is used solely for the purpose of accessing the current UI key's value.

Typical use case for this hash variable are:-

  • Filtering a List based on UI Key.
  • Preloading certain form data field (e.g. subform) in a Form or Form part of a process flow based on UI Key.
Attributes
  • #userviewKey#
Scope of Use

Workflow Variable Hash Variable

...

NameDescription
Prefixbeanshell
DescriptionUsing App Variable to execute bean shell script. Passing parameter using URL query string syntax.
Attributes
  • #beanshell.APP_VARIABLE#

  • #beanshell.APP_VARIABLE[PARAMETERS_URL_QUERY_STRING]#

Scope of Use
  • All components within the App.
Sample Attributes

To execute a script stored in the "welcome" app variable with parameter "username" and "dept":

Code Block
languagejava
if (username != null && username.length == 1 && !username[0].isEmpty()) {
       return "Welcome " + username[0] + " (" + dept[0] + "),";
} else {
       return "";
}
Related Tutorials

...

NameDescription
PrefixuiListCount
Description

The uiListCount hash variable is primarily utilized to retrieve the Datalist or Inbox menu count value.

Attributes
  • #uiListCount.MENU_ID#
  • #uiListCount.UI_ID.MENU_ID#
Scope of Use
  • All components within the App except UI Permission.
Warning

uiListCount cannot be used inside UI permission. This is due to:
1. UI permission contains a uiListCount hash variable
2. uiListCount Hash requires UI to load to get the count
3. In order to load the UI design,  the UI permission will be called. It goes back to step 1.
(Will cause an infinite recursion that eventually returns a StackOverflow exception error :

 ERROR 15 May 2024 09:27:20 org.apache.jsp.WEB_002dINF.jsp.error500_jsp - Handler dispatch failed; nested exception is java.lang.StackOverflowError2org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.StackOverflowError
Caused by: java.lang.StackOverflowError



Sample Attributes

See examples below, based on the usage within the default CRM application:

  • #uiListCount.MENU_ID# where MENU_ID is the id of the menu in your Userview for Datalist or Inbox (Example usage: "#uiListCount.proposal_inbox_list#")
  • #uiListCount.UI_ID.MENU_ID# where UI_ID is the id of the Userview (Example usage: "#uiListCount.crm_userview_sales.proposal_inbox_list#")

Escape Format Hash Variable

Panel
borderColorpurple
bgColorwhite
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

This is a new feature in Joget DX 8.

  • UI_ID is the id of the Userview (Example usage: "#uiListCount.crm_userview_sales.proposal_inbox_list#")

Escape Format Hash Variable

Panel
borderColorpurple
bgColorwhite
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

This is a new feature in Joget DX 8.

NameDescription
Prefix?decimal(decimal_number)
Description

The escape format hash variable used to allow the formatting of decimal places. 

Info

This hash variable can be use on any variable that have decimal values. 

Attributes
  • #variable.variableName?decimal(decimal_number)#
  • #appVariable.keyName?decimal(decimal_number)#
  • #envVariable.keyName?decimal(decimal_number)#
Scope of Use
  • All components within the App.
Sample Attributes
  • #appVariable.double1?decimal(1)# (Example usage for 1 decimal places using app variable)
  • #appVariable.double2?decimal(2)# (Example usage for 2 decimal places using app variable)
  • #envVariable.double1?decimal(1)# (Example usage for 1 decimal places using environment variable)
  • #envVariable.double2?decimal(2)# (Example usage for 2 decimal places using environment variable)

Stats Hash Variable

NameDescription
Prefixstats
Description

Display various Joget system and app statistics.  

Attributes
  • #stats.transactionCount#
  • #stats.slowTrace#
  • #stats.errorCount#
  • #stats.runningProcess#
  • #stats.completedProcess#
  • #stats.responseTimesCheck#
  • #stats.memoryUsageCheck#
  • #stats.cpuUsageCheck#
  • #stats.dbConnectionsCheck#
  • #stats.errorRateCHeck#
  • #stats.nodeCount#
  • #stats.publishedAppCount#
  • #stats.unPublishedAppCount#
  • #stats.user.active#
  • #stats.user.inactive#
  • #stats.user.total#
  • #stats.appList#
  • #stats.app.total#
  • #stats.form.countPerApp#
  • #stats.form.total#
  • #stats.errorRateCheck#
  • #stats.list.countPerApp#
  • #stats.list.total#
  • #stats.UI.countPerApp#
  • #stats.UI.total#
  • #statsgroupList.#
  • #stats.group.count#
  • #stats.group.countPerGroup#
  • #stats.group.total#
Scope of Use
  • All components within the App.
Sample Attributes
  • #stats.group.count#: Displays the total group count.
NameDescription
Prefix?decimal(decimal_number)
Description

The escape format hash variable used to allow the formatting of decimal places. 

Info

This hash variable can be use on any variable that have decimal values. 

Attributes
  • #variable.variableName?decimal(decimal_number)#
  • #appVariable.keyName?decimal(decimal_number)#
  • #envVariable.keyName?decimal(decimal_number)#
Scope of Use
  • All components within the App.
Sample Attributes
  • #appVariable.double1?decimal(1)# (Example usage for 1 decimal places using app variable)
  • #appVariable.double2?decimal(2)# (Example usage for 2 decimal places using app variable)
  • #envVariable.double1?decimal(1)# (Example usage for 1 decimal places using environment variable)
  • #envVariable.double2?decimal(2)# (Example usage for 2 decimal places using environment variable)

Hash Variables In Joget Marketplace

...

Download Demo App

View file
nameAPP_kb_dx8_hash_variable_demo_dx8_kb.jwa
height150