# Complex variables.json Variable Types

Complex variable types are unique to Salesforce, for example, `sobject`, `sobjectField`. Use them to query the org for access to data from Salesforce objects. Scroll to the right to view example values. Examples for each type appear below the chart.

## SobjectType

References an sObject within your org.

```nolang
"variableType" : {   "type": "SobjectType"  }
```

## SobjectType Example

```nolang
"AccountObjVariable": {
  "label": "What object do you use to represent accounts?",
  "description": "The default is the Account object. If you use a different object, select it from the list below.",
  "variableType": {
    "type": "SobjectType"
  },
  "defaultValue": {
    "sobjectName": "Account"
  }
}
```

## SobjectFieldType

References a field within an sObject.

`"variableType" : { "type": "SobjectFieldType", "dataType":"xsd:double" }`

The `dataType` limits values for `sObjectField`. For example, specify `xsd:double` to limit the list of fields to numeric sObject fields only. See [Primitive Data Types](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/primitive_data_types.htm) in the *Salesforce Object Reference* for more values for `dataType`.

## SobjectFieldType Example

```nolang
AccountObjFieldsVariable" : {
  "label" : "Which field in the Account object do you use to track annual revenue?",
  "description" : "The default is the AnnualRevenue. If you use a different field, select it from the list below.",
  "variableType" : {
    "type" : "SobjectFieldType",
    "dataType" : "xsd:string"
  },
  "defaultValue": {
    "fieldName" : "AnnualRevenue",
    "sobjectName" : "{{Variables.AccountObjVariable.sobjectName}}"
  }
}
```

## ConnectorType

References a connector within your org to use for recipes or dataflows. For more information, see [Add a Remote Connector to a CRM Analytics Template](/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-add-connector.md).

`"variableType" : { "type": "ConnectorType" , "connectorType" : "SalesforceExternal" }`

## ConnectorType Example

```nolang
"ConnectorVariable" : {
  "label" : "Select a connector",
  "description" : "A connector that exists in this org.",
  "variableType" : {
    "type" : "ConnectorType",
    "connectorType" : "SalesforceExternal"
  }
}
```

## DatasetType

References a dataset within your org.

`"variableType" : { "type": "DatasetType" }`

## DatasetType Example

```nolang
"DatasetVariable" : {
  "label" : "Select a dataset",
  "description" : "A dataset that exists in this org.",
  "variableType" : {
    "type" : "DatasetType"
  }
}
```

## DatasetDimensionType

References a dimension within a dataset. Use to let app creators select dataset dimension fields to populate app dashboards. Requires that a `DatasetType` variable is set so `datasetId` is referenced at runtime.

`"variableType" : { "type": "DatasetDimensionType" }`

## DatasetDimensionType Example

```nolang
"DimensionVariable" : {
  "label" : "Select a dimension",
  "description" : "A dimension from the selected dataset.",
  "variableType" : {
    "type" : "DatasetDimensionType"
  },
  "defaultValue" : {
    "datasetId" : "{{Variables.DatasetVariable.datasetId}}",
    "fieldName" : ""
  }
}
```

## DatasetMeasureType

References a measure within a dataset. Use to let app creators select dataset measure fields to populate app dashboards. Requires that a `DatasetType` variable is set so `datasetId` is referenced at runtime.

`"variableType" : { "type": "DatasetMeasureType" }`

## DatasetMeasureType Example

```nolang
"MeasureVariable" : {
  "label" : "Select a measure",
  "description" : "A measure from the selected dataset.",
  "variableType" : {
    "type" : "DatasetMeasureType"
  },
  "defaultValue" : {
    "datasetId" : "{{Variables.DatasetVariable.datasetId}}",
    "fieldName" : ""
  }
}
```

## DatasetDateType

References a date within a dataset. Use to let app creators select dataset date fields to populate app dashboards. Requires that a `DatasetType` variable is set so `datasetId` is referenced at runtime.

`"variableType" : { "type": "DatasetDateType" }`

## DatasetDateType Example

```nolang
"DateVariable" : {
  "label" : "Select a date",
  "description" : "A date from the selected dataset.",
  "variableType" : {
    "type" : "DatasetDateType"
  },
  "defaultValue" : {
    "datasetId" : "{{Variables.DatasetVariable.datasetId}}",
    "dateAlias" : ""
  }
}
```

## DatasetAnyField

References any type of field within a dataset. Use to let app creators select dataset dimensions, measures, and dates to populate app dashboards from a single list. Requires that a `DatasetType` variable is set so `datasetId` is referenced at runtime.

`"variableType" : { "type": "DatasetAnyField" }`

## DatasetAnyType Example

```nolang
"AnyFieldVariable" : {
  "label" : "Select any field",
  "description" : "Any field from the selected dataset.",
  "variableType" : {
    "type" : "DatasetAnyFieldType"
  },
  "defaultValue" : {
    "datasetId" : "{{Variables.DatasetVariable.datasetId}}",
    "fieldName" : ""
  }
}
```

## DateTimeType

