Reading custom setting and variable values

To read the value of a custom setting or default, or a user value of a variable, these functions are used:
  • ReportVariables.<variable name>.Text reads the variable value of a report variable for the current user.
  • ReportVariables.<variable name>.DefaultText reads the default value of a report variable.
  • GlobalVariables.<variable name>.Text reads the variable value of a global variable within a widget for the current user.
  • GlobalVariables.<variable name>.DefaultText reads the default value of a global variable.
  • CustomSettings.<setting name>.DefaultText reads the value of a custom setting.
  • CustomSettings.<setting name>.Text reads the value of a custom setting.

Reading values in dashboards

Multiple Application Studio charts and reports on a dashboard are calculated and rendered in parallel. To achieve this parallel processing, global variables and custom settings are not kept in synch across the dashboard. For example, if multiple reports reference the same global variable, the value of that variable can be different for each report. Thus, after a global variable is loaded it behaves as a report variable.

If you require the values to be in sync across a dashboard, you must use widget communication. That requires you to define report parameters in each report and ensure that they are linked on the dashboard.

Use these functions:

  • GlobalVariables.<variable name>.Text reads a user’s variable value within a widget.
  • GlobalVariables.<variable name>.GlobalText returns the value that was written most recently by any user interaction.
  • CustomSettings.<setting name>.GlobalText returns the value of a custom setting that was written most recently by any user interaction.

These are examples of syntax to reference the properties of global variables and custom settings:

  • =GlobalVariables.Period.DefaultText
  • =CustomSettings.Period.DefaultText
  • =GlobalVariables.Period.Text
  • =CustomSettings.Period.Text
  • =GlobalVariables.Period.GlobalText
  • =CustomSettings.Period.GlobalText