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.

1"variableType" : {
  "type": "SobjectType"
 }

SobjectType Example 

1"AccountObjVariable": {
2  "label": "What object do you use to represent accounts?",
3  "description": "The default is the Account object. If you use a different object, select it from the list below.",
4  "variableType": {
5    "type": "SobjectType"
6  },
7  "defaultValue": {
8    "sobjectName": "Account"
9  }
10}

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 in the Salesforce Object Reference for more values for dataType.

SobjectFieldType Example 

1AccountObjFieldsVariable" : {
2  "label" : "Which field in the Account object do you use to track annual revenue?",
3  "description" : "The default is the AnnualRevenue. If you use a different field, select it from the list below.",
4  "variableType" : {
5    "type" : "SobjectFieldType",
6    "dataType" : "xsd:string"
7  },
8  "defaultValue": {
9    "fieldName" : "AnnualRevenue",
10    "sobjectName" : "{{Variables.AccountObjVariable.sobjectName}}"
11  }
12}

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.

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

ConnectorType Example 

1"ConnectorVariable" : {
2  "label" : "Select a connector",
3  "description" : "A connector that exists in this org.",
4  "variableType" : {
5    "type" : "ConnectorType",
6    "connectorType" : "SalesforceExternal"
7  }
8}

DatasetType 

References a dataset within your org.

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

DatasetType Example 

1"DatasetVariable" : {
2  "label" : "Select a dataset",
3  "description" : "A dataset that exists in this org.",
4  "variableType" : {
5    "type" : "DatasetType"
6  }
7}

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 

1"DimensionVariable" : {
2  "label" : "Select a dimension",
3  "description" : "A dimension from the selected dataset.",
4  "variableType" : {
5    "type" : "DatasetDimensionType"
6  },
7  "defaultValue" : {
8    "datasetId" : "{{Variables.DatasetVariable.datasetId}}",
9    "fieldName" : ""
10  }
11}

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 

1"MeasureVariable" : {
2  "label" : "Select a measure",
3  "description" : "A measure from the selected dataset.",
4  "variableType" : {
5    "type" : "DatasetMeasureType"
6  },
7  "defaultValue" : {
8    "datasetId" : "{{Variables.DatasetVariable.datasetId}}",
9    "fieldName" : ""
10  }
11}

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 

1"DateVariable" : {
2  "label" : "Select a date",
3  "description" : "A date from the selected dataset.",
4  "variableType" : {
5    "type" : "DatasetDateType"
6  },
7  "defaultValue" : {
8    "datasetId" : "{{Variables.DatasetVariable.datasetId}}",
9    "dateAlias" : ""
10  }
11}

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 

1"AnyFieldVariable" : {
2  "label" : "Select any field",
3  "description" : "Any field from the selected dataset.",
4  "variableType" : {
5    "type" : "DatasetAnyFieldType"
6  },
7  "defaultValue" : {
8    "datasetId" : "{{Variables.DatasetVariable.datasetId}}",
9    "fieldName" : ""
10  }
11}

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. For example, 2020-02-19T14:31:42-0700.

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

DateTimeType Example 

1"dateExample" : {
2  "label" : "Select a date",
3  "description" : "The date and time",
4  "variableType" : {
5    "type" : "DateTimeType"
6  }
7}

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 

1"ObjectVariable" : {
2  "label" : "Define some object...",
3  "variableType" : {
4    "type" : "ObjectType",
5    "properties" : {
6      "stringVar" : {
7        "type" : "StringType"
8      },
9      "booleanVar" : {
10        "type" : "BooleanType"
11      },
12      "numberVar" : {
13        "type" : "NumberType",
14        "min" : 5,
15        "max" : 10
16      }
17    },
18    "strictValidation" : true,
19    "required" : ["stringVar", "numberVar"]
20  }
21}

DataLakeObjectType 

References a data lake object within your org.

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

DataLakeObjectType Example 

1"DataLakeObjectVariable" : {
2  "label" : "Select a data lake object",
3  "description" : "A data lake object that exists in this org.",
4  "variableType" : {
5    "type" : "DataLakeObjectType"
6  }
7}

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 

1"DataLakeObjectNumberFieldVariable" : {
2  "label" : "Select a numeric field from your data lake object.",
3  "variableType" : {
4    "type" : "DataLakeObjectFieldType",
5    "dataType" : "number"
6  },
7  "defaultValue" : {
8    "objectName" : "{{Variables.DataLakeObjectVariable.objectName}}",
9    "fieldName" : ""
10  }
11}

DataModelObjectType 

References a data model object within your org.

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

DataModelObjectType Example 

1"DataModelObjectVariable" : {
2  "label" : "Select a data model object",
3  "description" : "A data model object that exists in this org.",
4  "variableType" : {
5    "type" : "DataModelObjectType"
6  }
7}

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 

1"DataModelObjectStringFieldVariable" : {
2  "label" : "Select a text field from your date model object.",
3  "variableType" : {
4    "type" : "DataModelObjectFieldType",
5    "dataType" : "string"
6  },
7  "defaultValue" : {
8    "objectName" : "{{Variables.DataModelObjectVariable.objectName}}",
9    "fieldName" : "
10  }
11}

CalculatedInsightType 

References a calculated insight within your org.

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

CalculatedInsightType Example 

1"CalculatedInsightVariable" : {
2  "label" : "Select a calculated insight",
3  "description" : "A calculated insight that exists in this org.",
4  "variableType" : {
5    "type" : "CalculatedInsightType"
6  }
7}

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 

1"CalculatedInsightFieldVariable" : {
2  "label" : "Select a dimension field from your calculated insight.",
3  "variableType" : {
4    "type" : "CalculatedInsightFieldType",
5    "dataType" : "dimension"
6  },
7  "defaultValue" : {
8    "objectName" : "{{Variables.CalculatedInsightVariable.objectName}}",
9    "fieldName ": ""
10  }
11}

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 

1{
2  "Overrides" : {
3    "label" : "Overrides",
4    "description" : "Internal configuration to allow asset creation overrides, not to be displayed in UI.",
5    "defaultValue" : {
6      "createAllDashboards" : true,
7      "createAllLenses" : true,
8      "createAllExternalFiles" : true,
9      "createDataflow" : true,
10      "createAllDatasetFiles" : true,
11      "createAllImages" : true
12    },
13    "required" : true,
14    "excludeSelected" : false,
15    "excludes" : [ ],
16    "variableType" : {
17      "required" : [
18        "createAllExternalFiles",
19        "createAllDashboards",
20        "createAllImages",
21        "createAllDatasetFiles",
22        "createAllLenses",
23        "createDataflow"
24      ],
25      "type" : "ObjectType",
26      "properties" : {
27        "createAllDashboards" : {
28          "type" : "BooleanType",
29          "enums" : [
30            true,
31            false
32          ]
33        },
34        "createAllLenses" : {
35          "type" : "BooleanType",
36          "enums" : [
37            true,
38            false
39          ]
40        },
41        "createAllExternalFiles" : {
42          "type" : "BooleanType",
43          "enums" : [
44            true,
45            false
46          ]
47        },
48        "createDataflow" : {
49          "type" : "BooleanType",
50          "enums" : [
51            true,
52            false
53          ]
54        },
55        "createAllDatasetFiles" : {
56          "type" : "BooleanType",
57          "enums" : [
58            true,
59            false
60          ]
61        },
62        "createAllImages" : {
63          "type" : "BooleanType",
64          "enums" : [
65            true,
66            false
67          ]
68        }
69      },
70      "strictValidation" : true
71    }
72  }
73}