---
schema_version: "1"
id: 4aceecb4fe8b7fcc90b3afedd77b1e62c2cc8c37adfd8814b7a9162f9a68b718
title: Variables Array in ui.json
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_wave_templates/guides/reference/bi-templatesdev-vars-array-ui-json.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-vars-array-ui-json.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: db03b6dfb8e287cf159e95fc1ade4b82a9ac21ddb0bf66fa56426892d74cbd96
products:
  - Analytics Templates Developer Guide
  - analytics
---

# 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:

```nolang
{
   "name": "userObjectUsernameField", 
   "visibility": "{{Variables.orgHasUserObject == 'Yes'}}"
}
```

| Key          | Required | Value Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`       | Yes      | Name of the variable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `visibility` | No       | <ul><li>Display condition:<ul><li>If the condition is evaluated to `'true'`, then this variable (question+input control) is displayed.</li><li>If evaluated to `'false'`, this variable won't be displayed.</li><li>If evaluated to `'disabled'`, this variable is grayed out.</li></ul></li><li>This is evaluated on the client side.</li><li>Valid values `'Disabled' | 'Visible' | 'Hidden'`</li><li>Example Expressions:<ul><li>`"{{Variables.booleanType ? 'Visible' : 'Hidden'}}"`</li><li>`"{{Variables.orgHasUserObject == 'Yes' ? 'Visible' : 'Hidden'}}"`</li><li>`"{{Variables.orgHasUserObject == 'Yes' ? 'Disabled' : 'Visible' }}"`</li></ul></li></ul> |

## Example

Example of variable object:

```nolang
{ 
    "ui" :{ 
        "pages": [ 
            { 
                "title":"User Object Information",
                // Only show this page if the user checked the "Customize" button. 
                "condition":"{{Variables.customizeOpportunities == 'Yes'}}", 
                "variables":[                     {
                        "name": "userObjectUsernameField", 
                        "visibility": "{{Variables.orgHasUserObject == 'Yes' ? 'Visible' : 'Hidden'}}"
                    },
                    {
                        "name": "userObjectName", 
                        "visibility": "{{Variables.orgHasUserObject == 'Yes' ? 'Visible' : 'Hidden'}}"
                    }
                ],
                "helpUrl":"https://salesforce.com/wave/salesapp/page1/help.html" 
            }, 
            { 
                "title":"Job Information", 
                "variables":[ 
                    "maxAllowedOffset"
                ],
                "helpUrl":"https://salesforce.com/wave/salesapp/page2/help.html" 
            }         ],
        "displayMessages": [
             {
            	  "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.",
			"location": "AppLandingPage"
             }
         ]     }
}

```