References a time and date. Can’t be used in non-VisualForce page in ui.json. Value must be an ISO 8601 formatted date time string, as per [RFC 3339, section 5](https://tools.ietf.org/html/rfc3339#section-5). For example, `2020-02-19T14:31:42-0700`.

`"variableType" : { "type": "DateTimeType" }`

## DateTimeType Example

```nolang
"dateExample" : {
  "label" : "Select a date",
  "description" : "The date and time",
  "variableType" : {
    "type" : "DateTimeType"
  }
}
```

## ObjectType

References a user-defined object in your org. `ObjectType` isn’t supported in the UI and referencing it in ui.json results in app creation errors. Use `ObjectType` for runtime functionality, such as `Overrides`.

`"variableType" : { "type": "ObjectType" }`

## ObjectType Example

```nolang
"ObjectVariable" : {
  "label" : "Define some object...",
  "variableType" : {
    "type" : "ObjectType",
    "properties" : {
      "stringVar" : {
        "type" : "StringType"
      },
      "booleanVar" : {
        "type" : "BooleanType"
      },
      "numberVar" : {
        "type" : "NumberType",
        "min" : 5,
        "max" : 10
      }
    },
    "strictValidation" : true,
    "required" : ["stringVar", "numberVar"]
  }
}
```

## DataLakeObjectType

References a data lake object within your org.

`"variableType" : { "type": "DataLakeObjectType" }`

## DataLakeObjectType Example

```nolang
"DataLakeObjectVariable" : {
  "label" : "Select a data lake object",
  "description" : "A data lake object that exists in this org.",
  "variableType" : {
    "type" : "DataLakeObjectType"
  }
}
```

## DataLakeObjectFieldType

References a field within a data lake object.

`"variableType" : { "type": "DataLakeObjectFieldType", "dataType":"number" }`

The `dataType` limits values for `dataLakeObjectField`. For example, specify `number` to limit the list of to numeric fields only. Valid values are `number` `string`, `date`, `date_time`, or null for all values.

## DataLakeObjectFieldType Example

```nolang
"DataLakeObjectNumberFieldVariable" : {
  "label" : "Select a numeric field from your data lake object.",
  "variableType" : {
    "type" : "DataLakeObjectFieldType",
    "dataType" : "number"
  },
  "defaultValue" : {
    "objectName" : "{{Variables.DataLakeObjectVariable.objectName}}",
    "fieldName" : ""
  }
}
```

## DataModelObjectType

References a data model object within your org.

`"variableType" : { "type": "DataModelObjectType" }`

## DataModelObjectType Example

```nolang
"DataModelObjectVariable" : {
  "label" : "Select a data model object",
  "description" : "A data model object that exists in this org.",
  "variableType" : {
    "type" : "DataModelObjectType"
  }
}
```

## DataModelObjectFieldType

References a field within a data model object.

`"variableType" : { "type": "DataModelObjectFieldType", "dataType":"string" }`

The `dataType` limits values for `dataModelObjectField`. For example, specify `string` to limit the list to string fields only. Valid values are `number` `string`, `date`, `date_time`, or null for all values.

## DataModelObjectFieldType Example

```nolang
"DataModelObjectStringFieldVariable" : {
  "label" : "Select a text field from your date model object.",
  "variableType" : {
    "type" : "DataModelObjectFieldType",
    "dataType" : "string"
  },
  "defaultValue" : {
    "objectName" : "{{Variables.DataModelObjectVariable.objectName}}",
    "fieldName" : "
  }
}
```

## CalculatedInsightType

References a calculated insight within your org.

`"variableType" : { "type": "CalculatedInsightType" }`

## CalculatedInsightType Example

```nolang
"CalculatedInsightVariable" : {
  "label" : "Select a calculated insight",
  "description" : "A calculated insight that exists in this org.",
  "variableType" : {
    "type" : "CalculatedInsightType"
  }
}
```

## CalculatedInsightFieldType

References a field within a calculated insight.

`"variableType" : { "type": "CalculatedInsightFieldType", "dataType":"dimension" }`

The `dataType` limits values for `calculatedInsightField`. For example, specify `dimension` to limit the list of dimension fields only. Valid values are `dimension` `measure`, `date`, `date_time`, or null for all values.

## CalculatedInsightFieldType Example

```nolang
"CalculatedInsightFieldVariable" : {
  "label" : "Select a dimension field from your calculated insight.",
  "variableType" : {
    "type" : "CalculatedInsightFieldType",
    "dataType" : "dimension"
  },
  "defaultValue" : {
    "objectName" : "{{Variables.CalculatedInsightVariable.objectName}}",
    "fieldName ": ""
  }
}
```

## Generated Overrides in variables.json

The `variables.json` file generated upon template creation contains an `Overrides` variable for app assets. `Overrides` are referenced in `template-info.json` as a conditional for whether assets are created at runtime or not. It’s best practice to edit `Overrides`. `Overrides` can be removed as long as all references to `Overrides` are also removed from `template-info.json`.

## Overrides Variable Example

```nolang
{
  "Overrides" : {
    "label" : "Overrides",
    "description" : "Internal configuration to allow asset creation overrides, not to be displayed in UI.",
    "defaultValue" : {
      "createAllDashboards" : true,
      "createAllLenses" : true,
      "createAllExternalFiles" : true,
      "createDataflow" : true,
      "createAllDatasetFiles" : true,
      "createAllImages" : true
    },
    "required" : true,
    "excludeSelected" : false,
    "excludes" : [ ],
    "variableType" : {
      "required" : [
        "createAllExternalFiles",
        "createAllDashboards",
        "createAllImages",
        "createAllDatasetFiles",
        "createAllLenses",
        "createDataflow"
      ],
      "type" : "ObjectType",
      "properties" : {
        "createAllDashboards" : {
          "type" : "BooleanType",
          "enums" : [
            true,
            false
          ]
        },
        "createAllLenses" : {
          "type" : "BooleanType",
          "enums" : [
            true,
            false
          ]
        },
        "createAllExternalFiles" : {
          "type" : "BooleanType",
          "enums" : [
            true,
            false
          ]
        },
        "createDataflow" : {
          "type" : "BooleanType",
          "enums" : [
            true,
            false
          ]
        },
        "createAllDatasetFiles" : {
          "type" : "BooleanType",
          "enums" : [
            true,
            false
          ]
        },
        "createAllImages" : {
          "type" : "BooleanType",
          "enums" : [
            true,
            false
          ]
        }
      },
      "strictValidation" : true
    }
  }
}

```
