Variables Array in ui.json

Use a variables array to display a question to users conditionally. You can optionally display a question as disabled in the case where an answer has been found or computed using Apex Class. To accommodate variable condition and other fields, the variables array must be an array of objects instead of an array of variable names.

Variable Object 

A variable object can have following fields:

1{
2   "name": "userObjectUsernameField",

3   "visibility": "{{Variables.orgHasUserObject == 'Yes'}}"
4}
KeyRequiredValue Description
nameYesName of the variable.
visibilityNo
  • Display condition:
    • If the condition is evaluated to 'true', then this variable (question+input control) is displayed.
    • If evaluated to 'false', this variable won’t be displayed.
    • If evaluated to 'disabled', this variable is grayed out.
  • This is evaluated on the client side.
  • Valid values `‘Disabled'

Example 

Example of variable object:

1{

2    "ui" :{

3        "pages": [

4            {

5                "title":"User Object Information",
6                // Only show this page if the user checked the "Customize" button.

7                "condition":"{{Variables.customizeOpportunities == 'Yes'}}",

8                "variables":[
                    {
9                        "name": "userObjectUsernameField",

10                        "visibility": "{{Variables.orgHasUserObject == 'Yes' ? 'Visible' : 'Hidden'}}"
11                    },
12                    {
13                        "name": "userObjectName",

14                        "visibility": "{{Variables.orgHasUserObject == 'Yes' ? 'Visible' : 'Hidden'}}"
15                    }
16                ],
17                "helpUrl":"https://salesforce.com/wave/salesapp/page1/help.html"

18            },

19            {

20                "title":"Job Information",

21                "variables":[

22                    "maxAllowedOffset"
23                ],
24                "helpUrl":"https://salesforce.com/wave/salesapp/page2/help.html"

25            }
        ],
26        "displayMessages": [
27             {
28            	  "text":"When we're done creating the app, we'll send you an email. Before you access the dashboards, you need to wait for the dataflow for the app to finish running. After that, refresh this page and start exploring.",
29			"location": "AppLandingPage"
30             }
31         ]
    }
32}