# developer Analytics - Full Documentation # abs({n}) Returns the absolute number of _n_ as a numeric value. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. `abs({n})` takes the following syntax. ```nolang SELECT abs(COLUMN_NAME) as ALIASNAME FROM DATASET; ``` ## Example This example takes the absolute value of the Profit field. ```nolang SELECT abs(Profit) as absProfit FROM Superstore LIMIT 1; ``` | absProfit | | --------- | | 41.9136 | # abs(n) Returns the absolute number of _n_ as a numeric value. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate abs(pct_change) as pct_magnitude; ``` # Access Apex Examples Examples include checking the Integration User access inside your WaveTemplateConfigurationModifier implementation. ## Example **In the `onConfigurationRetrival` implementation, verify the Integration User access to the Account sObject. Add the access result to the template variables.** ```nolang public class ExampleWaveTemplateConfigurationModifier extends wavetemplate.WaveTemplateConfigurationModifier { public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo waveTemplate) { String accessResult = null; if (!wavetemplate.Access.integUserHasAccessToSObjectField('Account', 'Industry')) { accessResult = 'No Access'; } else { accessResult = 'Access found'; } template.getVariables().get('accountAccess').setComputedValue(accsssResult); } } ``` ## Example **In the `onConfigurationRetrival` implementation, verify the Integration User has access more than 100 records in the Account sObject. Add the result to the template variables.** ```nolang public class ExampleWaveTemplateConfigurationModifier extends wavetemplate.WaveTemplateConfigurationModifier { public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo waveTemplate) { Boolean enoughAcctRecords = true; if (!wavetemplate.Access.getCountOfRecordsAsIntegUser('Account') > 100) { enoughAcctRecords = false; } template.getVariables().get('sufficientAcctRecordsFound').setComputedValue(enoughAcctRecords); } } ``` ## Example **Before creating the app, verify Integration User access to an sObject field selected during template wizard processing:** ```nolang public class ExampleWaveTemplateConfigurationModifier extends wavetemplate.WaveTemplateConfigurationModifier { public override void beforeAppCreate(wavetemplate.WaveTemplateInfo waveTemplate, String previousAppVersion, wavetemplate.Answers answers) { Boolean access = wavetemplate.Access.integUserHasAccessToSObjectField('sObjectFieldExample', template, answers); if (!access) { throw new wavetemplate.TemplateInterruptException('Integ User doesn't have access to sObjectFieldExample'); } } } ``` ## Example **Before creating the app, verify if there are any sObject fields the Integration User doesn't have access from an array of fields selected during template wizard processing:** ```nolang public class ExampleWaveTemplateConfigurationModifier extends wavetemplate.WaveTemplateConfigurationModifier { public override void beforeAppCreate(wavetemplate.WaveTemplateInfo waveTemplate, String previousAppVersion, wavetemplate.Answers answers) { List noAccessFields = wavetemplate.Access.checkIntegUserAccessToArrayOfSObjectFields('sobjectFieldArray', template, answers); if (!noAccessFields.isEmpty()) { throw new wavetemplate.TemplateInterruptException('Integ User doesn't have access to ' + noAccessFields.get(0)); } } } ``` # Access Data 360 XMD in the UI Open a lens view from the dashboard to rename columns, rename values, or apply custom colors to a Data 360 object. Datasets support two entry points for editing XMD: opening the dataset directly from the Browse or Recents page as a lens, or exploring a dashboard widget. Data 360 objects support only dashboard and widget entry points. You can't open them as lenses from the Browse page. 1. Open a dashboard widget backed by a Data 360 query in preview mode. 2. Select **Explore** from the dropdown menu to open as a lens. 3. Open the **Fields Panel**. 4. Use the column dropdown menu to rename columns, rename values, or apply custom colors. # Access Date Functions with Time Zone Enabled Use these functions to get the day, week, year, and other parts of `DateTime` or `DateOnly` fields. The return values are numbers. To enable Time Zone for your org, follow the directions in [Enable Custom Time Zones](https://help.salesforce.com/s/articleView?id=analytics.bi_setup_time_zone_support.htm&type=5). For the allowed formats, see [Date Formats](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-date-formats.md). - `year (DateTime | DateOnly)` - `quarter (DateTime | DateOnly)` - `month (DateTime | DateOnly)` - `week (DateTime | DateOnly)` - `day (DateTime | DateOnly)` - `hour (DateTime)` - `minute (DateTime)` - `second (DateTime)` - `fiscalYear (DateTime | DateOnly)` - `fiscalQuarter (DateTime | DateOnly)` - `fiscalMonth (DateTime | DateOnly)` - `fiscalWeek (DateTime | DateOnly)` - `epochDay (DateTime | DateOnly)` - `epochSecond( DateTime | DateOnly)` ## Examples Use `year()`, `month()`, and `day()` to project the year, month, and day for each record. `CloseDate` can be a `DateTime` or `DateOnly` type. ```nolang q = foreach q generate year('CloseDate') as "Year", month('CloseDate') as "Month", day('CloseDate') as "Day"; ``` Use `month()` to find results that closed in December. ```nolang q = filter q by month('CloseDate') == 12; ``` Use `month()` to order opportunities by month of close date. ```nolang q = order q by month('CloseDate'); ``` For even more granularity, add `hour()`, `minute()`, and `second()` to project the time for each record. These functions can only be used with a `DateTime` type. ```nolang q = foreach q generate year('CloseDate') as "Year", month('CloseDate') as "Month", day('CloseDate') as "Day", hour('CloseDate') as "Hour", minute('CloseDate') as "Minute", second('CloseDate') as "Second"; ``` Use `hour()` to order opportunities by hour of close date. ```nolang q = order q by hour('CloseDate'); ``` # Access Methods Use the `Access` features with the following methods. - `checkIntegUserAccessToArrayOfSObjectFields`. Checks an array of sObjectFields from a template answer and returns a list of fields the Integration User doesn't have access to. Requires the variable name, `WaveTemplateInfo`, and `Answers`: ```nolang global static List checkIntegUserAccessToArrayOfSObjectFields(String variableName, wavetemplate.WaveTemplateInfo template, wavetemplate.Answers answers) ``` - `getCountOfRecordsAsIntegUser`. Returns the number of records visible to the Integration User. Use this method to gauge if the number of records is high enough to continue with template processing. There’s a limit of 10K rows. Requires the sObject name to use for the count: ```nolang global static Integer getCountOfRecordsAsIntegUser(String sObjectName) ``` - `integUserHasAccessToSObjectField`. Checks an sObjectField answer to verify that the Integration User has access to it. Requires the variable name, `WaveTemplateInfo`, and `Answers`: ```nolang global static boolean integUserHasAccesstoSObjectField(String variableName, wavetemplate.WaveTemplateInfo template, wavetemplate.Answers answers) ``` - `integUserHasAccessToSObjectField`. Checks a single sObject and one of its fields to verify that the Integration User has access to it. Requires the sObject name and `WaveTemplateInfo`: ```nolang global static boolean integUserHasAccessToSObjectField(String sObjectName, wavetemplate.WaveTemplateInfo template) ``` # Access Parts of a Date Use the `EXTRACT()` function to access parts of a date. You can use `EXTRACT()` in projections, filtering, grouping and ordering. `EXTRACT()` follows this syntax. ```nolang EXTRACT(DATE_PART FROM DATE_FIELD) ``` A date part can be one of the following values. - `YEAR` - `QUARTER` - `MONTH` - `WEEK` - `DAY` - `HOUR` - `MINUTE` - `SECOND` - `EPOCH_DAY` - `EPOCH` - `FISCAL_YEAR` - `FISCAL_QUARTER` - `FISCAL_MONTH` - `FISCAL_WEEK` **note:** If you query a date field that doesn't contain time information, it will return 0. # acos({n}) Returns the arccosine value of radians value `{n}`. `{n}` can be any real number in the range of -1 \<= `{n}` \<= 1. If `null` is passed as an argument, `acos()` returns `null`. `acos({n})` takes the following syntax. ```nolang SELECT ACOS(N) as ALIAS FROM DATASET; ``` ## Example This example takes the arccosine of 35 degrees. ```nolang SELECT ACOS(RADIANS(90)) as acosValue FROM "Opportunity" LIMIT 1; ``` | acosValue | | --------- | | 0.913643 | # acos(n) Returns the arccosine value of radians value _n_. _n_ can be any real numeric value in the range of -1 \<= _n_ \<= 1. If `null` is passed as an argument, `acos()` returns `null`. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate acos(radians) as arccosine; ``` # Actions in Rules Actions define what a rule does. Use constants to make it easier to perform any action. ## Actions Actions define the way rules change an app’s JSON files. Valid actions are: - `delete`: Delete a node in the document. - `put`: Add a node to an object. - `set`: Set the value of an existing node in the document. - `add`: Add an element to an array - `eval`: Evaluate a specified expression and assign results to a variable. - `replace`: Search and replace a text string globally. Each action has a path attribute, which is a [JsonPath](http://goessner.net/articles/JsonPath/) that points to a node in the document. JsonPath is to JSON as XPath is to XML. Practice it in the [Jayway JsonPath Evaluator](http://jsonpath.herokuapp.com). **note:** If a template is updated to change the `assetVersion`, it can impact the JsonPath. Always test the rules for app creation after a template update. Actions can be conditionally applied to a document. Set the condition on a set of actions or on a collection of actions. # Actions Syntax for Rules | Action | Example | Notes | | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `add` |   | Adds an entry to an existing array. Needs `"index"` and `"value"`. `"index"` should be 0 for the first element in the array, any number after that for the middle of the array. If `"index"` is larger than the array size, the value is added to the end of the array. | | `put` |   | Add an attribute and value to an existing JSON value. Needs `"key"` and `"value"`. `"value"` can be a string or an array. | | `set` |   | Set a value on an existing JSON attribute. Needs `"value"`. | | `delete` |   | Remove a node in the existing JSON tree. | | `eval` |   | Evaluate the expression specified in `'value'` and assign results to the context variable specified by `'key'` (if set). Context attribute can be referenced using the expression: `${Rules.Eval.}`. The scope of the eval variable is the entire document if performed in a rule, or the macro if performed within a macro. | | `replace` |   | Replace any text string throughout the entire document. Use when regular expressions are not an option. Can still use expressions. Instead of using the `'replace'` action, you can perform targeted search and replace (JSON Path) with `${string:replace(...)}`. In cases requiring regular expressions, use `${string:replaceFirst(...)}, ${string:replaceAll(...)}`. | Example `add` action: ```nolang { "action": "add", "description" : "Add desc", "path": "$.json.path.to.existing.json,array", "index": 0, "value": "value to add" } ``` Example `put` action: ```nolang { "action": "put", "description" : "Put desc", "path": "$.json.path.to.existing.json", "key": "jsonAttributeName", "value": "new value" } ``` Example `set` action: ```nolang { "action": "set", "description" : "Set desc", "path": "$.json.path.to.attribute", "value": "setValue" } ``` Example `delete` action: ```nolang { "action": "delete", "description" : "Delete desc", "path": "$.json.path.to.delete" } ``` Example `eval` action: ```nolang [ { "action": "eval", "key": "helloResult", "value": "${myMacros:sayHello('Hello')}" }, { "action": "set", "path": "$.path.json.node", "value": "${Rules.Eval.helloResult}" }] ``` Example `replace` action: ```nolang { "action": "replace", "key": "RPLCM_Opportunity_Amount_Field", "value": "${Variables.Opportunity_Amount.fieldName}" }, ``` # Add a Recipe to a CRM Analytics Template Data prep recipes are a unique CRM Analytics asset, as they aren’t stored in folders like dashboards, lenses, and datasets. The only way to connect a recipe to an app is via the relationship of the datasets in the folder to the recipes that consume or output those datasets. When a recipe creates a dataset for a CRM Analytics app, the dataset connects the recipe to the folder ID for the app. These recipes are automatically added to the app template when it’s created from the app. Only recipes that run successfully and create a dataset are added to the app template. If a recipe doesn’t contain a dataset, like a recipe that reads and writes from a connector, there’s no way for the app framework to determine which app the recipe belongs to. To solve this issue, in v55.0 and above, the Connect REST API for creating and updating a template supports a list of recipe IDs in the request. **note:** Only the REST APIs and the Analytics CLI support creation with recipe IDs. Users can’t specify recipe IDs when creating a template from an app in Analytics Studio. When the app framework adds recipes to a template, it doesn’t know the order in which the recipes must be run. On template creation, the app framework first adds any recipes specified in the request. Then the framework finds recipes used to create datasets for this app and adds them to the end of the list. If a duplicate recipe ID is specified, the app framework ignores it. During app creation, the recipes are run in the order in which they’re defined in the `template-info.json` file. If the recipes must run in specific order, you must edit the `template-info.json` file manually to put the recipes in run order. ## Example Use the Connect REST API Use the template REST API to create a template from an app and include 2 recipes. In the POST request body, use the `recipeIds` parameter to specify any additional recipes to add to the app template. ```nolang POST /wave/templates/ { "folderSource": { "id": "00lxx000000xxxxxx" }, "name": "myAppTemplate", "label": "My App Template", "description": "My app template with recipes", "recipeIds": [ "05vxx000000xxxxx1", "05vxx000000xxxxx2" ] } ``` When updating an existing template to add recipes, specify the `recipeIds` in the PUT request body. ```nolang PUT /wave/templates/0Nk1k000000xxxxxx { "folderSource": { "id": "00lxx000000xxxxxx" }, "recipeIds": [ "05vxx000000xxxxx3" ] } ``` This request adds another recipe to the existing template. If the recipe exists in the template, the PUT request does a no-op. **note:** The PUT only adds recipes to an existing template. If you need to remove a recipe, you must download the template and modify the `template-info.json` file manually. ## Example Use the Analytics CLI Plugin First, get a list of recipes in your org: ```nolang sf analytics recipe list ``` returning: ```nolang RECIPEID NAME NAMESPACE LABEL STATUS _________________ _____________ __________________ ______________ _______ 05vxx000000xxxxx1 Recipe_One Recipe One New 05vxx000000xxxxx2 Recipe_Two Recipe Two New ``` Then, create a template from an app and include the recipe IDs: ```nolang sf analytics template create -f 00lxx000000xxxxxx -l "My App Template" -r "05vxx000000xxxxx1, 05vxx000000xxxxx2" ``` **note:** When specifying multiple recipe IDs, they must be enclosed in quotes. To add a recipe to an existing template: ```nolang sf analytics template update -t 0Nk1k000000xxxxxx -f 00lxx000000xxxxxx -r 05vxx000000xxxxx3 ``` # Add a Remote Connector to a CRM Analytics Template Add remote connectors to the digest node of a template dataflow by referencing connectors in `variables.json` and editing `ui.json` and `rules.json`. ## Using the ConnectorType Variable in variables.json If your app includes a connection to a remote data source, add the connection to the template using a `ConnectorType` variable to `variables.json`. `ConnectorType` is a variation of the `StringType` variable with an added `connectorType` attribute. The attribute lets you specify types of connectors to add to the template dataflow, as follows: ```nolang "ExternalConnector" : { "label" : "my connector", "description" : "This will be the connector.", "variableType" : { "type" : "ConnectorType", "connectorType" : "SalesforceExternal” }, "required" : true } ``` The `connectorType` attribute must be a string. It corresponds to values in `WaveDataConnectorTypeEnum`. The value is a “starts with” instead of an “equals,” so using Salesforce includes any connector beginning with that string, such as `SalesforceExternal`, `SalesforceMarketingCloud`, and `SalesforceMarketingCloudOAuth2`. Leave the `connectorType` value blank to include all defined connectors in the org. You can also use a `ConnectorType` variable as the `itemType` in an `ArrayType` variable. After using the `ConnectorType` variable in `variables.json`, add the variable to `ui.json` so a user creating an app can choose connectors in the template wizard. The user’s org must have at least one connector of the specified type already authenticated, but that connector doesn’t need existing replicated objects. The wizard displays all remote connectors that match the `connectorType` attribute’s criteria, as shown here. ![An app creation wizard page showing connector selections](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_connector_types_in_wizard.png) ## Add a Rule to Replace the connectionName in the Dataflow Use the `ConnectorType` variable in a rule to update the dataflow's digest node `connectionName` at app creation time. Here’s an example rule: ```nolang { "rules" : [ { "name" : "UpdateConnectors", "appliesTo" : [ { "type" : "workflow", "name" : "*" }], "actions" : [ { "action" : "set", "description" : "Use connector for digest node", "path" : "$..workflowDefinition.digest_Account.parameters.connectionName", "value" : "${Variables.ExternalConnector}" }] }] } ``` Avoid using `${Variables.ExternalConnector}` directly in the template workflow JSON. Every time the template is updated from the source app, this variable token is overwritten and removed. # Add a Tableau Next Component to Your Web App ## Embed the Tableau Next Component Copy the generated Tableau Next component code you copied from Tableau Next into your web app. This required code includes - A container for the component: use the container for component sizing and responsiveness - The SDK configuration: this defines the auth credential and the Salesforce org URL - The import of the SDK: integrates the SDK into the web app - The `initializeAnalyticsSdk` call: initializes the SDK with the configuration. - The Tableau Next component constructor: creates the Tableau Next component, using the ID or API name. Each component provides programmatic interactivity, like event handling and data filtering. - `AnalyticsDashboard`: embeds a Tableau Next dashboard - `AnalyticsMetric`: embeds a Tableau Next metric - `AnalyticsVisualization`: embeds a Tableau Next visualization - The component `render` call: renders the component in the container ### Generated Code Example for an AnalyticDashboard component ```html
``` ## Hook the Tableau Next Component To Your Web App After you copy the generated code, you need to replace the generalized values with values specific to your web app. The `AUTH_CREDENTIAL` value is the generated Frontdoor URL. The `SDK_SOURCE` value is the location of the installed SDK for your web app. If you don't use the generated code snippet from Tableau Next, you must add the `orgUrl` value, pointing to your Salesforce org. The `orgUrl` must be the Lightning URL, `https://yourorg.lightning.force.com`, not the `my.salesforce.com` domain URL. If you don't use the generated code snippet from Tableau Next, you'll need to add the `orgUrl`, pointing to your Salesforce org. ## Finding the Component ID For embedding, you need the component ID. If you use the generated component code snippet, the component ID is provided for you. You can also find the ID using the component URL from Salesforce. In Tableau Next, view the asset you want to embed. When viewing the asset, the URL for the asset provides the asset API name. **Example: Dashboard URL** `https://.force.com/tableau/dashboard//view`. **Example: Visualization URL** `https://.force.com/tableau/visualization//view`. **Example: Metric URL** `https://.force.com/tableau/exploreMetric/?{metricParameters}`. The `asset-api-name` is used for embedding as the `idOrApiName` value in the component constructor. You can use the component API name or the ID. For an example of loading a custom view for dashboard, see [Embed a Custom Dashboard View](/docs/analytics/sdk/guide/sdk-use-cases.html#embed_a_custom_dashboard_view). ## Authentication Redirect Flows In multiple org scenarios, each org can complete initialization with a different outcome. In a single org scenarios, the same redirect handling applies for the single org. If an org requires additional authentication, like a multi-factor authentication (MFA) challenge or password reset, the `initializeAnalyticSdk` method can return a non-success state for that org with redirect metadata in `orgStates`: - `state`: `AUTH_REDIRECT` - `redirectUrl`: org provided relative redirect path - `redirectOrigin`: org provided origin For each org in `AUTH_REDIRECT`, open `${redirectOrigin}${redirectUrl}` in a popup window or tab, and complete the required authentication step. Then call `retryOrAddOrgs()` for the affected org(s) to resume initialization. Retry parameter patterns: - Standard retry: use a fresh Frontdoor URL/session credential `{ orgUrl, authCredential: "" }` - MFA or password-reset resumed session: use the org URL as credential `{ orgUrl, authCredential: orgUrl }` When the MFA or password-reset completes and a new session is established, you can retry with `authCredential: orgUrl` without regenerating the Frontdoor URL. If the retry fails, regenerate Frontdoor URL and retry. **See Also** - [`initializeAnalyticsSdk`](/docs/analytics/sdk/references/sdk-js-v2/initializeAnalyticsSdk.html) - [`AnalyticsDashboard`](/docs/analytics/sdk/references/sdk-js-v2/AnalyticsDashboard.html) - [`AnalyticsFilter`](/docs/analytics/sdk/references/sdk-js-v2/AnalyticsFilter.html) - [`AnalyticsMetric`](/docs/analytics/sdk/references/sdk-js-v2/AnalyticsMetric.html) - [`AnalyticsVisualization`](/docs/analytics/sdk/references/sdk-js-v2/AnalyticsVisualization.html) # Add Actions to Dimensions Set up record-level actions on a dimension so that dashboard viewers can perform actions directly from a CRM Analytics chart or table. Each action applies to a single Salesforce record, such as creating a task for an opportunity record. You can also create an action to open the Salesforce record or a URL. **important:** Salesforce recommends that you set up actions using the UI because it’s easier. For information about setting up actions with clicks, not code, see [Perform Actions on a Salesforce Record from CRM Analytics](https://help.salesforce.com/articleView?id=bi_dashboards_actions_configure.htm). ## Open a Salesforce Record You can add a link in the action menu to open a Salesforce record directly from CRM Analytics charts and tables. The link name appears as Open Record. To let the dashboard viewer know the purpose of the link, add a tooltip that appears when the user hovers over the link. ![The Open Record link appears in the action menu for each account.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_actions_open_sfdc_record.png) CRM Analytics determines which record to open based on the Salesforce ID provided in the dataset field. When a user tries to open the record and multiple Salesforce records apply to the selected dimension, a popup asks which record to open. For example, the chart shows the value for all opportunities for each account. When the user tries to open the opportunity record for an account and the account has multiple opportunities, the user is prompted to select one. To help the user choose the correct record, the dataset fields show the opportunity name, account name, and owner for each opportunity. ![The dialog shows you information about each opportunity and asks you to pick a record.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_actions_multimatch_show_dataset_fields.png) The bold text in the XMD example shows how to set up this type of action. ```nolang "dimensions": [{ "field": "Account.Name", "linkTemplateEnabled": true, "linkTooltip": "Open the opportunity record associated with this account.", "members": [], "recordDisplayFields": ["Name", "Account.Name", "Owner.Name"], "recordIdField": "Id", "salesforceActions": [], "salesforceActionsEnabled": false }], ``` ## Open a Salesforce Record in a Multi-Org Environment You can configure the action menu in a chart or table to open Salesforce records from multiple orgs. Before we get into how to configure the XMD, let’s look at an example. You previously loaded opportunity records from multiple orgs into a dataset. ![One opportunity from each of four orgs is loaded into the dataset.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_dataset_load_from_sfdc_orgs.png) Now you want to allow dashboard viewers to open the Salesforce record directly from a dimension in a chart or table. To locate a Salesforce record in a multi-org environment, CRM Analytics needs the dataset fields that identify each Salesforce record and its org. To provide CRM Analytics with this information. - In the `recordIdField` and `recordOrganizationIdField` fields under `dimensions` specify the dataset fields that contain the record ID and org ID, respectively. ![The "dimensions" field shows the field, recordId, and recordOrganizationIdField XMD fields.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_open_sfdc_record_multi-org_xmd_dimensions.png) - In the `id` and `instanceURL` fields under `organizations`, map the org IDs to the org URLs. You can also specify a label for each org. ![The "organizations" section of the XMD maps the org IDs to the org URLs.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_open_sfdc_record_multi-org_xmd_organizations.png) When a user clicks the link to open a Salesforce record, CRM Analytics determines which Salesforce record to open by using the org URL and the record ID. CRM Analytics looks up the org ID in the dataset field specified in the `recordOrganizationIdField` of the XMD. It then uses the org ID to look up the org URL in the `organizations` section. CRM Analytics retrieves the record ID from the dataset field specified in the `recordIdField` field of the XMD. For example, if the org URL is https://mydomain.salesforce.com and the record ID is 006f4000002fjpCAAQ, the link to the record in its org is https://mydomain.salesforce.com/006f4000002fjpCAAQ. The bold text in the XMD example shows how to set up this type of action. ```nolang "dimensions": [{ "field": "Account.Name", "label": "Account Name", "linkTemplateEnabled": true, "members": [], "recordDisplayFields": [ "Account.Name", "Account.Owner.Name", "Account.Owner.Role.ParentRoleId" ], "recordIdField": "AccountId", "recordOrganizationIdField": "SFOrgId", "salesforceActions": [], "salesforceActionsEnabled": false }], ``` This XMD snippet shows the `organizations` XMD parameter. ```nolang "organizations": [ { "id": "00DB00000003brXMAQ", "instanceUrl": "https://westregion.salesforce.com", "label": "West Region Org" }, { "id": "00DB0000000pqd1MAA", "instanceUrl": "https://eastregion.salesforce.com", "label": "East Region Org" }, { "id": "00DB0000000paacMAA", "instanceUrl": "https://southregion.salesforce.com", "label": "South Region Org" }, { "id": "00DB00000001234MAA", "instanceUrl": "https://northregion.salesforce.com", "label": "North Region Org" } ] ``` ## Open a Website You can add a link to open a website from charts and tables. You can pass dataset field values in the URL using the following syntax. ```nolang “{{row.}}" ``` The bold text in the XMD example shows how to set up this type of action. ```nolang "dimensions": [{ "field": "CompanyName", "linkTemplate": "http://www.google.com/search?q={{row.CompanyName}}", "linkTemplateEnabled": true, "linkTooltip": "Search Google for this company name.", "members": [], "recordDisplayFields": [], "salesforceActions": [], "salesforceActionsEnabled": false }], ``` When a dashboard viewer clicks the Open Record link, CRM Analytics performs a search in Google based on the company name specified in the CompanyName dataset field. ![The Open Record link appears in the action menu for each company.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_actions_open_website.png) ## Perform a Salesforce Action on a Salesforce Record from CRM Analytics You can add Salesforce actions to the action menu. You can only add actions defined in the page layouts for the corresponding Salesforce object. Actions are only available for the local org, and are not supported for multi-org records. The bold text in the XMD example shows how to set up this type of action. In this example, all actions defined for any page layout for the object show up in the actions menu. ```nolang "dimensions": [{ "field": "Name", "linkTemplateEnabled": false, "members": [], "recordDisplayFields": ["Name", "Owner.Name", "Account.Name"], "recordIdField": "Id", "salesforceActions": [], "salesforceActionsEnabled": true }], ``` The list of all actions defined in all page layouts for this object appear in the actions menu. **note:** Each dashboard viewer sees only the actions that are assigned to the viewer’s page layout for this object. ![The actions menu shows all Salesforce actions defined for the object.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_actions_allSfdcActions.png) In this example, only the specified set of actions defined in the page layouts show up in the actions menu. ```nolang "dimensions": [{ "field": "Name", "linkTemplateEnabled": false, "members": [], "recordDisplayFields": ["Name", "Owner.Name", "Account.Name"], "recordIdField": "Id", "salesforceActions": [{ "enabled": true, "name": "NewCase" }, { "enabled": true, "name": "NewEvent" }, { "enabled": true, "name": "NewContact" }, { "enabled": true, "name": "NewLead" }], "salesforceActionsEnabled": true }], ``` **See Also** - [Dimensions and Derived Dimensions in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-dimensions.md) - [Organizations in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-organizations.md) # Add an Einstein Discovery Story to a CRM Analytics Template Einstein Discovery stories can be added to an app template by referring to the story in the `template-info.json` file. ## Create the Story Before adding the story to a template, create it using Einstein Discovery. (See [Create a Story](https://help.salesforce.com/articleView?id=bi_edd_create.htm&type=5).) We recommend testing your story in CRM Analytics Studio before adding it to a template. Also, add the story JSON to the template. See the following section “Configure a Story” for instructions about editing the story JSON dynamically with a template rule. **note:** Templates only support Einstein Discovery stories with a numeric, binary, and multiclass analysis prediction types in the outcome. The count analysis prediction type isn't supported. ## Reference the Story in template-info.json To include the story in the template, add the following to `template-info.json`: ```nolang "extendedTypes":{ "discoveryStories": [ { "label": "AcquiredAccounts", "name": "acquired_accounts", "file": "acquired-accounts-story.json" "condition" : "${Variables.StringValueInclude == 'Yes'}" }, { "label": "AcquiredAccounts2", "name": "acquired_accounts2", "file": "acquired-accounts-story2.json" } ] } ``` To add multiple stories to a template, add a `discoveryStories` entry for each story. Add a conditional to exclude or include the story based on a variable the user selects in the wizard, available org data, or some other condition. ## Story Metadata Examples Here’s an example `acquired-accounts-story.json` file for a story with a non-Boolean outcome. ```nolang { "outcome": { "type": "Number", "label": "CLV", "name": "CLV", "goal": "Maximize" }, "autopilot": { "enabled": true }, "setup": { "dataset": { "id": "${App.Datasets.opportunities.Id}" }, "outcome": { "type": "Number", "label": "CLV", "name": "CLV", "goal": "Maximize" }, "fields": [{ "type": "text", "name": "Account Id" }, { "type": "text", "name": "BillingState" }, { "type": "date", "name": "StartDate" }, { "type": "number", "name": "example" } ... ] } } ``` For a boolean outcome, use something like the following: ```nolang "outcome": { "failureValue": "False", "goal": "Maximize", "label": "IsWon", "name": "IsWon", "successValue": "True", "type": "Text" }, "setup": { "outcome": { "type": "text", "name": "IsWon", "displayName": "IsWon", "success": "True", "failure": "False", "goal": "Maximize" },... } ``` Syntax notes: - The `id` value in `dataset` must match a dataset specified in `template-info.json`. You can only create one story per dataset in a template. - Story metadata is case-sensitive. Capitalize the first letter in outcome, and use lowercase for fields. - All fields are required in the `outcome` object. - `outcome` and `setup.outcome` must be the same. - The outcome name is the variable we want the story to identify. For example, in the above, we want to learn if the outcome is `IsWon`. - Number of fields can be a minimum of 2 and maximum of 50 - Fields are the columns of data analyzed by Einstein Discovery and included in the story. - The `autopilot` object is optional. The default value is `false`. ## Configure a Story You can add filters to fields in the story. In the following example, we only consider rows where IsClosed = true. ```nolang "fields": [ { "type": "text", "name": "IsClosed", "includeOther": false, "values": [ { "name" : "true", "ignored":false }, { "name" : "false", "ignored":true } ] } ] ``` Use caution when adding date fields. Adding a field that shows individual dates (for example, 2019-07-01), isn’t helpful in the story. Instead, it makes more sense to show months. ```nolang { "type": "date", "name": "CloseDate", "periodicIntervals": [ "MONTH_OF_YEAR" ], "interval": "NONE" } ``` Multivalue fields can’t be included in a story. They’re excluded from the list in the story UI and must not be added to the story json. Create or alter the story JSON using template rules. For example, the following rule loops through a measures variable and adds each field to the story JSON: ```nolang { "condition": "${!empty(Variables.Dataset_Measures[0].fieldName)}", "action": "set", "description": "put selected fields in ED Story json", "path": "$.setup.fields", "value": "${array:union(Rules.CurrentNode, array:forEach(Variables.Dataset_Measures,'{\"type\":\"number\", \"name\": \"${var.fieldName}\"}'))}" } ``` Here’s a rule that conditionally adds a competitor name if it’s selected in the wizard: ```nolang { "condition": "${!empty(Variables.Competitor.fieldName)}", "type": "text", "name": "${Variables.Competitor.fieldName}" } ``` Here’s another that adds only month of the year values to the story: ```nolang { "condition": "${!empty(Variables.Dataset_Dates[0].dateAlias)}", "action": "set", "description": "put selected fields in ED Story json", "path": "$.setup.fields", "value": "${array:union(Rules.CurrentNode, array:forEach(Variables.Dataset_Dates,'{\"type\":\"date\", \"name\": \"${var.dateAlias}\", \"periodicIntervals\": [\"MONTH_OF_YEAR\"], \"interval\": \"NONE\"}'))}" } ``` # Add Event Listeners for Tableau Next Components The SDK supports various events that your component can listen for and apply event handling logic to. Supported events include: - `COMPONENT_LOADED`: Generated when the component loads completely. - `UPDATED_FILTERS`: Generated when the component filters update. - `UPDATED_SELECTIONS`: Generated when the component selections update. - `UPDATED_TIME_RANGE`: Generated when the time range for `AnalyticsMetric` updates. - `RECEIVED_DATASOURCES`: Generated when the data sources for `AnalyticsDashboard` loads. - `RECEIVED_FIELDS`: Generated when fields associated with a component loads. - `RECEIVED_FILTERS`: Generated when a list of applied filters for a component loads. - `RECEIVED_FILTER_FIELD_VALUES`: Generated when filter field values associated with a component field loads. - `RECEIVED_INTERACTION_DETAILS`: Generated when the interaction details associated with a component loads. - `RECEIVED_LAYOUT`: Generated when an applied layout for `AnalyticsMetric` loads. - `RECEIVED_METADATA`: Generated when the metadata for a component loads. - `RECEIVED_PAGES`: Generated when a list of page labels for `AnalyticsDashboard` loads. - `RECEIVED_SELECTIONS`: Generated when a list of applied selections for `AnalyticsVisualization` loads. - `DEFAULT`: Generated when any unnamed event occurs. - `ERROR`: Generated when an error occurs. Use this to listen for errors. ## Example for Event Handling for Component Loaded ```javascript analyticsComponent.addEventListener(EventName.COMPONENT_LOADED, (event) => { // Implement event handling logic }); ``` ## Example for Error Handling Use the `analyticsEventTarget` to listen for `EventName.ERROR`, with a callback to handle errors that are thrown if the SDK initialization fails due to wrong `orgUrl` or `authCredentials`. ```javascript analyticsEventTarget.addEventListener(EventName.ERROR, (errorEvent) => { console.log("Received a global error event", errorEvent) }); ``` # Add Functionality to Tableau Next Embedded Components Once you have your components embedded in your third-party app, you can customize the component behavior with filters and events. - [Using Filters in Tableau Next Components](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-embedded-components-filters.md) - [Add Event Listeners for Tableau Next Components](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-embedded-components-events.md) - [Use Cases for Tableau Next Embedding](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-use-cases.md) # Add Tableau Next Components from Multiple Salesforce Orgs Embedding Tableau Next components in your own web app gives you the flexibility to add components from multiple Salesforce orgs on one page. To use multiple orgs in your implementation, initialize the SDK with the `orgConfigs` map instead of single `orgUrl` and `authCredential` parameters. ```javascript import { initializeAnalyticsSdk, AnalyticsDashboard, AnalyticsVisualization, } from "@salesforce/analytics-embedding-sdk"; // Initialize with multiple orgs, Lightning URL required for the `orgUrl` values const initPayload = { orgConfigs: [ { orgUrl: "https://org1.lightning.force.com", authCredential: "https://org1-frontdoor.salesforce.com/...", }, { orgUrl: "https://org2.lightning.force.com", authCredential: "https://org2-frontdoor.salesforce.com/...", }, ], }; const response = await initializeAnalyticsSdk(initPayload); ``` Then, when you embed your components, you must specify the `orgUrl` in the component constructor. The `orgUrl` is required when creating components in a multi org scenario, to ensure that your component connects to the correct org. ```javascript // Embed components from different orgs - always specify orgUrl const dashboard = new AnalyticsDashboard({ parentIdOrElement: "container1", idOrApiName: "Dashboard1", orgUrl: "https://org1.lightning.force.com", }); dashboard.render(); // Embed visualization from another org const visualization = new AnalyticsVisualization({ parentIdOrElement: "container2", idOrApiName: "Viz2", orgUrl: "https://org2.lightning.force.com", }); visualization.render(); ``` ## Adding Orgs Dynamically You can add new orgs or try failed orgs again after the initial SDK initialization by using the `retryOrAddOrgs` function. ```javascript import { retryOrAddOrgs } from "@salesforce/analytics-embedding-sdk"; const newOrgs = [ { orgUrl: "https://org3.lightning.force.com", authCredential: "https://org3-frontdoor.salesforce.com/...", }, { orgUrl: "https://org4.lightning.force.com", authCredential: "https://org4-frontdoor.salesforce.com/...", }, ]; const response = await retryOrAddOrgs(newOrgs); // Check if orgs were added successfully console.log(response.status); ``` The `retryOrAddOrgs` function returns the same `BootstrapResponse` format as the `initializeAnalyticsSdk` function. ## Response The `initializeAnalyticsSdk` function returns a `BootstrapResponse` object, which contains an `orgStates` map with the overall status and the individual org statuses. ```javascript const response = await initializeAnalyticsSdk(config); // Response structure: { "message": "Sdk Initialize Complete", "status": "Success", "orgStates": { "https://org1.lightning.force.com": { "state": "INITIALIZATION_SUCCESS", "reason": "" }, "https://org2.lightning.force.com": { "state": "INITIALIZATION_SUCCESS", "reason": "" } } } // Check initialization status console.log(response.status); // Get detailed message console.log(response.message); // For multi-org scenarios, check individual org states: if (response.orgStates) { response.orgStates.forEach((state, orgUrl) => { console.log(`Org ${orgUrl}: ${state.state}`); }); } ``` ### SDK Initialization Status Values - `Status.SUCCESS` - All orgs initialized successfully - `Status.PARTIAL_SUCCESS` - Some orgs initialized successfully (multi-org only) - `Status.FAILURE` - Initialization failed **See Also** - [`initializeAnalyticsSdk`](/docs/analytics/sdk/references/sdk-js-v2/initializeAnalyticsSdk.html) - [`retryOrAddOrgs`](/docs/analytics/sdk/references/sdk-js-v2/retryOrAddOrgs.html) - [`OrgConfig`](/docs/analytics/sdk/references/sdk-js-v2/OrgConfig.html) - [`OrgStateMap`](/docs/analytics/sdk/references/sdk-js-v2/OrgStatesMap.html) - [`OrgStateInfo`](/docs/analytics/sdk/references/sdk-js-v2/OrgStateInfo.html) # Add the Data When uploading external data files, you can use the InsightsExternalDataPart object to load the data in smaller chunks. After inserting a row into the InsightsExternalData (header) object, split your data into 10-MB chunks and upload the chunks to InsightsExternalDataPart objects. You associate the part objects with the header object by setting the InsightsExternalDataId field on the part objects to the ID of the header object. The part objects contain the bytes of data and must be assigned part numbers in a contiguous sequence, starting with 1. Ensure that the chunks of data are smaller than 10 MB. If the data is compressed, it must be compressed first and then split into 10-MB chunks. Only the gzip format is supported. The following example splits a file into 10-MB chunks, and then uploads the chunks to InsightsExternalDataPart objects. ```nolang List fileParts = chunkBinary(dataFile); //Split the file for(int i = 0;i # Aggregate Functions Aggregate functions perform computations across all values of a grouped field. If you don't precede an aggregate function by a `group by` statement, it treats each line as its own group. Using an aggregate function on an empty set returns null. - **[avg() or average()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-avg.md)** Returns the average of the values of a measure field. - **[count()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-cnt.md)** Returns the number of rows that match the query criteria. - **[first()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-1st.md)** Returns the first value for the specified field. - **[last()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-last.md)** Returns the last value in the tuple for the specified field. - **[max()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-max.md)** Returns the maximum value of a dimension or measure field. - **[median()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-med.md)** Returns the median value of a measure field. - **[min()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-min.md)** Returns the minimum value of a dimension or measure field. - **[sum()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-sum.md)** Returns the sum of a numeric field. - **[unique()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-unq.md)** Returns the count of unique values. - **[stddev()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-stdev.md)** Returns the standard deviation of the values in a field. Accepts measure fields (but not expressions) as input. - **[stddevp()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-stdevp.md)** Returns the population standard deviation of the values in a field. Accepts measure fields as input but not expressions. - **[var()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-var.md)** Returns the variance of the values in a field. Accepts measure fields as input but not expressions. - **[varp()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-varp.md)** Returns the variance of the values in a field. Accepts measure fields as input but not expressions. - **[percentile_cont()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-pc.md)** Calculates a percentile based on a continuous distribution of the column value. - **[percentile_disc()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-pd.md)** Returns the value corresponding to the specified percentile. - **[regr_intercept()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-ri.md)** Uses two numerical fields to calculate a trend line, then returns the y-intercept value. Use this function to find out the likely value of _field_y_ when _field_x_ is zero. - **[regr_slope()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-rs.md)** Uses two numerical fields to calculate a trend line, then returns the slope. Use this function to learn more about the relationship between two numerical fields. - **[regr_r2()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-regr2.md)** Uses two numerical fields to calculate R-squared, or goodness of fit. Use `regr_r2()` to understand how well the trend line fits your data. - **[grouping()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-grouping.md)** Returns 1 if null dimension values are due to higher-level aggregates (which usually means the row is a subtotal or grand total), otherwise returns 0. **See Also** - [group-by](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-groupby.md) # Aggregate Functions Aggregate functions perform operations across columns. CRM Analytics supports the following aggregate functions. - **[avg()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-avg.md)** Takes the average of row values in a given column. - **[count()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-count.md)** Returns the number of rows that match a specified condition in a column. - **[min()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-min.md)** Returns the lowest row value in a numeric column. - **[max()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-max.md)** Returns the highest row value in a numeric column. - **[sum()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-sum.md)** Returns the sum of all rows values in a numeric column. - **[stddev_pop()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-stddev-pop.md)** Returns the population standard deviation of the values in a field. Accepts measure fields as input. This function does not accept expressions. - **[stddev_samp()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-stddev-samp.md)** Returns the standard deviation of values in a field. Accepts measure fields as input. This function does not accept expressions. - **[var_pop()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-var-pop.md)** Returns the population variance of the values in a field. Accepts measure fields as input. This function does not accept expressions. - **[var_samp()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-var-samp.md)** Returns the sample variance of the values in a field. Accepts measure fields as input. This function does not accept expressions. - **[regr_intercept()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-regr-intercept.md)** Returns the y-intercept value of a regression line. - **[regr_slope()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-regr-slope.md)** Returns the slope of a regression line between two numerical fields. - **[regr_r2()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-regr-r2.md)** Returns the R-squared, or goodness-of-fit value for a regression. - **[percentile_cont](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-pct-cont.md)** Calculates a percentile based on a continuous distribution of the column value. - **[percentile_disc](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-aggregate-pct-disc.md)** Returns the value corresponding to a given percentile. Accepts measure fields as input. # aggregateflex Step Type Properties Use the `aggregateflex` step type to perform aggregate queries on a Analytics dataset. An aggregate query summarizes rows, like returning one row per grouping. For example, this step type can return the total amount per sales rep. | Field Name | Description | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `datasets` | An array of datasets used by this step. Specify the alias of each dataset. If the `pigql` attribute references a dataset that's not specified here, the dashboard doesn't render. | | `broadcastFacet` | Controls whether the step's selections are broadcasted as facets. Faceting is when a selection in a widget filters other steps in the dashboard. Default is `true`. | | `receiveFacetSource` | Controls whether the step in the receiving query listens for broadcasted facets and applies them as filters. The mode can be "`all`", "`none`", "`include`", or "`exclude`". Use `steps` to list which steps to include or exclude. Default is `all`. | | `isGlobal` | This applies to global filters created before Winter '18 only. Newer global filters, those created in the global filter panel widget, don't require a step. Default is false. You can apply this property only on steps that are connected to a global filter widget—all other steps ignore this property. A global filter filters other steps in the dashboard that have `useGlobal` set to `true` and reference the same dataset. | | `label` | Step label, which is primarily used for display in the dashboard designer user interface. | | `query` | The query used to retrieve results from a dataset. It must contain at least one grouping and can be in SAQL or compact form. Use a query in SAQL form to customize the query in a way that can't be done using compact form. | | `selectMode` | Determines the selection interaction. The options for charts, tables, lists, and toggle selectors are: `none`, `single`, `singlerequired`, `multi` and `multirequired`. `selectMode` doesn't apply to number, values table, date, range, and global filter widgets. | | `start` | The initial selections that are applied to the step when the dashboard first opens. | | `type` | Step type. Set to `aggregateflex`. If you bind a step property for an `aggregateflex` step, you must use the correct bindings syntax. For more information about bindings, see the [Analytics Bindings Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_bindings.meta/bi_dev_guide_bindings/bi_dbjson_bindings.htm). | | `visualizationParameters` | Visualization details about the step. For more information, see [visualizationParameters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-visualizationparameters-properties.md). | | `useGlobal` | Indicates whether to apply global filters to this step (`true`) or not (`false`). If the step is in SAQL form, you must also set `autoFilter` to `true` to apply the global filters. By default, the global filter widget filters compact-form steps only. | ## Compact Form 2.0 Query Properties The `query` can contain the following properties. - `sources` — The array of sources where data comes from. For more information, see [sources Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-sources.md). - `sourceFilters` — The filters applied to `sources`. When you use this object, the `sources` name is the `steps` key. the For more information, see [filters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-filters.md). - `aggregateFilters` — The array of filters applied on aggregate columns, which are fields where an aggregate function, such as average or sum, is applied to a measure column. Aggregate columns are defined in `columns` under `sources`. For more information, see [filters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-filters.md) - `orders` — The array of sort orders applied to data in a pivot table. An order can contain the following properties: - `name` — The column or group name used to apply the sort order. - `ascending`: The sort order applied to the data. Indicates whether to order the data in ascending order (`true`) or not (`false`). - `filters` — The filters used to sort a measure column in a pivot table and is applied on a dimension value in the pivoted group. For more information about sorting data in a pivot table, see [Organize and Summarize Data in a Pivot Table](https://help.salesforce.com/articleView?id=analytics.bi_explorer_pivot_table.htm&type=5). - `nulls` — The sort order applied to null values in the data. To sort null values last, set `nulls` to `last`. To sort null values first, set `nulls` to `first`. - `rowTotals` — The array of dimension groups to which the values of each row are rolled up. To calculate `rowTotals`, you must also include `columnGroups` for the data. - `columnTotals` — The array of dimension groups to which the values of each column are rolled up. If the query is a grain query, that is, all the columns are non-aggregate columns, or if the query is not grouped by any dimension columns, to calculate totals, set `columnTotals` to `all`. - `columnGroups` — The pivoted dimension group, which is the last-defined group. If the defined group is a compound date, such as Year-Month for order date, then include each date grain in `columnGroups`. For example, `["OrderDate_Year", "OrderDate_Month"]`. - `limit` — The maximum number of results that the step can return. When you create an `aggregateflex` step, by default, CRM Analytics sets `limit` to 2,000. To return more results, set the `limit` attribute accordingly. The higher you increase the limit, the longer the query takes. When a limit isn't set, Analytics returns up to 10,000 results. For more information, see [filters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-filters.md). Compact Form 2.0 Query Example: ```nolang "query": { "sources": [ { "columns": [ { "field": ["sum", "Amount"], "name": "A" } ], "groups": [ "Product_Container", "Order_priority" ], "filters": [ [ "Profit", [16000], "<", ] ], "name": "SuperStoreSales" }, { "columns": [ { "formula": "A*2", "name": "B" } ], "groups": [], "filters": [] ] }, ], "sourceFilters": { "SuperStoreSales" { "filters": [ [ "Sales", [ 1, 100000 ], ">=<=" ], [ "Customer_Segment", [ "Consumer", "Corporate", ], "in" ] ] } }, "aggregateFilters": [ [ "A", [10], ">" ] ], "orders": [ { "name": "Product_Container", "ascending": true, "filters": [], "nulls": "last" }, { "name": "Order_Priority", "ascending": true, "filters": [], "nulls": "last" } ], "rowTotals": ["Product_Container"], "columnTotals": [ "Product_Container", "Order_Priority" ], "columnGroups": ["Order_Priority"], "limit": 2000 } ``` ## Compact Form 1.0 Query Properties The `query` can contain the following properties. - `filters` — The filters to apply to the data. For more information, see [filters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-filters.md). - `groups` — The dimension to group by. - `limit` — The maximum number of results that the step can return. When you create an `aggregateflex` step, by default, CRM Analytics sets `limit` to 2,000. To return more results, set the `limit` attribute accordingly. The higher you increase the limit, the longer the query takes. When a limit isn't set, Analytics returns up to 10,000 results. Limit only impacts the number of records returned for display. The limit doesn't impact calculations across all records in the dataset. For instance, a query groups by Account Name and there are one million Account Names in a dataset. When the limit is 20, Analytics returns 20 records for display. But the summary row provides a total for the one million records. - `measures` — The measures returned by the query. If you provide an aggregate function for a measure, then the measure value must be a string, not an array. - `order` — Sort order (ascending or descending) of the first specified measure. To order the results in ascending order, set `ascending` to `true`. To order the results in descending order, set `ascending` to `false`. If you don't want to impose a specific order, remove the entire `"order"` parameter. - Compact-form (1.0) Query Example: ```nolang "query": { "filters": [ [ "Account.Industry", [ "Agriculture", "Apparel", "Banking", "Biotechnology", "Consulting", "Education", "Electronics", "Energy", "Engineering", "Finance", "Healthcare", "Insurance", "Manufacturing", "Media", "Retail", "Technology", "Telecommunications", "Transportation", "Utilities" ], "in" ] ], "groups": [ "Account.Industry" ], "measures": [ [ "avg", "Amount" ] ], "order": [ [ -1, { "ascending": false } ] ] } ``` ## SAQL Form Query Properties The `query` can contain these properties: - `pigql` — Specify the SAQL query to retrieve data from a dataset. When you specify a SAQL query, you must specify the filters, limits, and ordering inside the `pigql` attribute. CRM Analytics ignores the following attributes if they are set under the `query` attribute: `filters`, `limit`, and `order`. - `measures` — Defines the fields included as measures. When using a SAQL-form query, you must include each measure in this parameter and in the `pigql` parameter. You can change the UI label of a measure by setting the `display` option. ```nolang "count", "*", null, { "display": "% of total flights" } ``` - `groups` — Defines the dimension fields to group by. When using a SAQL-form query, you must specify the group-by dimension in this parameter and in the `group` property in the `pigql` parameter. - SAQL-form Query Example: ```nolang "query": { "pigql": "q = load \"ServiceOpportunity3\";\n q = filter q by 'Account.Industry' in [\"Agriculture\", \"Apparel\", \"Banking\", \"Biotechnology\", \"Consulting\", \"Education\", \"Electronics\", \"Energy\", \"Engineering\", \"Finance\", \"Healthcare\", \"Insurance\", \"Manufacturing\", \"Media\", \"Retail\", \"Technology\", \"Telecommunications\", \"Transportation\", \"Utilities\"];\n q = group q by 'Account.Industry';\n q = foreach q generate 'Account.Industry' as 'Account.Industry', count() as 'count';\n q = order q by 'count' desc;\n q = limit q 1000;", "measures": [ [ "count", "*", "count" ] ], "groups": [ "Account.Industry" ], "measuresMap": {} } ``` For more information about SAQL queries, see the [Analytics SAQL Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_saql.meta/bi_dev_guide_saql/bi_saql_intro.htm). ## Example ### aggregateflex Step ```nolang "steps": { "Account_Owner_1": { "type": "aggregateflex", "query": { "measures": [ [ "avg", "Amount" ] ], "groups": [ "Account_Owner" ], "order": [ [ "avg_Amount", { "ascending": false } ] ] }, "visualizationParameters": { "options": {}, "type": "chart", "parameters": { "visualizationType": "hbar", "autoFitMode": "keepLabels", "theme": "wave", "title": { "label": "", "fontSize": 14, "subtitleLabel": "", "subtitleFontSize": 11, "align": "center" }, "showValues": true, "axisMode": "multi", "binValues": false, "bins": { "breakpoints": { "low": 0, "high": 100 }, "bands": { "low": { "label": "", "color": "#B22222" }, "medium": { "label": "", "color": "#ffa500" }, "high": { "label": "", "color": "#008000" } } }, "dimensionAxis": { "showAxis": true, "showTitle": true, "title": "", "customSize": "auto", "icons": { "useIcons": false, "iconProps": { "column": "", "fit": "cover", "type": "round" } } }, "measureAxis1": { "sqrtScale": false, "showAxis": true, "customDomain": { "showDomain": false }, "showTitle": true, "title": "" }, "measureAxis2": { "sqrtScale": false, "showAxis": true, "customDomain": { "showDomain": false }, "showTitle": true, "title": "" }, "legend": { "show": true, "showHeader": true, "inside": false, "descOrder": false, "position": "right-top", "customSize": "auto" }, "tooltip": { "customizeTooltip": false, "showDimensions": true, "dimensions": "", "showMeasures": true, "measures": "", "showPercentage": true, "showNullValues": true, "showBinLabel": true }, "trellis": { "enable": false, "showGridLines": true, "flipLabels": false, "type": "x", "chartsPerLine": 4, "size": [ 100, 100 ] }, "applyConditionalFormatting": true, "showActionMenu": true, "columnMap": { "trellis": [], "plots": [ "avg_Amount" ], "dimensionAxis": [ "Account_Owner" ] } } }, "datasets": [ { "id": "0FbB00000000xHDKAY", "name": "DTC_Opportunity_SAMPLE", "label": "DTC Opportunity", "url": "/services/data/v48.0/wave/datasets/0FbB00000000xHDKAY" } ], "useGlobal": true, "isGlobal": false, "label": "Account_Owner_1", "broadcastFacet": true, "receiveFacetSource": { "mode": "all", "steps": [] }, "selectMode": "single" } } ``` - **[steps Properties for Compact Form and SAQL Form](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-form.md)** The properties and JSON syntax in the `query` node of an `aggregateflex` step type vary based on whether the step is in compact form or SAQL form. # Analytics CLI Plugin Command Reference Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | --- | | 68.0 | Winter '27 | [Download PDF](https://resources.docs.salesforce.com/264/latest/en-us/sfdc/pdf/bi_dev_guide_cli_reference.pdf) | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_cli_reference.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_cli_reference.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_cli_reference.pdf) | # Analytics Dashboard Component Release Notes Use the Salesforce Release Notes to learn about the most recent updates to the Analytics Dashboard Component. For a list of all current developer additions and changes, including the Analytics Dashboard Component, see [CRM Analytics Release Notes](https://help.salesforce.com/s/articleView?id=release-notes.rn_bi_analytics_cloud.htm) in the Salesforce Release Notes. # Analytics Dashboard JSON Developer Guide Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | ----------------------------------------------------------------------------------------------------- | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_json.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_json.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_json.pdf) | | 64.0 | Summer '25 | [Download PDF](https://resources.docs.salesforce.com/256/latest/en-us/sfdc/pdf/bi_dev_guide_json.pdf) | # Analytics Dashboard Use Cases for Aura Components For the best result, use the dashboard component interactively with other components. This section has basic use cases to get you started on how to use the component methods, attributes, and Web SDK events. - [Get and Set the Dashboard State](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-stateusecase.md) # Analytics Download Download a `.png` image of a CRM Analytics dashboard or lens, or Lightning Experience dashboard or report. Download a `.pdf` file of a CRM Analytics dashboard or lens. Request downloads via browser calls. ## Syntax **URI:** `domain/analytics/download/assetType/assetId.downloadType` **note:** To request a download, enter the URI in a browser address bar. We don't support the use of this API from Apex. **Formats:** `.png` or `.pdf` **Parameters** | Parameter | Description | | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `assetType` | Required. Specifies what type of Analytics asset to download. Valid values are:
  • `dashboard`
  • `lens`
  • `lightning-dashboard`
  • `report`
| | `assetId` | Required. Specifies the Analytics asset id to download. | | `downloadType` | Required. Specifies what file type to download the Analytics asset as. Valid values are:
  • `png`
  • `pdf`
| **note:** For Lightning Experience reports, the request works only with `png` and only if the report has a chart. If you use `pdf` or if the report doesn’t have a chart, the request returns an error. **Query Parameters** | Parameter | Description | | ------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `includeData` | Optional. Indicates whether to include that tabular widget data (`true`) or not(`false`). | | `pageId` | Optional. Specifies the Id for a dashboard page to download. | | `pageSize` | Optional. Specifies page size to download. Valid values are:
  • `A3`
  • `A4`
  • `LEGAL`
  • `LETTER`
| | `savedviewId` | Optional. Specifies the Id for a dashboard saved view to download. | **note:** For Lightning Experience reports, the request works only with `png` and only if the report has a chart. If you use `pdf` or if the report doesn’t have a chart, the request returns an error. ## Response Body The response body is binary data of the `.png` or `.pdf` representation of the Analytics asset. For limits on columns and pages in `.pdf` files, see [Analytics Download Limits](https://help.salesforce.com/apex/HTViewHelpDoc?id=bi_limits.htm&language=en_US#AnalyticsDownloadLimits). # Analytics Download Use the Analytics Download API to download images and PDFs of Analytics assets, including CRM Analytics dashboards and lenses and Lightning Experience dashboards and reports. The Analytics Download API is available in API version 55.0 and later. **note:** To use the Analytics Download API, your org must have a CRM Analytics license. In addition, your org needs both Slack for Salesforce and CRM Analytics for Slack enabled. For more information, see [Enable Salesforce for Slack Integrations](https://help.salesforce.com/s/articleView?id=slack.slack_apps_enable.htm&type=5). Resources for the Analytics Download API are available at `domain/analytics/download`. Downloads are requested via browser calls. |Resource|Description| |--------|-----------| |[Analytics Download](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-download-reference-download.md) `domain/analytics/download/assetType/Id.downloadType`|When _downloadType_ has a value of `png`, downloads a `.png` image of the specified CRM Analytics dashboard or lens, or of the specified Lightning report or dashboard. When _downloadType_ has a value of `pdf`, downloads a `.pdf` file of the specified CRM Analytics dashboard or lens.| # analytics enable Enable Analytics in the target org. ## Examples for analytics enable ```nolang sf analytics enable ``` ```nolang sf analytics enable -o "MyTargetOrg" ``` ## Command Syntax - `sf analytics enable` - : [`--json`] [`--api-version` APIVERSION] `-o` TARGETORG [`-a`] [`-w` WAIT] [`-p` POLLINTERVAL] ## Parameters - `-o` TARGETORG - : Required Username or alias of the target org. Not required if the target-org configuration variable is set. Type: string - `--json` - : Optional Format output as JSON. Type: boolean - `--apiversion` APIVERSION - : Optional Override the API version used for API requests made by this command. Type: string - `-a` | `--async` - : Optional Enable asynchronously. Type: boolean - `-w` | `--wait` WAIT - : Optional Wait time in minutes for auto-install request to finish (default 10). Type: number Default value: 10 - `-p` | `--pollinterval` POLLINTERVAL - : Optional Polling interval in milliseconds for checking auto-install request status (default 5000). Type: number Default value: 5000 # Analytics Extended Metadata (XMD) Developer Guide Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | ---------------------------------------------------------------------------------------------------- | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_xmd.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_xmd.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_xmd.pdf) | | 64.0 | Summer '25 | [Download PDF](https://resources.docs.salesforce.com/256/latest/en-us/sfdc/pdf/bi_dev_guide_xmd.pdf) | # Analytics External Data API Developer Guide Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | --------------------------------------------------------------------------------------------------------- | | 68.0 | Winter '27 | [Download PDF](https://resources.docs.salesforce.com/264/latest/en-us/sfdc/pdf/bi_dev_guide_ext_data.pdf) | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_ext_data.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_ext_data.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_ext_data.pdf) | # Analytics Interactions Release Notes Use the Salesforce Release Notes to learn about the most recent updates to Analytics Interactions. For a list of all current developer additions and changes, including Analytics Interactions, see [CRM Analytics Release Notes](https://help.salesforce.com/s/articleView?id=release-notes.rn_bi_analytics_cloud.htm) in the Salesforce Release Notes. # Analytics Notification Get information about (`GET`), save changes to (`PUT`) or delete (`DELETE`) a specific analytics notification. ## Syntax **URI:** `/services/data/vXX.X/`analytics/notifications/_analytics notification ID_ **Formats:** JSON **HTTP methods** | Method | Description | | -------- | ---------------------------------------------------------------------------- | | `GET` | Returns information about a specific notification. | | `PUT` | Save changes to the analytics notification as specified in the request body. | | `DELETE` | Delete the analytics notification. Deleted notifications can't be recovered. | **Parameters** | Parameter | Description | | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `source` | Required for `GET` calls. Specifies what type of analytics notification to return. Valid values are:
  • `lightningDashboardSubscribe` — dashboard subscriptions
  • `lightningReportSubscribe` — report subscriptions
  • `waveNotification` — Analytics notifications
| | `ownerId` | Optional for `GET` calls. Allows users with Manage Analytics Notifications permission to get notifications for another user with the specified `ownerId`. | | `recordId` | Optional. Return notifications for a single record. Valid values are:
  • `reportId`— Unique report ID
  • `lensId`— Unique Analytics lens ID
| ## GET Response Body | Property | Type | Description | | --------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `active` | Boolean | Indicates whether the notification is being sent (`true`) or not (`false`). | | `configuration` | [WaveConfiguration[]](analytics-api-notifications-reference-list.md#analytics-notification-list) | Describes details of a Analytics notification. Only applicable when `source` is `waveNotification`. | | `createdDate` | DateTime | Date and time when the notification was created (in ISO 8601 format). | | `deactivateOnTrigger` | Boolean | Indicates whether the notification is deactivated after it's sent (`true`) or not (`false`). Deactivation doesn't delete the notification. The default value is `false`. | | `id` | String | Unique notification ID. | | `lastModifiedDate` | DateTime | Date and time when the notification was last modified (in ISO 8601 format). | | `name` | String | Display name of the notification. | | `recordId` | String | Unique ID of the record that the notification describes. Valid values are:
  • `reportId`
  • `lensId`
| | `runAs` | [runAs](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-notifications-reference-list.md) | The person who runs the report in a report subscription. Report recipients see data in the emailed report that this person has access to in Salesforce. Available in API version 40.0 and later. Only appears if you have the “Subscribe to Reports: Add Recipients” user perm. | | `schedule` | [Schedule](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-notifications-reference-list.md) | Details about the notification's schedule. | | `source` | String | Indicates the type of notification. Possible values are:
  • `lightningSubscribe` — report subscriptions
  • `lightningDashboardSubscribe` — dashboard subscriptions
  • `lightningReportSubscribe` — report subscriptions
  • `waveNotification` — Analytics notifications
| | `thresholds` | [Threshold[]](analytics-api-notifications-reference-list.md#analytics-notification-list) | Specifies what happens when the notification runs. For example, sending an email with report results. | **runAs** | Property | Type | Description | | -------- | ------ | --------------------------------------- | | `id` | String | The person’s unique Salesforce user ID. | | `name` | String | The person’s first and last name. | **Schedule** | Property | Type | Description | | --------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `frequency` | String | How frequently the notification is invoked. Possible values are:
  • `daily` — Every day
  • `weekly` — One or more days each week
  • `monthly` — One or more days each month
| | `frequencyType` | String | Only necessary when `frequency` is `monthly`. Possible values are:
  • `relative` — Days which can change month-to-month, as described by `details`.
  • `specific` — Fixed monthly dates, as described by `details`.
| | `details` | [ScheduleDetail[]](analytics-api-notifications-reference-list.md#analytics-notification-list) | Describes the notification schedule. Varies depending on whether `frequency` is `daily`, `weekly`, or `monthly`. | **ScheduleDetail (`frequency` is `daily`)** | Property | Type | Description | | -------- | ------- | ---------------------------------------------------------------------------------------------------- | | `time` | Integer | The hour of the day at which the notification is invoked. Possible values are integers from 0 to 23. | **ScheduleDetail (`frequency` is `weekly`)** | Property | Type | Description | | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `time` | Integer | The hour of the day at which the notification is invoked. Possible values are integers from 0 to 23. | | `daysOfWeek` | String[] | The days of the week on which the notification is invoked. Possible values are:
  • `mon` — Monday
  • `tue` — Tuesday
  • `wed` — Wednesday
  • `thu` — Thursday
  • `fri` — Friday
  • `sat` — Saturday
  • `sun` — Sunday
| **ScheduleDetail (`frequency` is `monthly`, `frequencyType` is `relative`)** | Property | Type | Description | | ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `time` | Integer | The hour of the day at which the notification is invoked. Possible values are integers from 0 to 23. | | `weekInMonth` | String | The week in the month during which the notification is invoked. Possible values are:
  • `first` — First week
  • `second` — Second week
  • `third` — Third week
  • `fourth` — Fourth week
| | `dayInWeek` | String | The day of the week on which the notification is invoked. Possible values are:
  • `mon` — Monday
  • `tue` — Tuesday
  • `wed` — Wednesday
  • `thu` — Thursday
  • `fri` — Friday
  • `sat` — Saturday
  • `sun` — Sunday
  • `weekday` — Weekday
  • `weekend` — Weekend day
| **ScheduleDetail (`frequency` is `monthly`, `frequencyType` is `specific`)** | Property | Type | Description | | ------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `time` | Integer | The hour of the day at which the notification is invoked. Possible values are integers from 0 to 23. | | `daysOfMonth` | Integer[] | The days of the month on which the notification is invoked. Possible values are integers from 1 to 31, and -1 (which represents the last day of the month). | **Threshold** | Property | Type | Description | | ------------ | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `actions` | [Action[]](analytics-api-notifications-reference-list.md#analytics-notification-list) | Specifies what action is taken when the notification is invoked. | | `conditions` | [Condition[]](analytics-api-notifications-reference-list.md#analytics-notification-list) | Describes conditions that govern when the notification is invoked. | | `type` | String | Specifies when the notification is invoked (other than date and time criteria). Possible values are:
  • `always` — Always invoke the notification
  • `onError` — Invoke the notification when there is an error
  • `condition` — Invoke the notification based on criteria described by `conditions`
| **Condition** | Property | Type | Description | | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `colName` | String | The data field which is operated on. | | `value` | String | The comparison value which is used by the operation. | | `operation` | String | The operation which is used to evaluate the condition. Possible values are:
  • `equal` — `colName` and `value` are equal
  • `notEqual` — `colName` and `value` are not equal
  • `greaterThan` — `colName` is greater than `value`
  • `lessThan` — `colName` is less than `value`
  • `greaterThanEqual` — `colName` is greater than or equal to `value`
  • `lessThanEqual` — `colName` is less than or equal to `value`
| **Action** | Property | Type | Description | | --------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | String | The type of action to perform when the notification is invoked. Possible values are:
  • `postToSlack` — Post to a Slack channel
  • `sendEmail` — Send an email to `recipients`
| | `configuration` | [Configuration[]](analytics-api-notifications-reference-list.md#analytics-notification-list) | Specifies important attributes for resources related to the notification. | **Configuration** | Property | Type | Description | | ------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `attachment` | String | Specifies whether a Lightning Experience report subscription includes an attachment. If it includes an attachment, also specifies the file attachment. There is only one valid value:
  • `excel` — Attach report results to the email as a spreadsheet formatted as a `.XLSX` file. Do not include record-level details in the subscription email.
If the Lightning report subscription does not include an attachment, then the `attachment` property is not returned. When the `attachment` property is not returned, HTML-formatted report results are included directly in the subscription email body. | | `recipients` | [Recipient[]](analytics-api-notifications-reference-list.md#analytics-notification-list) | A list of users, roles, and groups who receive the notification. | | `summaryOnly` | Boolean | Applies when threshold type is `condition` and `source=LightningReportSubscribe`. If `true`, emails the notification summary without the report table. If `false` or `null`, emails the summary and report table. | | `team` | [Team](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-notifications-reference-list.md#analytics-notification-list) | The team of notification recipients. | **Recipient** | Property | Type | Description | | ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- | | `id` | String | Specifies who receives the notification. Valid values are the unique id of a user, role, or group. | | `displayName` | String | The `displayName` of the user, role, or group. | | `type` | String | Type of recipient. Possible values are:
  • `collaborationRoom` — A collaboration room.
  • `user` — A individual user.
| **Team** | Property | Type | Description | | ------------ | ------ | --------------------------------------- | | `platformId` | String | Specifies the id of the Slack platform. | **WaveConfiguration** | Property | Type | Description | | ---------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- | | `anchor` | String | Optional. The Id of the Analytics dashboard widget to which the notification is anchored. | | `filter` | String | Optional. Description of selected filters at the time of notification creation. | | `query` | String | Required. SAQL query which is run when the notification is invoked. | | `datasets` | [WaveDataset[]](analytics-api-notifications-reference-list.md#analytics-notification-list) | Required. Collection of Analytics datasets referenced by the notification. | **WaveDataset** | Property | Type | Description | | ----------- | ------ | -------------------------------------------------- | | `id` | String | Required. Id of the Analytics dataset. | | `name` | String | Optional. Developer name of the Analytics dataset. | | `namespace` | String | Optional. Namespace of the Analytics dataset. | ## PUT Request Body A notification object with desired changes. Uses the same format as the GET response body. ## PUT Response Body An analytics notification object reflecting saved changes. Uses the same format as the GET response body. ## DELETE Response Body The analytics notification is deleted, and can't be recovered. Returns an empty response body. # Analytics Notification Limits Check to see how many more analytics notifications you can create. ## Syntax **URI:** `/services/data/vXX.X/analytics/notifications/limits?source=source` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Check how many analytic notifications you have, and the maximum number you can have.| **Parameters** |Parameter|Description| |---------|-----------| |`source`|Required for `GET` calls. Specifies what type of analytics notification to return. Valid values are:
  • `lightningDashboardSubscribe` — dashboard subscriptions
  • `lightningReportSubscribe` — report subscriptions
  • `waveNotification` — Analytics notifications
| |`recordId`|Optional. Return notifications for a single record. Valid values are:
  • `reportId`— Unique report ID
  • `lensId`— Unique Analytics lens ID
| ## GET Response Body |Property|Type|Description| |--------|----|-----------| |`max`|Integer|How many analytics notifications of the type specified by `source` the user is allowed to create.| |`remaining`|Integer|How many more analytics notifications of the type specified by `source` the user can create before hitting the limit.| # Analytics Notification List Return a list of analytics notifications (`GET`) or create an analytics notification (`POST`). ## Syntax **URI:** `/services/data/vXX.X/`analytics/notifications?source=source **Formats:** JSON **HTTP methods** | Method | Description | | ------ | ------------------------------------------ | | `GET` | Returns a list of analytics notifications. | | `POST` | Create an analytics notification. | **Parameters** | Parameter | Description | | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `source` | Required for `GET` calls. Specifies what type of analytics notification to return. Valid values are:
  • `lightningDashboardSubscribe` — dashboard subscriptions
  • `lightningReportSubscribe` — report subscriptions
  • `waveNotification` — Analytics notifications
| | `ownerId` | Optional for `GET` calls. Allows users with Manage Analytics Notifications permission to get notifications for another user with the specified `ownerId`. | | `recordId` | Optional. Return notifications for a single record. Valid values are:
  • `reportId`— Unique report ID
  • `lensId`— Unique Analytics lens ID
| ## GET and POST Response Body An array of notification objects. Each object contains the following fields: | Property | Type | Description | | --------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `active` | Boolean | Indicates whether the notification is being sent (`true`) or not (`false`). | | `configuration` | [WaveConfiguration[]](#analytics-notification-list) | Describes details of a Analytics notification. Only applicable when `source` is `waveNotification`. | | `createdDate` | DateTime | Date and time when the notification was created (in ISO 8601 format). | | `deactivateOnTrigger` | Boolean | Indicates whether the notification is deactivated after it's sent (`true`) or not (`false`). Deactivation doesn't delete the notification. The default value is `false`. | | `id` | String | Unique notification ID. | | `lastModifiedDate` | DateTime | Date and time when the notification was last modified (in ISO 8601 format). | | `name` | String | Display name of the notification. | | `recordId` | String | Unique ID of the record that the notification describes. Valid values are:
  • `reportId`
  • `lensId`
| | `runAs` | [runAs](#analytics-notification-list) | The person who runs the report in a report subscription. Report recipients see data in the emailed report that this person has access to in Salesforce. Available in API version 40.0 and later. Only appears if you have the “Subscribe to Reports: Add Recipients” user perm. | | `schedule` | [Schedule](#analytics-notification-list) | Details about the notification's schedule. | | `source` | String | Indicates the type of notification. Possible values are:
  • `lightningSubscribe` — report subscriptions
  • `lightningDashboardSubscribe` — dashboard subscriptions
  • `lightningReportSubscribe` — report subscriptions
  • `waveNotification` — Analytics notifications
| | `thresholds` | [Threshold[]](#analytics-notification-list) | Specifies what happens when the notification runs. For example, sending an email with report results. | **runAs** | Property | Type | Description | | -------- | ------ | --------------------------------------- | | `id` | String | The person’s unique Salesforce user ID. | | `name` | String | The person’s first and last name. | **Schedule** | Property | Type | Description | | --------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `frequency` | String | How frequently the notification is invoked. Possible values are:
  • `daily` — Every day
  • `weekly` — One or more days each week
  • `monthly` — One or more days each month
| | `frequencyType` | String | Only necessary when `frequency` is `monthly`. Possible values are:
  • `relative` — Days which can change month-to-month, as described by `details`.
  • `specific` — Fixed monthly dates, as described by `details`.
| | `details` | [ScheduleDetail[]](#analytics-notification-list) | Describes the notification schedule. Varies depending on whether `frequency` is `daily`, `weekly`, or `monthly`. | **ScheduleDetail (`frequency` is `daily`)** | Property | Type | Description | | -------- | ------- | ---------------------------------------------------------------------------------------------------- | | `time` | Integer | The hour of the day at which the notification is invoked. Possible values are integers from 0 to 23. | **ScheduleDetail (`frequency` is `weekly`)** | Property | Type | Description | | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `time` | Integer | The hour of the day at which the notification is invoked. Possible values are integers from 0 to 23. | | `daysOfWeek` | String[] | The days of the week on which the notification is invoked. Possible values are:
  • `mon` — Monday
  • `tue` — Tuesday
  • `wed` — Wednesday
  • `thu` — Thursday
  • `fri` — Friday
  • `sat` — Saturday
  • `sun` — Sunday
| **ScheduleDetail (`frequency` is `monthly`, `frequencyType` is `relative`)** | Property | Type | Description | | ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `time` | Integer | The hour of the day at which the notification is invoked. Possible values are integers from 0 to 23. | | `weekInMonth` | String | The week in the month during which the notification is invoked. Possible values are:
  • `first` — First week
  • `second` — Second week
  • `third` — Third week
  • `fourth` — Fourth week
| | `dayInWeek` | String | The day of the week on which the notification is invoked. Possible values are:
  • `mon` — Monday
  • `tue` — Tuesday
  • `wed` — Wednesday
  • `thu` — Thursday
  • `fri` — Friday
  • `sat` — Saturday
  • `sun` — Sunday
  • `weekday` — Weekday
  • `weekend` — Weekend day
| **ScheduleDetail (`frequency` is `monthly`, `frequencyType` is `specific`)** | Property | Type | Description | | ------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `time` | Integer | The hour of the day at which the notification is invoked. Possible values are integers from 0 to 23. | | `daysOfMonth` | Integer[] | The days of the month on which the notification is invoked. Possible values are integers from 1 to 31, and -1 (which represents the last day of the month). | **Threshold** | Property | Type | Description | | ------------ | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `actions` | [Action[]](#analytics-notification-list) | Specifies what action is taken when the notification is invoked. | | `conditions` | [Condition[]](#analytics-notification-list) | Describes conditions that govern when the notification is invoked. | | `type` | String | Specifies when the notification is invoked (other than date and time criteria). Possible values are:
  • `always` — Always invoke the notification
  • `onError` — Invoke the notification when there is an error
  • `condition` — Invoke the notification based on criteria described by `conditions`
| **Condition** | Property | Type | Description | | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `colName` | String | The data field which is operated on. | | `value` | String | The comparison value which is used by the operation. | | `operation` | String | The operation which is used to evaluate the condition. Possible values are:
  • `equal` — `colName` and `value` are equal
  • `notEqual` — `colName` and `value` are not equal
  • `greaterThan` — `colName` is greater than `value`
  • `lessThan` — `colName` is less than `value`
  • `greaterThanEqual` — `colName` is greater than or equal to `value`
  • `lessThanEqual` — `colName` is less than or equal to `value`
| **Action** | Property | Type | Description | | --------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | String | The type of action to perform when the notification is invoked. Possible values are:
  • `postToSlack` — Post to a Slack channel
  • `sendEmail` — Send an email to `recipients`
| | `configuration` | [Configuration[]](#analytics-notification-list) | Specifies important attributes for resources related to the notification. | **Configuration** | Property | Type | Description | | ------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `attachment` | String | Specifies whether a Lightning Experience report subscription includes an attachment. If it includes an attachment, also specifies the file attachment. There is only one valid value:
  • `excel` — Attach report results to the email as a spreadsheet formatted as a `.XLSX` file. Do not include record-level details in the subscription email.
If the Lightning report subscription does not include an attachment, then the `attachment` property is not returned. When the `attachment` property is not returned, HTML-formatted report results are included directly in the subscription email body. | | `recipients` | [Recipient[]](#analytics-notification-list) | A list of users, roles, and groups who receive the notification. | | `summaryOnly` | Boolean | Applies when threshold type is `condition` and `source=LightningReportSubscribe`. If `true`, emails the notification summary without the report table. If `false` or `null`, emails the summary and report table. | | `team` | [Team](#analytics-notification-list) | The team of notification recipients. | **Recipient** | Property | Type | Description | | ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- | | `id` | String | Specifies who receives the notification. Valid values are the unique id of a user, role, or group. | | `displayName` | String | The `displayName` of the user, role, or group. | | `type` | String | Type of recipient. Possible values are:
  • `collaborationRoom` — A collaboration room.
  • `user` — A individual user.
| **Team** | Property | Type | Description | | ------------ | ------ | --------------------------------------- | | `platformId` | String | Specifies the id of the Slack platform. | **WaveConfiguration** | Property | Type | Description | | ---------- | --------------------------------------------- | ----------------------------------------------------------------------------------------- | | `anchor` | String | Optional. The Id of the Analytics dashboard widget to which the notification is anchored. | | `filter` | String | Optional. Description of selected filters at the time of notification creation. | | `query` | String | Required. SAQL query which is run when the notification is invoked. | | `datasets` | [WaveDataset[]](#analytics-notification-list) | Required. Collection of Analytics datasets referenced by the notification. | **WaveDataset** | Property | Type | Description | | ----------- | ------ | -------------------------------------------------- | | `id` | String | Required. Id of the Analytics dataset. | | `name` | String | Optional. Developer name of the Analytics dataset. | | `namespace` | String | Optional. Namespace of the Analytics dataset. | ## POST Request Body Uses the same format as the GET and POST response body. # Analytics Notifications Use the Analytics Notifications API to work set up custom analytics notifications. The Analytics Notifications API is available in API version 38.0 and later. Resources for the Analytics Notifications API are available at `/services/data//analytics/notifications`. You can query each resource with an `HTTP` method.
Resource Supported HTTP Method Description
Analytics Notification List

/services/data/<span><latest API version></span>/analytics/notifications

GET

POST

Returns a list of recent notifications.

Create an analytics notification.

Analytics Notification

/services/data/<span><latest API version></span>/analytics/notifications/<span><Id></span>

GET

PUT

DELETE

Returns information about a specific notification.

Save changes to the notification as specified in the request body.

Delete the notification. Deleted notifications can't be recovered.

Analytics Notification Limits

/services/data/<span><latest API version></span>/analytics/notifications/limits

GET Check to see how many more analytics notifications you can create.
# analytics query Execute an Analytics query. ## Examples for analytics query ```nolang sf analytics query -f query.saql ``` ```nolang sf analytics query -f query.sql -t America/Denver ``` ```nolang sf analytics query -q "..." --sql --limit 10 -r csv ``` ## Command Syntax - `sf analytics query` - : [`--json`] [`--apiversion` APIVERSION] `-o` TARGETORG [`-f` QUERYFILE] [`-q` QUERY] [`--nomapnames`] [`--sql`] [`-t` TIMEZONE] [`--connector` CONNECTOR] [`--limit` LIMIT] [`-r` RESULTFORMAT] ## Parameters - `--json` - : Optional Format output as JSON. Type: boolean - `--api-version` APIVERSION - : Optional Override the API version used for API requests made by this command. Type: string - `-o` TARGETORG - : Required Username or alias of the target org. Not required if the target-org configuration variable is set. Type: string - `-f` | `--queryfile` QUERYFILE - : Optional Path to the file containing the query to execute. Type: filepath - `-q` | `--query` QUERY - : Optional The query to execute. Type: string - `--nomapnames` - : Optional Skip mapping dataset names in the SAQL query to ids. Type: boolean - `--sql` - : Optional Execute the query as SQL. Type: boolean - `-t` | `--timezone` TIMEZONE - : Optional The timezone for the query. Type: string - `--connector` CONNECTOR - : Optional Execute the SQL query against this external data connector id or name. Type: string - `--limit` LIMIT - : Optional The maximum number of rows to include. Type: number - `-r` | `--resultformat` RESULTFORMAT - : Optional Result format emitted to stdout. Type: enum Permissible values are: human, csv, json Default value: human # Analytics SAQL Developer Guide Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | ----------------------------------------------------------------------------------------------------- | | 68.0 | Winter '27 | [Download PDF](https://resources.docs.salesforce.com/264/latest/en-us/sfdc/pdf/bi_dev_guide_saql.pdf) | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_saql.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_saql.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_saql.pdf) | | 64.0 | Summer '25 | [Download PDF](https://resources.docs.salesforce.com/256/latest/en-us/sfdc/pdf/bi_dev_guide_saql.pdf) | # Analytics SAQL Release Notes Use the Salesforce Release Notes to learn about the most recent updates and changes to Analytics SAQL. For a list of all current developer changes, including Analytics SAQL, see [CRM Analytics](https://help.salesforce.com/s/articleView?id=release-notes.rn_bi_analytics_cloud.htm) in the Salesforce Release Notes. **note:** If the Analytics Development section in the Salesforce Release Notes isn’t present, there aren’t any updates for that release. # Analytics SDK Developer Guide Overview Use the Analytics SDK features to embed CRM Analytics functionality directly where your users work everyday, without having to transition between Lightning Experience and CRM Analytics Studio. The Analytics SDK lets you communicate and interact with CRM Analytics assets from Lightning Apps, Lightning Web Components, Apex, Visualforce, and more. You can create one cohesive experience powered by CRM Analytics features directly in Salesforce pages and apps. **important:** The CRM Analytics SDK and all its components require the purchase of CRM Analytics Platform licenses. ## CRM Analytics Lightning Web Components Are you ready to use the power of CRM Analytics directly inside Lightning Experience and create your own custom CRM Analytics functionality? By using theCRM Analytics Lightning Web Components, you can access the power of REST APIs to retrieve collections of CRM Analytics data assets, execute queries and schedule data syncs for recipes and dataflows. ## CRM Analytics Assets SDK Aura Component Use the CRM Analytics `` Aura Component to retrieve collections of CRM Analytics assets, such as dashboards, lenses, and datasets and describe the details of individual assets. Then, customize the display of the results via a Lightning Component controller. You can also create dynamic SAQL queries against your CRM Analytics data to display runtime results. ## CRM Analytics Templates SDK Aura Component You have great apps, and you’re creating app templates to copy or distribute those apps. And you might even be using the REST APIs to work with templates and folders. By using the CRM Analytics `` Aura Component template methods, your application can do many of the same things from a Lightning Component controller. ## CRM Analytics Aura Events Would you like your application to communicate with your CRM Analytics dashboards, whether your application is built with the Lightning SDK, Visualforce, or mobile? How about from an application outside of Salesforce? Wouldn’t it be great if your application could apply filters or know about dashboard selections and filters made by a user? Your application could take actions specific for your business when values fall outside of defined ranges. Or you could have an application that is a viewpoint for dashboards made available by different parts of your business application ecosystem. Imagine that: a single information source to present to your executive staff! The CRM Analytics Aura events are the foundation for a new way of thinking about CRM Analytics applications. Coupled with the [Lightning Locker](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/security_code.htm), you can even code your application outside of Salesforce—you can interact with CRM Analytics from any JavaScript application. ## CRM Analytics in Apex Is your company one of the gazillion using custom code in Apex, the server-side programming language for Lightning Platform? Would you like it to be easier to query data in CRM Analytics directly from your Apex code? Say hello to the CRM Analytics in Apex features. CRM Analytics in Apex lets developers build well-formed SAQL queries and execute them in the security context of the logged-in user, ensuring that security settings are honored. API versioning is supported to avoid breaking applications as the feature set evolves. Use `Wave.Lenses` to list and describe CRM Analytics lens assets. CRM Analytics also offers `Wave.InvalidParameterException` to help catch bad values supplied to the class methods. - **[CRM Analytics Lightning Web Components](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-lwc.md)** Use CRM Analytics Lightning Web Components to retrieve data and metadata for CRM Analytics assets, execute queries, and schedule data syncs for recipes, dataflows, and data connectors. - **[CRM Analytics Assets SDK Aura Component](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-asset.md)** Discover CRM Analytics dashboards, lenses and datasets, get their details, and dig into dataset fields. Discover dashboard saved views and explore dashboard state. Create and execute queries directly on datasets - **[CRM Analytics Template SDK Aura Component](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-template.md)** Discover CRM Analytics templates and apps created from them. Create, update, and delete CRM Analytics apps created from templates. - **[CRM Analytics Aura Events](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-web.md)** Easily interact with the embedded CRM Analytics Dashboard component in custom applications. Use Aura Events for Lightning Apps, Visualforce, or your preferred development environment. - **[CRM Analytics in Apex](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-apex.md)** Build and execute queries and retrieve lens and template data using CRM Analytics Apex classes and methods. # Analytics SDK Developer Guide Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | ---------------------------------------------------------------------------------------------------- | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_sdk.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_sdk.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_sdk.pdf) | | 64.0 | Summer '25 | [Download PDF](https://resources.docs.salesforce.com/256/latest/en-us/sfdc/pdf/bi_dev_guide_sdk.pdf) | # Analytics SDK Release Notes Use the Salesforce Release Notes to learn about the most recent updates and changes to the Analytics SDK. The Analytics SDK covers different tool sets, including Lightning Web Components, Aura components, Aura events, and Apex classes. For a list of all current developer changes, see [CRM Analytics](https://help.salesforce.com/s/articleView?id=release-notes.rn_bi_analytics_cloud.htm) in the Salesforce Release Notes. **note:** If the Analytics Development section in the Salesforce Release Notes isn’t present, there aren’t any updates for that release. # Analytics Templates Developer Guide Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | --------------------------------------------------------------------------------------------------------------- | | 68.0 | Winter '27 | [Download PDF](https://resources.docs.salesforce.com/264/latest/en-us/sfdc/pdf/bi_dev_guide_wave_templates.pdf) | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_wave_templates.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_wave_templates.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_wave_templates.pdf) | | 64.0 | Summer '25 | [Download PDF](https://resources.docs.salesforce.com/256/latest/en-us/sfdc/pdf/bi_dev_guide_wave_templates.pdf) | # Analytics Templates Release Notes Use the Salesforce Release Notes to learn about the most recent updates and changes to Analytics Templates. Analytics Templates use several different tool sets, including the CRM Analytics Connect REST API, the Salesforce Analytics CLI Plugin, Apex classes, and Lightning Web Components. For a list of all current developer changes, see [CRM Analytics](https://help.salesforce.com/s/articleView?id=release-notes.rn_bi_analytics_cloud.htm) in the Salesforce Release Notes. **note:** If the Analytics Development section in the Salesforce Release Notes isn’t present, there aren’t any updates for that release. # analytics\:enable (Deprecated) Enable Analytics. **warning:** As of April 20, 2023, we no longer maintain this section of the command reference. Refer to the [reference information about the `sf`-style commands](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_cli_reference.meta/bi_dev_guide_cli_reference/bi_cli_reference_analytics_unified.htm) instead, which we update regularly. We keep this reference information about the `sfdx`-style commands as-is for historical reference only. The `sfdx`-style commands continue to work the same as before, and any scripts that use the commands won’t break. However, we recommend that you start using the equivalent [`sf`-style commands](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_cli_reference.meta/bi_dev_guide_cli_reference/bi_cli_reference_analytics_unified.htm). The reference page for each `sfdx` command has been updated with information about its equivalent `sf` command. The page also shows how the flag names have changed between the `sfdx` and `sf` commands. Use this information to migrate your scripts. For background information about this change, read [this blog post](https://developer.salesforce.com/blogs/2022/12/big-improvements-coming-to-the-salesforce-cli), which describes how we've updated many of the existing `sfdx` commands to use the improvements we made in `sf` commands. To view all the changes, read the CLI release notes starting with version 7.183.1 on [January 12, 2023](https://github.com/forcedotcom/cli/blob/main/releasenotes/sfdx/README.md#71831-jan-12-2023). ## Examples for analytics\:enable ```nolang sfdx analytics:enable ``` ## Command Syntax - `sfdx analytics:enable` - : [`--json`] [`--loglevel` LOGLEVEL] [`-u` TARGETUSERNAME] [`--apiversion` APIVERSION] [`-a`] [`-w` WAIT] [`-p` POLLINTERVAL] ## Parameters - `--json` - : Optional Format output as JSON. Type: boolean - `--loglevel` LOGLEVEL - : Optional The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log. Type: enum Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL Default value: warn - `-u` | `--targetusername` TARGETUSERNAME - : Optional A username or alias for the target org. Overrides the default target org. Type: string - `--apiversion` APIVERSION - : Optional Override the API version used for API requests made by this command. Type: string - `-a` | `--async` - : Optional Enable asynchronously. Type: boolean - `-w` | `--wait` WAIT - : Optional Wait time in minutes for auto-install request to finish (default 10). Type: number Default value: 10 - `-p` | `--pollinterval` POLLINTERVAL - : Optional Polling interval in milliseconds for checking auto-install request status (default 5000). Type: number Default value: 5000 # analytics\:query (Deprecated) Execute an Analytics query. **warning:** As of April 20, 2023, we no longer maintain this section of the command reference. Refer to the [reference information about the `sf`-style commands](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_cli_reference.meta/bi_dev_guide_cli_reference/bi_cli_reference_analytics_unified.htm) instead, which we update regularly. We keep this reference information about the `sfdx`-style commands as-is for historical reference only. The `sfdx`-style commands continue to work the same as before, and any scripts that use the commands won’t break. However, we recommend that you start using the equivalent [`sf`-style commands](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_cli_reference.meta/bi_dev_guide_cli_reference/bi_cli_reference_analytics_unified.htm). The reference page for each `sfdx` command has been updated with information about its equivalent `sf` command. The page also shows how the flag names have changed between the `sfdx` and `sf` commands. Use this information to migrate your scripts. For background information about this change, read [this blog post](https://developer.salesforce.com/blogs/2022/12/big-improvements-coming-to-the-salesforce-cli), which describes how we've updated many of the existing `sfdx` commands to use the improvements we made in `sf` commands. To view all the changes, read the CLI release notes starting with version 7.183.1 on [January 12, 2023](https://github.com/forcedotcom/cli/blob/main/releasenotes/sfdx/README.md#71831-jan-12-2023). ## Examples for analytics\:query ```nolang sfdx analytics:query -f query.saql ``` ```nolang sfdx analytics:query -f query.sql -t America/Denver ``` ```nolang sfdx analytics:query -q "..." --sql --limit 10 -r csv ``` ## Command Syntax - `sfdx analytics:query` - : [`--json`] [`--loglevel` LOGLEVEL] [`-u` TARGETUSERNAME] [`--apiversion` APIVERSION] [`-f` QUERYFILE] [`-q` QUERY] [`--nomapnames`] [`--sql`] [`-t` TIMEZONE] [`--connector` CONNECTOR] [`--limit` LIMIT] [`-r` RESULTFORMAT] ## Parameters - `--json` - : Optional Format output as JSON. Type: boolean - `--loglevel` LOGLEVEL - : Optional The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log. Type: enum Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL Default value: warn - `-u` | `--targetusername` TARGETUSERNAME - : Optional A username or alias for the target org. Overrides the default target org. Type: string - `--apiversion` APIVERSION - : Optional Override the API version used for API requests made by this command. Type: string - `-f` | `--queryfile` QUERYFILE - : Optional Path to the file containing the query to execute. Type: filepath - `-q` | `--query` QUERY - : Optional The query to execute. Type: string - `--nomapnames` - : Optional Skip mapping dataset names in the SAQL query to ids. Type: boolean - `--sql` - : Optional Execute the query as SQL. Type: boolean - `-t` | `--timezone` TIMEZONE - : Optional The timezone for the query. Type: string - `--connector` CONNECTOR - : Optional Execute the SQL query against this external data connector id or name. Type: string - `--limit` LIMIT - : Optional The maximum number of rows to include. Type: number - `-r` | `--resultformat` RESULTFORMAT - : Optional Result format emitted to stdout. Type: enum Permissible values are: human, csv, json Default value: human # Analyze Your Data Over Time Use SAQL date functions for advanced time-based analysis. **note:** You can use date filters in the dashboard for basic time-based analysis, for example to calculate month-to-date amounts. You can also use window functions in the dashboard for basic date range calculations, such as calculating the change in year-over-year earnings ## Example - on Which Weekday Do Customers Send the Most Emails? Suppose that you want to see which day of the week your customers are most active on email. This information allows you to better target your email campaigns. Use `day_in_week()` on the `Mail_sent_sec_epoch` field to calculate the day of the week, then count the number of records for each day. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = foreach q generate day_in_week(toDate(’Mail_sent_sec_epoch’)) as 'Day in Week'; q = group q by 'Day in Week'; q = foreach q generate 'Day in Week', count() as 'count'; ``` In this case, email traffic is slightly higher on day 4 (Wednesday) and day 7 (Sunday). ![Derived dimension shows time to win](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_num_emails.png) **See Also** - [Date Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-date.md) # apex Step Type Properties Use to include custom Apex functionality in a dashboard to access Salesforce platform features that aren’t inherently supported in Analytics. For example, pull in data using any API, manipulate data using your Apex classes, or apply simple case statements or complex machine learning. You can even harness AppExchange for things like integrating Twitter with Analytics—all in a way that is familiar. To set up an `apex` step, create an Apex class that returns data in a shape that Analytics can consume. And then define the step with the `apex` step type in the dashboard JSON. The step calls the Apex REST endpoint to return the data from the Apex controller class. Like a `soql` step, the Apex controller can return tabular data. Unlike `saql` and `soql` step types, the `apex` step type doesn’t define the `"strings"`, `"numbers"`, and `"groups"` arrays. The Apex class response must declare these column types. When you define an `apex` step, you can use a selection or results binding on the `body` parameter in the step JSON. You can also reference this step type in a results binding. This step type doesn’t support faceting. If you run a Analytics REST API query using an `apex` step, the query runs as the logged-in user. Each REST API query counts against the org’s API limits. Note the following limitations with `apex` steps: - If you include dashboards in a package, `apex` steps aren’t included. You must migrate the Apex classes separately. - The Android mobile app doesn’t support this type of step. | Field Name | Description | | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | Step type. Set to `apex`. | | `label` | Step label, which is primarily used for display in the dashboard designer user interface. | | `query` | Query that returns the results. Can consist of the these parameters:
  • `body` — Optional. Blob containing the input parameters needed by the Apex controller class.
  • `path` — Required. Specifies the class path and name of the Apex controller class.
| ## Example: apex Step ```nolang "GetStockData": { "query": { "body": { "symbol": "CRM" }, "path": "stocks" }, "type": "apex" } ``` ## Example: Display Real-Time Stock Data You want to display real-time stock data from a website in your dashboard. You want to fetch the data from an external API and add logic to determine the time of day for each stock price. Here’s the goal for this dashboard. ![The toggle in the dashboard allows you to choose a company, which filters the results in the table and chart, and changes the displayed stock symbol.](https://developer.salesforce.com/docs/media/bi_dev_guide_json/bi_dashboards_stock_data_dashboard.png) To create this dashboard, complete the following steps: 1. Create the Apex controller class that gets the data from the stock website. 2. Add the stock website to the allowed sites in Salesforce. 3. Create the `apex` step in addition to the other dashboard widgets. ## Create the Apex Class Define the Apex controller class and methods that return the stock price for different companies over time. 1. From setup, enter `Apex Classes` in the Quick Find box, and select **Apex Classes**. 2. Click **New**. ![You can create new Apex classes from this page.](https://developer.salesforce.com/docs/media/bi_dev_guide_json/bi_dashboards_apex_classes_new.png) 3. Add the following code. ```nolang @RestResource(urlMapping='/stocks') global with sharing class StocksRestController { @HttpPost global static String stocks() { ApexStepRequest stepRequest = new ApexStepRequest(new ApexStepRequest.Parameter[]{ new ApexStepRequest.Parameter('symbol', ApexStepRequest.ParameterType.STRING_PARAM) }); // fetch some stock data HttpRequest request = new HttpRequest(); Http http = new Http(); // make sure this domain is whitelisted in the proxy request.setEndpoint('https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&interval=5min&apikey=1QRP8ATD7134OVMA&symbol=' // default to CRM + stepRequest.getStringParam('symbol', 'CRM') ); request.setMethod('GET'); try { HTTPResponse response = http.send(request); JSONParser parser = JSON.createParser(response.getBody()); List> returnItems = new List>(); while (parser.nextToken() != null) { if (parser.getCurrentToken() == JSONToken.START_OBJECT && parser.getCurrentName() != null && parser.getCurrentName().startsWith('20')) { String dateLabel = parser.getCurrentName(); parser.nextToken(); parser.nextToken(); System.debug(parser.getText()); Map curRow = new Map(); curRow.put('date', dateLabel); curRow.put('value', Double.valueOf(parser.getText())); returnItems.add(curRow); } } return JSON.serialize(new ApexStepResponse(returnItems)); } catch(Exception exp) { System.debug('exception '+exp); } ``` return ''; } } ``` 4. Add two more Apex classes for `ApexStepRequest` and `ApexStepResponse` to support the Apex stocks class. The code for these classes, along with the stock step code, can be found in this public [`AnalyticsApexSteps`](https://github.com/forcedotcom/AnalyticsApexSteps) GitHub repo, in the `/force-app/main/apex/common` directory. This GitHub repo also contains other Apex step examples. 5. Click **Save**. ![The StocksRestControl apex class appears.](../../../media/bi_dev_guide_json/bi_dashboards_apex_class_StocksRestController.png) ## Allow the External Website To enable Apex to query external REST endpoints, allow the website in Salesforce. 1. From setup, enter `Remote` in the Quick Find box, and select **Remote Site Settings**. 2. Click **New Remote Site**. ![The page shows all sites that are allowed.](../../../media/bi_dev_guide_json/bi_dashboards_apex_remote_site_settings.png) 3. Enter the remote site name and URL. ![The page shows the remote site name, URL, and description.](../../../media/bi_dev_guide_json/bi_dashboards_apex_remote_site_add.png) 4. Click **Save**. ## Create the Apex Step Manually define the `apex` step in the dashboard JSON to get the stock results from the Apex class that you previously created. In the dashboard JSON, add the following `apex` step. ```nolang "StockData": { "query": { "body": { "symbol": "{{cell(CompaniesList_1.selection, 0, \"value\").asString()}}" }, "path": "stocks" }, "type": "apex" } ``` The `apex` step query contains the these parameters. - `body` — The binding retrieves the stock symbol when a company is selected in the toggle widget. ![The Salesforce option is selected in the toggle widget, which filters the table and chart widgets and displays the stock symbol in the text widget.](../../../media/bi_dev_guide_json/bi_dashboards_apex_example_toggle_widget.png) - `path` — Specifies the REST API resource path to the Apex controller, as specified in the `urlMapping` of the `RestResource` annotation on the Apex controller. The dashboard shows four widgets. The toggle widget is based on a static step that maps predefined company names to stock symbols. The table widget and line chart use the `apex` step to retrieve the results. The text widget uses a binding to concatenate “Selected symbol:” and the stock symbol of the selected company in the toggle widget. Here’s the final dashboard JSON. ```nolang { "label": "Stock Quotes", "mobileDisabled": false, "state": { "dataSourceLinks": [], "filters": [], "gridLayouts": [ { "name": "Default", "numColumns": 12, "pages": [ { "label": "Untitled", "name": "b177a6e6-8ab6-4914-af36-09c7fa23e0c8", "widgets": [ { "colspan": 6, "column": 0, "name": "pillbox_1", "row": 0, "rowspan": 1, "widgetStyle": { "borderEdges": [] } }, { "colspan": 5, "column": 7, "name": "text_1", "row": 0, "rowspan": 1, "widgetStyle": { "borderEdges": [] } }, { "colspan": 6, "column": 0, "name": "table_1", "row": 1, "rowspan": 7, "widgetStyle": { "borderEdges": [] } }, { "colspan": 6, "column": 6, "name": "chart_1", "row": 1, "rowspan": 7, "widgetStyle": { "borderEdges": [] } } ] } ], "rowHeight": "normal", "selectors": [], "style": { "alignmentX": "left", "alignmentY": "top", "backgroundColor": "#F2F6FA", "cellSpacingX": 8, "cellSpacingY": 8, "fit": "original", "gutterColor": "#C5D3E0" }, "version": 1 } ], "layouts": [], "steps": { "CompaniesList_1": { "datasets": [], "dimensions": [], "groups": [], "label": "CompaniesList", "numbers": [], "selectMode": "singlerequired", "strings": [], "type": "staticflex", "values": [ { "display": "Salesforce", "value": "CRM" }, { "display": "Apple", "value": "AAPL" }, { "display": "Oracle", "value": "ORCL" }, { "display": "Twitter", "value": "TWTR" }, { "display": "Facebook", "value": "FB" } ], "broadcastFacet": true }, "StockData": { "query": { "body": { "symbol": "{{cell(CompaniesList_1.selection, 0, \"value\").asString()}}" }, "path": "stocks" }, "type": "apex" } }, "widgetStyle": { "backgroundColor": "#FFFFFF", "borderColor": "#E6ECF2", "borderEdges": [], "borderRadius": 0, "borderWidth": 1 }, "widgets": { "table_1": { "parameters": { "borderColor": "#e0e5ee", "borderWidth": 1, "cell": { "backgroundColor": "#ffffff", "fontColor": "#16325c", "fontSize": 12 }, "columns": [], "customBulkActions": [], "exploreLink": false, "header": { "backgroundColor": "#f4f6f9", "fontColor": "#16325c", "fontSize": 12 }, "innerMajorBorderColor": "#a8b7c7", "innerMinorBorderColor": "#e0e5ee", "mode": "fittocontainer", "numberOfLines": 1, "step": "StockData", "verticalPadding": 8, "evenRowColor": null, "oddRowColor": null }, "type": "table" }, "pillbox_1": { "parameters": { "compact": false, "exploreLink": false, "step": "CompaniesList_1" }, "type": "pillbox" }, "text_1": { "parameters": { "fontSize": 20, "text": "Selected symbol: {{ cell(CompaniesList_1.selection, 0, \"value\").asString() }}", "textAlignment": "center", "textColor": "#091A3E" }, "type": "text" }, "chart_1": { "parameters": { "autoFitMode": "keepLabels", "showPoints": false, "legend": { "showHeader": true, "show": true, "customSize": "auto", "position": "right-top", "inside": false }, "axisMode": "multi", "tooltip": { "showBinLabel": true, "measures": "", "showPercentage": false, "showDimensions": true, "showMeasures": true, "customizeTooltip": false, "dimensions": "" }, "visualizationType": "line", "dashLine": { "measures": "", "showDashLine": false }, "exploreLink": false, "title": { "fontSize": 14, "subtitleFontSize": 11, "label": "", "align": "center", "subtitleLabel": "" }, "trellis": { "flipLabels": false, "showGridLines": true, "size": [ 100, 100 ], "enable": false, "type": "x", "chartsPerLine": 4 }, "fillArea": true, "showZero": true, "measureAxis2": { "sqrtScale": false, "showTitle": true, "showAxis": true, "title": "", "customDomain": { "showDomain": false } }, "measureAxis1": { "sqrtScale": false, "showTitle": true, "showAxis": true, "title": "", "customDomain": { "showDomain": false } }, "theme": "wave", "step": "StockData", "dimensionAxis": { "showTitle": true, "customSize": "auto", "showAxis": true, "title": "", "icons": { "useIcons": false, "iconProps": { "fit": "cover", "column": "", "type": "round" } } }, "drawArea": { "measure": "", "showDrawArea": false, "bounding1": "", "bounding2": "" } }, "type": "chart" } } }, "datasets": [] } ``` # API End-of-Life Policy Salesforce is committed to supporting each API version for a minimum of three years from the date of first release. In order to mature and improve the quality and performance of the API, versions that are more than three years old might cease to be supported. When an API version is to be deprecated, advance notice is given at least one year before support ends. Salesforce will directly notify customers using API versions planned for deprecation. |Salesforce API Versions|Version Support Status|Version Retirement Info| |-----------------------|----------------------|-----------------------| |Versions 31.0 through 66.0|Supported.| | |Versions 21.0 through 30.0|As of Summer ’25, these versions are retired and unavailable.|[Salesforce Platform API Versions 21.0 through 30.0 Retirement](https://help.salesforce.com/s/articleView?id=000389618&type=1)| |Versions 7.0 through 20.0|As of Summer ’22, these versions are retired and unavailable.|[Salesforce Platform API Versions 7.0 through 20.0 Retirement](https://help.salesforce.com/s/articleView?id=000380623&type=1)| If you request any resource or use an operation from a retired API version, REST API returns `410:GONE` error code. To identify requests made from old or unsupported API versions of REST API, access the free API Total Usage event type. # API End-of-Life Policy Salesforce is committed to supporting each API version for a minimum of three years from the date of first release. In order to mature and improve the quality and performance of the API, versions that are more than three years old might cease to be supported. When an API version is to be deprecated, advance notice is given at least one year before support ends. Salesforce will directly notify customers using API versions planned for deprecation. | Salesforce API Versions | Version Support Status | Version Retirement Info | | ---------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | Versions 31.0 through 66.0 | Supported. |   | | Versions 21.0 through 30.0 | As of Summer ’25, these versions are retired and unavailable. | [Salesforce Platform API Versions 21.0 through 30.0 Retirement](https://help.salesforce.com/s/articleView?id=000389618&type=1) | | Versions 7.0 through 20.0 | As of Summer ’22, these versions are retired and unavailable. | [Salesforce Platform API Versions 7.0 through 20.0 Retirement](https://help.salesforce.com/s/articleView?id=000380623&type=1) | If you request any resource or use an operation from a retired API version, REST API returns `410:GONE` error code. To identify requests made from old or unsupported API versions of REST API, access the free API Total Usage event type. # App Template Framework Overview A purpose-built app development & management framework for ongoing analytic app success, built on Data 360, Tableau Next, and the Salesforce Platform. --- **GOAL: Make analytics, flows, and other features work out of the box as trusted solutions, so customers can drive business action.** --- ## Three Core Pillars | DEVELOP | INSTALL | MANAGE | | ---------- | --------- | -------- | | Build highly flexible, templatized apps that adapt to any customer environment.

**Key Tools:**
Template Builder
VS Code plug-in
CLI Integration
Metadata API & Packaging
Scratch Org support | Deploy apps with confidence using automated setup and data processing.

**Key Tools:**
Org Readiness Checks
Prerequisite Actions
Rules Engine
Guided Installation Wizard
Auto Install & Template APIs | Keep apps running efficiently as data and business needs evolve.

**Key Tools:**
App Hub
Monitor & Troubleshoot
Upgrades & Reconfigurations
App Refresh
App Analytics & Insights
Post-Install Actions & Notifications | ## Templatized Assets Resources that the App Template Framework can package, configure, and orchestrate as part of a template. - Tableau Next Dashboards - Tableau Next Visualizations - Tableau Next Metrics - Tableau Next Workspaces - Semantic Data Models - Salesforce Flows - Einstein Studio Models - Data 360 Transformations - Data 360 Data Streams - Data 360 DLO and DMO Mappings ## Why Use App Template Framework | Value Prop | What It Means | Example | | ---------- | --------- | -------- | | Compatibility | Produce different app flavors based on org shape and available data. | Only create an Einstein model if the org meets minimum data requirements. | | Flexibility | Take customer input via a built-in installation wizard. | Manipulate formulas in data transforms or set viz params based on user input. | | Day 0 Guarantee | All components are immediately operational upon installation. | Orchestrate data ingest & transforms to provision data not shipped with the app. | | Adaptive Longevity | Seamless updates & reconfigurations after initial installation. | Data & orgs change over time; the app adapts to those changes automatically. | ## Tableau Next Platform Layers App Template Framework supports the Tableau Next intelligent application stack. - **Salesforce Platform**: Trusted, intelligent, collaborative, composable foundation - **Salesforce Data 360**: Build or bring your own lake for unified, real-time, cloud-scale data - **Tableau Semantics**: Augment data with AI and consistent business knowledge - **Viz / Pulse Engagement Layer**: AI-powered visualization widgets delivered in the flow of work - **Actions Layer**: Automated and human-in-the-loop intelligent workflows - **Marketplace & App Exchange**: Share, monetize, and distribute Einstein apps and data assets ## Developer Ecosystem and Distribution ### Developer Tools - Template Builder - VS Code Plugin - Orchestrator CLI - Metadata API - Scratch Orgs - SF compatibility ### Embedding Framework Embed analytics into Salesforce CRM or third-party apps; bring data, AI & insights into any workflow. ### App Framework Pre-built applications, developer playground, self-healing pipelines, and composable building blocks. # Append Datasets using union You can append data from two or more data streams into a single data stream using `union`. The data streams must have the same field names and structure. To use `union`, first load the dataset and then use `foreach` to do the projection. Repeat the process with another dataset. If the two resulting data streams have an identical structure, you can append them using `union`. Let’s say that you have two opportunity datasets from different regions that you brought together using the Salesforce mulit-org connector. You want to add these datasets together to look at your pipeline as a whole. The OppsRegion1 data stream contains these fields. ![Diagram showing the first dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_union_ds1.png) The OppsRegion2 data stream contains these fields. ![Diagram showing the second dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_union_ds2.png) Use `union` to combine the two data streams. ```nolang ops1 = load "OppsRegion1"; ops1 = foreach ops1 generate 'Account_Owner', 'Account_Type', 'Amount'; ops2 = load "OppsRegion2"; ops2 = foreach ops2 generate 'Account_Owner', 'Account_Type', 'Amount'; -- ops1 and ops2 have the same structure, so we can use union opps_total = union ops1, ops2; ``` The resulting data stream contains both sets of data. ![Diagram showing the combined datasets.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_union_bothds.png) **See Also** - [union](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-union.md) # Appendix Some property names for the Report Describe and Report Execute resources have changed since version 28.0. The name changes do not affect their behavior. The properties behave as they did in version 28.0. # Appendix The reference section of this document contains detailed examples, attribute lists and descriptions, and other in-depth reference materials that build on the concepts we have discussed up to this point. - **[Add a Recipe to a CRM Analytics Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-add-recipe.md)** Data prep recipes are a unique CRM Analytics asset, as they aren’t stored in folders like dashboards, lenses, and datasets. The only way to connect a recipe to an app is via the relationship of the datasets in the folder to the recipes that consume or output those datasets. - **[Configure Recipe Execution](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-execute-recipe.md)** Data Prep recipes can be complex and add to app creation time if they sync and execute while the templated app is generating. Recipes can also change the shape of your existing data. The `executeCondition` attribute for recipe entries allows you to specify if a templated recipe syncs and executes during templated app creation or not. - **[Add an Einstein Discovery Story to a CRM Analytics Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-add-discovery-story.md)** Einstein Discovery stories can be added to an app template by referring to the story in the `template-info.json` file. - **[Add a Remote Connector to a CRM Analytics Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-add-connector.md)** Add remote connectors to the digest node of a template dataflow by referencing connectors in `variables.json` and editing `ui.json` and `rules.json`. - **[Use Live Datasets in a CRM Analytics Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-use-live-dataset.md)** Use live datasets in your CRM Analytics template with the `liveConnection` attribute to bring in live connections to Snowflake source tables. Creating a template from a source app with live datasets generates the dataset information, but there are considerations for successful app creation for your users. - **[Work with Embedded App Auto-Install Requests](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-auto-install-details.md)** Embedded app templates can create apps without any custom code, but you can add customizations to your embedded app lifecycle. Create Apex classes that use the CRM Analytics auto-installer to create and manage auto-install requests for your embedded app. - **[Feature Parameters for Analytics Templates](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-feature-parameters.md)** Feature parameters are available to control behavior in the template-to-app process for CRM Analytics apps. Feature parameters are defined as metadata that is deployed as part of the managed package. When feature parameters are deployed with the template, the parameter values are set using the LMA application. - **[template-info.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-template-info-json-attributes.md)** The `template-info.json` file is the main file that describes the template. It includes or references all the information required to create a downstream app. - **[template-info.json Example](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-template-info-json-example.md)** Here are two example `template-info.json` files. - **[ui.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-ui-json-attributes.md)** The `ui.json` file attributes are: - **[variables.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-variables-json-attributes.md)** Named nodes, each representing a single variable. Each node contains the following attributes: - **[org-readiness.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-org-readiness-json-attributes.md)** The `org-readiness.json` file attributes are: - **[folder.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-folder-json-attributes.md)** The `folder.json` file attributes are: - **[auto-install.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-auto-install-json-attributes.md)** The `auto-install.json` file attributes are: - **[rules.json Example](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-rules-json-example.md)** Refer to this example of the `rules.json` file. - **[rules.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-rules-json-attributes.md)** The `rules.json` file attributes are: - **[Rules Testing with jsonxform/transformation endpoint](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-jsonxform-transformation.md)** Test the results of a rule before deployment by calling the `jsonxform/transformation` endpoint. - **[VisualForce Events for Customizing the Wizard UI](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-vf-events.md)** This reference section explains the details of using VisualForce for customizing the Wizard user interface. # Architecture Let’s look at how custom Lightning Web Component widgets fit into the existing CRM Analytics dashboard architecture. **note:** This architecture doesn't apply for custom Lightning web components added to Lightning dashboards. CRM Analytics dashboards work with a clean separation of concerns. Widgets get data from queries, and pass selection back to them. Queries can pass selections to each other through faceting and receive global filters from the core runtime. Steps can also pass selections and data to other components via bindings. ![The CRM Analytics dashboard architecture.](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_arch1.png) Now you have a way to put your code into the mix while taking advantage of this entire system. ![The CRM Analytics dashboard architecture with a custom LWC component.](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_arch2.png) Mixing custom code in with widgets creates a powerful dynamic, and you have many ways to get state and configuration into your code. Meanwhile, you can communicate with the parent dashboard by setting selections on the associated query or using the `setState` method. ![How the LWC communicates with the CRM Analytics dashboard.](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_arch3.png) **See Also** - [Setup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-setup.md) # arimax Uses existing data to predict future data points. The `arimax` statement must follow a projection statement in your query. Perform any filtering pre-projection or after the `arimax` statement. **note:** The `arimax` statement requires a CRM Analytics Growth or CRM Analytics Plus license to return a full set of results. ## Usage `arimax` is a variant of the `timeseries` statement that provides a different algorithm to predict data points. Use `arimax` when you want predictions performed with a more general model that can take multiple variables. ## Syntax ```nolang result = arimax resultSet generate measure1 as fmeasure1 with (parameters); ``` `parameters` can have these values: - `arimaOrder` (required if `seasonalOrder` isn’t specified) Specify the order for the ARIMA model. For example, `arimaOrder=(p,d,q)`, where `p`, `d`, and `q` are integers. The integer values must be between `0` and `5`. **note:** `p` is the AR order, `d` is the degree of differencing, and `q` is the MA order. - `seasonalOrder` (required if `arimaOrder` isn’t specified) Specify the seasonal order for the ARIMA model. For example, `seasonalOrder=(P,D,Q,s)`, where `P`, `D`, `Q` are integers and `s` is the period. The integer values must be between `0` and `5`. The `s` value must be `0` or between `2` and `24`. `s` can only be `0` when `P`, `D`, and `Q` are also all `0`. **note:** `P` is the seasonal AR order, `D` is the degree of seasonal differencing, `Q` is the seasonal MA order, and `s` is the seasonal periodicity. - `xreg` (optional) External regressors or co-factors. For example, `xreg=('col1','col2',...)`. The values for `xreg` must be measures. The maximum number of `xreg` fields allowed is 10. - `xregFutures` (optional) Future scenario data for the `xreg` parameter as a map of values arrays. The number of values in each array must match the value for the `length` parameter. The key for each array value is the name of an `xreg` measure. **note:** If `seasonalOrder` and `dateType` aren’t specified in the query, the algorithm runs an auto-param search on a few popular seasonalities to find the best fit. `arimax` also supports the following `timeseries` parameters, with the same meaning and behavior. - `length` (required) Number of points to predict. For example, if `length` is 6 and the `dateCols` type string is `Y-M`, `arimax` predicts data for 6 months. **note:** If you want to use `dateCols` but your data stream has missing dates, use `fill` before using `arimax`. - `dateCols` (optional) Date fields to use for grouping the data, plus the date column type string. For example, `dateCols=(CloseDate_Year, CloseDate_Month, "Y-M")`. Date columns are projected automatically. Allowed values are: - `YearField, MonthField, "Y-M"` - `YearField, QuarterField, "Y-Q"` - `YearField, "Y"` - `YearField, MonthField, DayField "Y-M-D"` - `YearField, WeekField "Y-W"` - `ignoreLast` (optional) If `true`, `arimax` doesn't use the last time period in the calculations. The default is `false`. Set this parameter to `true` to improve the accuracy of the forecast if the last time period contains incomplete data. For example, if you’re partway through the quarter, `arimax` forecasts more accurately if you set this parameter to `true`. - `order` (optional) Specify the field to use for ordering the data. Mandatory if `dateCols` isn’t used. By default, this field is sorted in ascending order. Use `desc` to specify descending order, for example `order=('Type' desc)`. You can also order by multiple fields, for example `order=('Type' desc, 'Group' asc)`. For example, suppose that your data has no date columns, but it has a measure column called Week. Use `order='Week'`. **note:** Specify either `dateCols` or `order`. - `partition` (optional) Specify the column used to partition the data. The column must be a dimension. The `arimax` calculation is done separately for each partition to ensure that each partition uses the most accurate algorithm. For example, data in one partition can have a seasonal variation while data in another partition doesn't. The partition columns are projected automatically. For example, suppose that your sales data for raw materials contains the date sold, type of raw material, and the weight sold. To predict the future weight sold for each type of raw material, use `partition='Type'`. - `predictionInterval` (optional) Specify the uncertainty, or confidence interval, to display at each point. Allowed values are `80` and `95`. The upper and lower bounds of the confidence interval are projected in columns named `column_name_low_95` and `column_name_high_95`. **note:** `arimax` doesn’t support missing data values in the forecast or `xreg` measures. You must pre-process your data to replace missing values in the query before calling `arimax` . ## Syntax Examples - Use `arimax` with the `arimaOrder` parameter. ```nolang q = arimax q generate 'Value' as 'fValue' with (length=10, dataCols=('Year', 'Month', 'Day', "Y-M-D"), arimaOrder=(1,0,1)); ``` - Use `arimax` with the `arimaOrder`, `xreg`, and `ignoreLast` parameters. ```nolang q = arimax q generate 'Value' as 'fValue' with (length=10, dataCols=('Year', 'Month', 'Day', "Y-M-D"), arimaOrder=(1,0,1), xreg=('Price', 'Cost'), ignoreLast=true); ``` - Use multiple columns in the `arimax` forecast. If `xreg` is specified, multiple columns aren’t allowed.`= arimax q generate 'Value' as 'fValue', 'Value2' as 'fValue2' with (length=10, dataCols=('Year', 'Month', 'Day', "Y-M-D"), arimaOrder=(1,0,1));` - Use `arimax` with the `arimaOrder`, `seasonalOrder`, and `xreg` parameters. ```nolang q = arimax q generate 'Value' as 'fValue' with (length=10, dataCols=('Year', 'Month', 'Day', "Y-M-D"), arimaOrder=(1,0,1), seasonalOrder=(1,0,1,4), xreg=('Price', 'Cost')); ``` | `seasonality` | `dateCols` | Type of Seasonality | | -------------------------- | ----------------------------------------- | ----------------------------------------------------------- | | `seasonalOrder=(1,0,1,4)` | `dateCols=('Year','Quarter',"Y-Q")` | Yearly seasonality, because there are 4 quarters in a year. | | `seasonalOrder=(1,0,1,12)` | `dateCols=('Year','Month',"Y-M")` | Yearly seasonality, because there are 12 months in a year. | | `seasonalOrder=(1,0,1,7)` | `dateCols=('Year','Month','Day',"Y-M-D")` | Weekly seasonality, because there are 7 days in a week. | **note:** When the date type in the `dateCols` value doesn’t match the seasonal periodicity in seasonalOrder, the seasonal periodicity takes precedence. For example, if `dateCols=('Year','Month',"Y-M")` and `seasonalOrder=(1,0,1,4)` are in the same arimax statement, the seasonal period used for predictions is `4` or `"Y-Q"`, not `"Y-M"`. ## Use Case Examples Suppose you have a dataset with 5 years of monthly power usage for a city, along with the corresponding average temperature and precipitation for each month. ![A dataset example with date, power, precipitation, and temperature values.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_arimax_dataset_example.png) You can use a seasonal `arimax` query to predict the next 12 months of power usage, refining each prediction by adding more parameters to your query. Start with a single variable prediction, then make it multivariate by adding `xreg`, and finally, create a what-if analysis by adding `xregFutures`. For each visualization, a timeline chart is used, with **Axis Mode** set to Single Axis, **Show Value As** set to Compact Number, and a predictive line added to the **X-Axis**. ## Seasonal Query Use a seasonal `arimax` query to predict how much power the city will use in the upcoming year. ```nolang q = load "nyc_power_dates3"; q = group q by (CurrentDate_Year, CurrentDate_Month); q = foreach q generate CurrentDate_Year, CurrentDate_Month, sum(power) as power; q = arimax q generate power as fPower with (length=12, dateCols=(CurrentDate_Year, CurrentDate_Month, "Y-M"), arimaOrder=(0,1,1), seasonalOrder=(0,1,1,12)); q = foreach q generate 'CurrentDate_Year' + "~~~" + 'CurrentDate_Month' as 'CurrentDate_Year~~~CurrentDate_Month', fPower; ``` ![The results of a seasonal arimax query with one variant used in the prediction.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_arimax_univariate_example.png) ## Multivariate Seasonal Query Use a seasonal multivariate `arimax` query to predict how much power the city will use, using the `temperature` and `precipitation` measures in the calculation of the predicted values. ```nolang q = load "nyc_power_dates3"; q = group q by (CurrentDate_Year, CurrentDate_Month); q = foreach q generate CurrentDate_Year, CurrentDate_Month, sum(power) as power, sum(temperature) as temperature, sum(precipitation) as precipitation; q = arimax q generate power as fPower with (length=12, dateCols=(CurrentDate_Year, CurrentDate_Month, "Y-M"), xreg=(temperature, precipitation), arimaOrder=(0,1,1), seasonalOrder=(0,1,1,12)); q = foreach q generate 'CurrentDate_Year' + "~~~" + 'CurrentDate_Month' as 'CurrentDate_Year~~~CurrentDate_Month', fPower, temperature, precipitation; ``` ![The results of a seasonal arimax query with multiple variants used in the prediction.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_arimax_multivariate_example.png) ## Multivariate Seasonal Query with Prediction Interval Use a seasonal multivariate `arimax` query to predict how much power the city will use, using the `temperature` and `precipitation` measures in the calculation of the predicted values. Then, add a `predictionInterval` to show the prediction with 95% accuracy ```nolang q = load "nyc_power_dates3"; q = group q by (CurrentDate_Year, CurrentDate_Month); q = foreach q generate CurrentDate_Year, CurrentDate_Month, sum(power) as power, sum(temperature) as temperature, sum(precipitation) as precipitation; q = arimax q generate power as fPower with (length=12, predictionInterval=95 dateCols=(CurrentDate_Year, CurrentDate_Month, "Y-M"), xreg=(temperature, precipitation), arimaOrder=(0,1,1), seasonalOrder=(0,1,1,12)); q = foreach q generate 'CurrentDate_Year' + "~~~" + 'CurrentDate_Month' as 'CurrentDate_Year~~~CurrentDate_Month', fPower, fPower_high_95, fPower_low_95; ``` ![The results of a seasonal arimax query with multiple variants and a prediction interval used in the prediction.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_arimax_predictionInterval_example.png) ## What-If Analysis Query Use the `xregFutures` parameter to provide possible future values for `xreg` fields to see what the effects are on the forecasted fields for different sets of values ```nolang q = arimax q generate 'Value' as 'fValue' with (length=6, dateCols=('Year','Month','Day', "Y-M-D"), arimaOrder=(1,0,1), xreg=('col1', 'col2'), xregFutures=(col1: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0], col2: [1.1, 2.2 3.3, 4.4, 5.5, 6.6])); ``` The user can pass in values for `xreg` fields that they want to do the what-if analysis on. Add `xregFutures` to the seasonal multivariate `arimax` query to predict how much power the city will use with future `temperature` and `precipitation` values. In this query, the final 6 `temperature` future values have been increased by 10 degrees each to alter the calculated values in the visualization. ```nolang q = load "nyc_power_dates3"; q = group q by (CurrentDate_Year, CurrentDate_Month); q = foreach q generate CurrentDate_Year, CurrentDate_Month, sum(power) as power, sum(temperature) as temperature, sum(precipitation) as precipitation; q = arimax q generate power as fPower with (length=12, dateCols=(CurrentDate_Year, CurrentDate_Month, "Y-M"), xreg=(temperature, precipitation), arimaOrder=(0,1,1), seasonalOrder=(0,1,1,12), xregFutures=(temperature: [67.09, 58.49, 44.91, 41.89, 34.75, 34.20, 39.18, 61.51, 70.59, 82.13, 89.54, 84.12], precipitation: [0.0081, 0.0049, 0.0036, 0.0067, 0.0031, 0.0060, 0.0053, 0.0015, 0.0050, 0.0079, 0.0028, 0.0034])); q = foreach q generate 'CurrentDate_Year' + "~~~" + 'CurrentDate_Month' as 'CurrentDate_Year~~~CurrentDate_Month', fPower, temperature, precipitation; ``` ![The results of a seasonal arimax query with what-if analysis.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_arimax_whatif_example.png) **See Also** - [timeseries](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-timeseries.md) # arimax Show Parameters Query Tool The `showParams` parameter is provided for you as a query developer tool. It allows you to run an `arimax` query and review the model parameters and Bayesian Information Criteria (BIC) to understand the data better and improve query efficiency. When running an `arimax` query with the `showParams` specified, no statements after the `arimax` statement are allowed. During development, splitting your query can make testing easier. The query result isn't the queried data, it’s debugging information that shows the model parameters and the Bayesian Information Criteria (BIC) value. Use the result with the lowest BIC in your final query. ## Description Valid values are `top` and `multi`. Specifying `top` returns the final Arimax model and BIC for each partition and each forecasted measure. For example, the results for `showParams="top"` are: | Measure | ArimaOrder | SeasonalOrder | BIC | | ------- | ---------- | ------------- | ------ | | Revenue | (1,1,1) | (1,2,0,4) | 123.45 | Specifying `multi` returns the top 3 Arimax models and BIC for each partition and each forecasted measure. A lower BIC score denotes a better model fit. For example, the results for `showParams="multi"` are: | Measure | ArimaOrder | SeasonalOrder | BIC | | ------- | ---------- | ------------- | ---------- | | Revenue | (2,1,1) | (1,1,0,4) | 100.248204 | | Revenue | (2,1,1) | (2,0,1,12) | 107.434348 | | Revenue | (2,1,1) | (0,1,2,4) | 112.206876 | If both `arimaxOrder` and `seasonalOrder` are defined in the query, only the specified Arimax model and BIC are returned. **note:** It's best practice to always provide a `dateType` with the `dateCols` parameter to ensure more accurate predictions and better query performance. Omitting `dateType` results in a long-running query. ## Syntax - No Partition Syntax examples for show parameters queries with no partition. ### Single Forecast Measure, showParams="top" The query uses `showParams="top"` and a single forecast measure. The results return the lowest BIC value. ```nolang q = arimax q generate Revenue as fRevenue with (length=10, order='ldx', predictionInterval=[80,95], seasonalOrder=(0,1,1,3), showParams="top"); ``` Query results are: | Measure | ArimaOrder | SeasonalOrder | BIC | | ------- | ---------- | ------------- | --------- | | Revenue | (1,1,0) | (0,1,1,3) | 459.50558 | ### Single Forecast Measure, showParams="multi" The query uses `showParams="multi"` and a single forecast measure. The results return the top 3 parameter combinations with the lowest BIC. ```nolang q = arimax q generate Revenue as fRevenue with (length=10, order='ldx', predictionInterval=[80,95], seasonalOrder=(0,1,1,3), showParams="multi"); ``` Query results are: | Measure | ArimaOrder | SeasonalOrder | BIC | | ------- | ---------- | ------------- | --------- | | Revenue | (1,1,0) | (0,1,1,3) | 459.50558 | | Revenue | (0,1,0) | (0,1,1,3) | 478.15679 | | Revenue | (2,1,0) | (0,1,1,3) | 512.45935 | ### Multiple Forecast Measures, showParams="top" The query uses `showParams="top"` and a multiple forecast measures. The results return the lowest BIC value for each measure. ```nolang q = arimax q generate Revenue as fRevenue, ShippingCost as fShippingCost with (length=10, order='ldx', predictionInterval=[80,95], seasonalOrder=(0,1,1,3), showParams="top"); ``` Query results are: | Measure | ArimaOrder | SeasonalOrder | BIC | | ------------- | ---------- | ------------- | --------- | | Revenue | (1,1,0) | (0,1,1,3) | 459.50558 | | Shipping Cost | (2,0,1) | (0,1,1,3) | 1017.855 | ### Multiple Forecast Measures, showParams="multi" The query uses `showParams="multi"` and multiple forecast measures. The results return the top 3 parameter combinations with the lowest BIC for each measure. ```nolang q = arimax q generate Revenue as fRevenue, ShippingCost as fShippingCost with (length=10, order='ldx', predictionInterval=[80,95], seasonalOrder=(0,1,1,3), showParams="multi"); ``` Query results are: | Measure | ArimaOrder | SeasonalOrder | BIC | | ------------- | ---------- | ------------- | ---------- | | Revenue | (1,1,0) | (0,1,1,3) | 459.50558 | | Revenue | (0,1,0) | (0,1,1,3) | 478.15679 | | Revenue | (2,1,0) | (0,1,1,3) | 512.45935 | | Shipping Cost | (2,0,1) | (0,1,1,3) | 1017.855 | | Shipping Cost | (2,0,0) | (0,1,1,3) | 1025.45699 | | Shipping Cost | (2,0,2) | (0,1,1,3) | 1131.45972 | ## Syntax - With Partition Syntax examples for show parameters queries with a partition. ### Single Forecast Measure, showParams="top" The query uses `showParams="top"`, a single forecast measure, and a `partition`. The results return the lowest BIC value for the measure in each partition. ```nolang q = arimax q generate Revenue as fRevenue with (length=10, order='ldx', predictionInterval=[80,95], seasonalOrder=(0,1,1,3), partition='Region', showParams="top"); ``` Query results are: | Partition | Measure | ArimaOrder | SeasonalOrder | BIC | | --------- | ------- | ---------- | ------------- | -------- | | AMER | Revenue | (1,1,0) | (0,1,1,3) | 53.78475 | | APAC | Revenue | (0,1,0) | (0,1,1,3) | 56.0938 | | EU | Revenue | (2,1,2) | (0,1,1,3) | 58.3398 | ### Single Forecast Measure, showParams="multi" The query uses `showParams="multi"`, a single forecast measure, and a `partition`. The results return the top 3 parameter combinations with the lowest BIC value for the measure in each partition. ```nolang q = arimax q generate Revenue as fRevenue with (length=10, order='ldx', predictionInterval=[80,95], seasonalOrder=(0,1,1,3), partition='Region', showParams="multi"); ``` Query results are: | Partition | Measure | ArimaOrder | SeasonalOrder | BIC | | --------- | ------- | ---------- | ------------- | -------- | | AMER | Revenue | (1,1,0) | (0,1,1,3) | 53.78475 | | AMER | Revenue | (1,1,1) | (0,1,1,3) | 57.15645 | | AMER | Revenue | (0,1,0) | (0,1,1,3) | 62.14569 | | APAC | Revenue | (0,1,0) | (0,1,1,3) | 56.0938 | | APAC | Revenue | (0,1,1) | (0,1,1,3) | 57.19587 | | APAC | Revenue | (1,1,0) | (0,1,1,3) | 58.45987 | | EU | Revenue | (2,1,2) | (0,1,1,3) | 58.3398 | | EU | Revenue | (1,1,1) | (0,1,1,3) | 64.01597 | | EU | Revenue | (2,1,0) | (0,1,1,3) | 71.48946 | ### Multiple Forecast Measures, showParams="top" The query uses `showParams="top"`, multiple forecast measures, and a `partition`. The results return the lowest BIC value for each measure in each partition. ```nolang q = arimax q generate Revenue as fRevenue, ShippingCost as fShippingCost with (length=10, order='ldx', predictionInterval=[80,95], seasonalOrder=(0,1,1,3), partition='Region', showParams="top"); ``` Query results are: | Partition | Measure | ArimaOrder | SeasonalOrder | BIC | | --------- | ------------- | ---------- | ------------- | --------- | | AMER | Revenue | (1,1,0) | (0,1,1,3) | 53.78475 | | AMER | Shipping Cost | (0,1,0) | (0,1,1,3) | 122.04503 | | APAC | Revenue | (0,1,0) | (0,1,1,3) | 56.0938 | | APAC | Shipping Cost | (2,1,0) | (0,1,1,3) | 138.1605 | | EU | Revenue | (2,1,2) | (0,1,1,3) | 58.3398 | | EU | Shipping Cost | (2,1,1) | (0,1,1,3) | 130.74353 | ### Multiple Forecast Measures, showParams="multi" The query uses `showParams="multi"`, multiple forecast measures, and a `partition`. The results return the top 3 parameter combinations with the lowest BIC value for each measure in each partition. ```nolang q = arimax q generate Revenue as fRevenue, ShippingCost as fShippingCost with (length=10, order='ldx', predictionInterval=[80,95], seasonalOrder=(0,1,1,3), partition='Region', showParams="multi"); ``` Query results are: | Partition | Measure | ArimaOrder | SeasonalOrder | BIC | | --------- | ------------- | ---------- | ------------- | --------- | | AMER | Revenue | (1,1,0) | (0,1,1,3) | 53.78475 | | AMER | Revenue | (1,1,1) | (0,1,1,3) | 57.15645 | | AMER | Revenue | (0,1,0) | (0,1,1,3) | 62.14569 | | AMER | Shipping Cost | (0,1,0) | (0,1,1,3) | 122.04503 | | AMER | Shipping Cost | (2,0,1) | (0,1,1,3) | 127.48979 | | AMER | Shipping Cost | (0,1,1) | (0,1,1,3) | 139.48975 | | APAC | Revenue | (0,1,0) | (0,1,1,3) | 56.0938 | | APAC | Revenue | (0,1,1) | (0,1,1,3) | 57.19587 | | APAC | Revenue | (1,1,0) | (0,1,1,3) | 58.459878 | | APAC | Shipping Cost | (2,1,0) | (0,1,1,3) | 138.1605 | | APAC | Shipping Cost | (1,1,1) | (0,1,1,3) | 141.1567 | | APAC | Shipping Cost | (0,1,0) | (0,1,1,3) | 143.15756 | | EU | Revenue | (2,1,2) | (0,1,1,3) | 58.3398 | | EU | Revenue | (1,1,1) | (0,1,1,3) | 64.01597 | | EU | Revenue | (2,1,0) | (0,1,1,3) | 71.48946 | | EU | Shipping Cost | (2,1,1) | (0,1,1,3) | 130.74353 | | EU | Shipping Cost | (1,0,1) | (0,1,1,3) | 137.1567 | | EU | Shipping Cost | (0,1,2) | (0,1,1,3) | 146.49865 | ## Use Show Parameters with No Seasonality to Model BIC Values To understand your data, run the `arimax` query without `seasonalOrder` and with `showParams="multi"`. ```nolang q = load "em/coffee"; q = filter q by Type in ["Hot Coffee", "Bulk Coffee"]; q = group q by ('ClosedDate_Year', 'ClosedDate_Quarter', "Type"); q = foreach q generate 'ClosedDate_Year', 'ClosedDate_Quarter', 'Type', sum(Weight) as sum_Weight; q = arimax q generate 'sum_Weight' as fSumWeight, with (length=4, showParams="multi", partition='Type', ignoreLast=true, dateCols=('ClosedDate_Year', 'ClosedDate_Quarter', "Y-Q"), arimaOrder=(2,1,2));" ``` The results show multiple `seasonalOrder` values with the lowest BICs for each forecast measure. You can select the `seasonalOrder` that works best for your final query. | Partition | Measure | ArimaOrder | SeasonalOrder | BIC | | ----------- | ---------- | ---------- | ------------- | ------------ | | Cold Coffee | sum_Weight | (2,1,2) | (2,0,2,4) | 207.8193821 | | Cold Coffee | sum_Weight | (2,1,2) | (0,1,0,4) | 270.4199107 | | Cold Coffee | sum_Weight | (2,1,2) | (1,1,0,4) | 283.68998334 | | Hot Coffee | sum_Weight | (2,1,2) | (0,1,0,4) | 329.0235125 | | Hot Coffee | sum_Weight | (2,1,2) | (0,1,2,4) | 320.3612713 | | Hot Coffee | sum_Weight | (2,1,2) | (1,1,0,4) | 365.6449188 | # Arithmetic Operators Use arithmetic operators to perform addition, subtraction, multiplication, division, and modulo operations. | Operator | Description | | -------- | -------------- | | `+` | Plus | | `-` | Minus | | `*` | Multiplication | | `/` | Division | | `%` | Modulo | ## Example You want to charge each of your accounts 5% of their opportunities as a fee. Create a query that multiplies the `Amount` field by .05. This query will resemble the following: ```nolang q = load "opportunity"; q = group q by 'Account.Name'; q = foreach q generate 'Account.Name' as 'Account.Name', sum('Amount') * 0.05 as 'Fee'; q = order q by 'Fee' desc; q = limit q 2000; ``` # `array` Functions Use `array` functions in rules to manipulate arrays in asset JSON at runtime. Array functions can use the answer to a configuration wizard question to set runtime conditions. For example, array functions can check all selected values and set a condition to true or false. They can also take multiple values from an answer and iterate over a JSON array to put those values into the runtime JSON correctly. Or, say that your wizard contains multiple questions with limited values to choose from, such as Yes/No, or a time frame in days or months. An array function can replace them with one question that asks the user to select multiple features to include in dashboards. In this case, the array function loops over the one question to check for values and set the features that the user picked via a conditional. ## `forEach` Parameters: `Collection array`, `String returnValue` Returns: `Collection` Recursive: Not supported Description: Evaluates `returnValue` as an EL expression for each item in the given array and collects each `eval` result in an array and returns it. ### Example Variables: ``` myArray = ["ProductName","Amount", "CompanyName", "Revenue"] ``` JSON template: ```json {    "fields": "${array:forEach(Variables.myArray, '{\"name\": \"${var}\"}')}" } ``` Returns: ```json {    "fields": [{"name": "ProductName"},               {"name": "Amount"},               {"name": "CompanyName"},               {"name": "Revenue"}] } ``` ## `forEachIndex` Parameters: `Int start`, `Int end`, `String returnValue` Returns: `Collection` Recursive: Not supported Description: Evaluates `returnValue` as an EL expression for the index number(s) in the array where the string is found. ### Example JSON template: ```json {    "fields": "${array:forEachIndex(1, 5, '{\"index\":\"${index}\"}')}" } ``` Returns: ```json {    "fields": [{"index": "1"},               {"index": "2"},               {"index": "3"},               {"index": "4"}, {"index": "5"}] } ``` ## `concat` Parameters: `Collection array1`, `Collection array2` Returns: `Collection` Recursive: Not supported Description: Returns an array after concatenating the given `array1` and `array2`. ### Example Variables ``` myArray1 = ["A", "B", "C"] myArray2 = ["X", "Y", "Z"] ``` JSON Template: ```json {    "concat": "${array:concat(Variables.myArray1,Variables.myArray2)}" } ``` Returns: ```json { "concat": ["A", "B", "C", "X", "Y", "Z"] } ``` ## `unique` Parameters: `Collection array` Returns: `Collection` Recursive: Not supported Description: Returns an array of unique items. Uniqueness determined by the underlying objects contained in the array. For example, if the collection is an array of strings, all strings with identical values (case-sensitive) are removed. ### Example Variables: ``` myArray = ["ProductName","Amount", "CompanyName", "Revenue", "Amount", "ProductName"] ``` JSON template: ```json {    "unique": "${array:unique(Variables.myArray}" } ``` Returns: ```json {    "unique": ["ProductName", "Amount", "CompanyName", "Revenue"] } ``` ## `uniqueBy` Parameters: `String byFieldName`, `Collection array` Returns: `Collection` Recursive: Not supported Description: Returns an array of unique items. Expects an array of complex objects of similar shape. Uniqueness determined by comparing the value of a field identified by the given `byFieldName`. ### Example Variables: ```json myArray = [{"name" : "ProductName", "id" : "1"}, {"name" : "Amount", "id" : "2"}, {"name" : "CompanyName", "id" : "3"}, {"name" : "Amount", "id": "2"}] ``` JSON template: ```json {    "uniqueBy": "${array:uniqueBy('id', Variables.myArray}" } ``` Returns: ```json {    "uniqueBy": [{"name" : "ProductName", "id" : "1"}, {"name" : "Amount", "id" : "2"}, {"name" : "CompanyName", "id" : "3"}] } ``` ## `union` Parameters: `Collection array1`, `Collection array2` Returns: `Collection` Recursive: Not supported Description: Returns a unique union between `array1` and `array2`. Uniqueness determined by the underlying objects contained in the array. ### Example Variables: ```json myArray1 = ["ProductName", "Amount", "CompanyName"] myArray2 = ["Revenue", "Amount", "ProductName"] ``` JSON template: ```json {    "union": "${array:union(Variables.myArray1, Variables.myArray2}" } ``` Returns: ```json {    "union": ["ProductName", "Amount", "CompanyName", "Revenue"] } ``` ## `unionBy` Parameters: `String byFieldName`, `Collection array1`, `Collection array2` Returns: `Collection` Recursive: Not supported Description: Returns an array which is a union of `array1` and `array2` items. Expects an array of complex objects of similar shape. Uniqueness determined by comparing the value of a field identified by the given `byFieldName`. ### Example Variables: ```json myArray1 = [{"name" : "ProductName", "id" : "1"}, {"name" : "Amount", "id" : "2"}, {"name" : "CompanyName", "id" : "3"}] myArray2 = [{"name" : "Revenue", "id" : "4"}, {"name" : "Amount", "id" : "2"}] ``` JSON template: ```json {    "unionBy": "${array:unionBy('id', Variables.myArray1, Variables.myArray2}" } ``` Returns: ```json {    "unionBy": [{"name" : "ProductName", "id" : "1"}, {"name" : "Amount", "id" : "2"}, {"name" : "CompanyName", "id" : "3"}, {"name" : "Revenue", "id" : "4"}] } ``` ## `contains` Parameters: `Collection array`, `Object item` Returns: `Boolean` Recursive: Not supported Description: Returns `true` if the given item is in the given array, otherwise `false`. ### Example Variables: ``` myArray = ["ProductName","Amount", "CompanyName", "Revenue"] ``` JSON template: ```json {    "contains": "${array:contains(Variables.myArray, 'Amount')}" } ``` Returns: ```json {    "contains": true } ``` ## `size` Parameters: `Collection array` Returns: `Integer` Recursive: Not supported Description: Return the size of the array. ### Example Variables: ``` myArray = ["ProductName","Amount", "CompanyName", "Revenue"] ``` JSON template: ```json {    "size": "${array:size(Variables.myArray)}" } ``` Returns: ```json {    "size": 4 } ``` ## `last` Parameters: `Collection array` Returns: `Object` Recursive: Not supported Description: Return the last item of the array. ### Example Variables: ``` myArray = ["ProductName","Amount", "CompanyName", "Revenue"] ``` JSON template: ```json {    "last": "${array:last(Variables.myArray)}" } ``` Returns: ```json {    "last": "Revenue" } # array Functions Use `array` functions in rules to manipulate arrays in asset JSON at runtime. Array functions can use the answer to a configuration wizard question to set runtime conditions. For example, array functions can check all selected values and set a condition to true or false. They can also take multiple values from an answer and iterate over a JSON array to put those values into the runtime JSON correctly. Or, say that your wizard contains multiple questions with limited values to choose from, such as Yes/No, or a time frame in days or months. An array function can replace them with one question that asks the user to select multiple features to include in dashboards. In this case, the array function loops over the one question to check for values and set the features that the user picked via a conditional. ## Function Name: forEach Parameters: `Collection` array, String `returnValue` Returns: `Collection` Recursive: Not supported> Description: Evaluates returnValue as an EL expression for each item in the given array and collects each eval result in an array and returns it. ## Example JSON template: ```nolang {    "fields": "${array:forEach(Variables.myArray, '{\"name\": \"${var}\"}')}" } ``` Produces: ```nolang {    "fields": [{"name": "ProductName"},               {"name": "Amount"},               {"name": "CompanyName"},               {"name": "Revenue"}] }; ``` ## forEachIndex Parameters: Int start, Int end, String `returnValue` Returns: `Collection` Recursive: Not supported Description: Evaluates `returnValue` as an EL expression for the index number(s) int the array where the string is found. ## concat Parameters: `Collection` array1, `Collection` array2 Returns: `Collection` Recursive: Not supported Description: Returns an array after concatenating the given array1 and array2. ## unique Parameters: `Collection` array Returns: `Collection` Recursive: Not supported Description: Returns an array of unique items. Uniqueness determined by the underlying objects contained in the array. For example, if the collection is an array of strings, all strings with identical values (case sensitive) are removed. ## uniqueBy Parameters: String `byFieldName`, `Collection` array Returns: `Collection` Recursive: Not supported Description: Returns an array of unique items. Expects an array of complex objects of similar shape. Uniqueness determined by comparing the value of a field identified by the given `byFieldName`. ## union Parameters: `Collection` array1, `Collection` array2 Returns: `Collection` Recursive: Not supported Description: Returns a unique union between `array1` and `array2`. Uniqueness determined by the underlying objects contained in the array. ## unionBy Parameters: String `byFieldName`, `Collection` array1, `Collection` array2 Returns: `Collection` Recursive: Not supported Description: Returns an array which is a union of array1 and array2 items. Expects an array of complex objects of similar shape. Uniqueness determined by comparing the value of a field identified by the given `byFieldName`. ## contains Parameters: Collection `` array, Object item Returns: Boolean Recursive: Not supported Description: Returns `true` if the given item is in the given array, otherwise `false`. ## size Parameters: Collection `` array Returns: Integer Recursive: Not supported Description: Return the size of the array. ## last Parameters: Collection `` array Returns: Object Recursive: Not supported Description: Return the last item of the array. - **[Use Array Functions for Multi-Select Widgets and Looping](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-array-functions-rules-mult-loop.md)** Here’s how to use an array function to create a configuration wizard widget that lets the user select multiple values. # Array Variable Type for variables.json Use an `ArrayType` variable to create a wizard question that accepts multiple selections. The user can make multiple choices from a list of values. Define a minimum and maximum for the number of items that can be selected. ```nolang "variableType" : {
 "type" : "ArrayType",
 "itemsType" : {
 "type" : "NumberType"
 } "sizeLimit" :{ "min" : 1, "max" : 100 } 
} ``` Example for ArrayType with `enum`: ```nolang "variableType" : { "type" : "ArrayType", "itemsType" : { "type" : "StringType", "enums" : [ "Leads", "Campaigns", "Campaign Members" ] }, "sizeLimit" : { "max" : 3 } } ``` # ascii() Returns the UTF-8 code value of a character _n_. ## Syntax `ascii`(_n_) ## Usage Returns `null` if _n_ is `null`. The `null` character (0) is not allowed. ## Example ```nolang q = foreach q generate ascii("a") as int_value; - -int_value == 97 ``` # ascii({char}) Returns UTF-8 numeric value of the specified character. Returns `null` if `{n}` is `null`. ## Example This example returns the ASCII value for the letter “a.” ```nolang SELECT ASCII('C') as "asciiValue" FROM "Superstore" LIMIT 1; ``` | asciiValue | | ---------- | | 67 | # asin({n}) Returns the arcsine value of radians value `{n}`. `{n}` can be any real number in the range of -1 \<= `{n}` \<= 1. If `null` is passed as an argument, `sin()` returns `null`. `asin({n})` takes the following syntax. ```nolang SELECT ASIN(N) as ALIAS FROM DATASET; ``` ## Example This example takes the arcsine of 35 degrees. ```nolang SELECT ASIN(RADIANS(35)) as asinValue FROM "Opportunity" LIMIT 1; ``` | asinValue | | --------- | | 0.60746 | # asin(n) Returns the arcsine value of radians value _n_. _n_ can be any real numeric value in the range of -1 \<= _n_ \<= 1. If `null` is passed as an argument, `asin()` returns `null`.This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate asin(radians) as arcsine; ``` # Assign Tableau Next User Permissions All users who view the embedded insights in your web app must exist in your Salesforce org and have the Tableau Next Consumer permission set. The Tableau Next Consumer permission set provides view access to Tableau Next insights. If your users aren't also Salesforce users with Tableau Next view access, they can't see the insight visuals in your web app. For information on adding permission sets to users, see [Assign a User a Tableau Next Permission Set](https://help.salesforce.com/s/articleView?id=analytics.tua_admin_assign_tableau_permset_to_users.htm&type=5) --- [Next - Generate the Access Token and Frontdoor Url for Tableau Next Embedding](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-access-token.md) # atan({n}) Returns the arctan value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `atan()` returns `null`. `atan({n})` takes the following syntax. ```nolang SELECT ATAN(N) as ALIAS FROM DATASET; ``` ## Example This example takes the arctan of 90 degrees. ```nolang SELECT ATAN(RADIANS(90)) as arctanValue FROM "Opportunity" LIMIT 1; ``` | arctanValue | | ----------- | | 1.00388 | # atan(n) Returns the arctangent value of radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `atan()` returns `null`. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate atan(radians) as arctangent; ``` atf # atf Provides a list of available resources for the `/app-framework` Connect REST API. Create and manage templates, apps, assets, chains, tasks, variables, and rules. **Version:** 67.0 ## Servers * `https://{MyDomainName}.my.salesforce.com/services/data/v67.0` ## Tags ### Apps Use `/app-framework/apps` operations to: * Get a list of templated apps, filtering by asset type, template asset name, template source ID, or template subtype. * Get, update, or delete an app. * Patch the label or description for a specific templated app. ### App Activities Use `/app-framework/apps/{appIdOrApiName}/activities` to: * Get a collection of activities for a templated app. * Get the details for a specific activity. * Get the most recent app activity. ### App Assets Use `/app-framework/apps/{appIdOrApiName}/assets/` to: * Get, update, or delete a specific asset for a templated app. * Get a list of assets for a templated app, filtering by asset type or template asset name. * Add an asset to a specific templated app. ### App Schedules Use `/app-framework/apps/{appIdOrApiName}/schedules` to: * Get a list of schedule records for a specific app. * Update or delete a schedule record for a specific app. ### Templates Use `/app-framework/templates` to: * Get a list of templates, filtering by template type, sub-type, or by a tag key and values. * Get, update, or delete a specific template. * Create a template. ### Template Chains Use `/app-framework/templates/{templateIdOrApiName}/chains` to: * Get or delete a specific chain type for a specific template. * Create a chain for a specific template. * Get or update a collection of chains for a specific template. ### Template Layout Use `/app-framework/templates/{templateIdOrApiName}/layout` to: * Get the layout for a specific template. * Update the layout for a specific template. ### Template Rules Use `/app-framework/templates/{templateIdOrApiName}/rules/{ruleName}` to: * Get a list of rules definitions for a specific template. * Get, update, or delete a rule for a specific template. ### Template Tags Use `/app-framework/templates/{templateIdOrApiName}/tags` to: * Get a list of tags for a specific template. * Update a tag for a specific template. ### Template Variables Use `/app-framework/templates/{templateIdOrApiName}/variables` to: * Get a list of variables for a specific template. * Update a specific variable for the specified template. ## Operations ### GET getAppFrameworkAppActivityCollection `GET /app-framework/apps/{appIdOrApiName}/activities` Operation ID: `getAppFrameworkAppActivityCollection`. Tags: App Activities. Provides a list of activity records for the specified app. Returns a list of app activity records. #### Parameters * `appIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `AppActivityCollectionRepresentation`. ### GET getAppFrameworkAppAsset `GET /app-framework/apps/{appIdOrApiName}/assets/{appAssetId}` Operation ID: `getAppFrameworkAppAsset`. Tags: App Assets. Returns, deletes, or updates the specified asset for the specified app. Returns a specific asset for the specified app. #### Parameters * `appAssetId` (path, string, required) * `appIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `AssetRepresentation`. ### DELETE deleteAppFrameworkAppAsset `DELETE /app-framework/apps/{appIdOrApiName}/assets/{appAssetId}` Operation ID: `deleteAppFrameworkAppAsset`. Tags: App Assets. Returns, deletes, or updates the specified asset for the specified app. Deletes a specific asset from the specified app. #### Parameters * `appAssetId` (path, string, required) * `appIdOrApiName` (path, string, required) #### Responses * **200** Success ### PATCH patchAppFrameworkAppAsset `PATCH /app-framework/apps/{appIdOrApiName}/assets/{appAssetId}` Operation ID: `patchAppFrameworkAppAsset`. Tags: App Assets. Returns, deletes, or updates the specified asset for the specified app. Updates a specific asset for the specified app. #### Parameters * `appAssetId` (path, string, required) * `appIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `AssetInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `AssetRepresentation`. ### GET getAppFrameworkTemplateTaskCollection `GET /app-framework/tasks/{taskType}` Operation ID: `getAppFrameworkTemplateTaskCollection`. Tags: Tasks. Returns a list of available tasks, filtered by the task type, for the app framework. by variant type Returns a list of available tasks, filtered by the task type, for the app framework. Valid task types are App, Template, and Setup. #### Parameters * `taskType` (path, TemplateTaskTypeEnum, required) #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateTaskCollectionRepresentation`. ### GET getAppFrameworkTemplateVariables `GET /app-framework/templates/{templateIdOrApiName}/variables` Operation ID: `getAppFrameworkTemplateVariables`. Tags: Template Variables. Returns a list of variables or updates a specified variable for the specified template. Returns a list of variables for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `VariablesRepresentation`. ### PUT putAppFrameworkTemplateVariables `PUT /app-framework/templates/{templateIdOrApiName}/variables` Operation ID: `putAppFrameworkTemplateVariables`. Tags: Template Variables. Returns a list of variables or updates a specified variable for the specified template. Updates a specified variable for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `VariablesInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `VariablesRepresentation`. ### GET getAppFrameworkAppCollection `GET /app-framework/apps` Operation ID: `getAppFrameworkAppCollection`. Tags: Apps. Returns a list of available apps or creates a new app. Returns a list of apps. To filter the list, specify the template name, type, subtype, asset type, or asset source name. #### Parameters * `assetType` (query, string) * `templateAssetName` (query, string) * `templateSourceId` (query, string) * `templateSubtype` (query, TemplateSubtypeEnum) * `type` (query, TemplateTypeEnum) #### Responses * **200** Success Media type: `application/json`. Schema: `AppCollectionRepresentation`. ### POST postAppFrameworkAppCollection `POST /app-framework/apps` Operation ID: `postAppFrameworkAppCollection`. Tags: Apps. Returns a list of available apps or creates a new app. Creates an app from a specified template or from a list of specified asset ids. #### Request body Media type: `application/json`. Schema: `BaseAppInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `AppResultRepresentation`. ### GET getAppFrameworkTemplateTagCollection `GET /app-framework/templates/{templateIdOrApiName}/tags` Operation ID: `getAppFrameworkTemplateTagCollection`. Tags: Template Tags. Returns the list of tags or updates a tag for the specified template. Returns a list of tags for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateTagCollectionRepresentation`. ### PUT putAppFrameworkTemplateTagCollection `PUT /app-framework/templates/{templateIdOrApiName}/tags` Operation ID: `putAppFrameworkTemplateTagCollection`. Tags: Template Tags. Returns the list of tags or updates a tag for the specified template. Updates a specified tag for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `TemplateTagCollectionInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateTagCollectionRepresentation`. ### GET getAppFrameworkInstalledAssetCollection `GET /app-framework/installed-assets` Operation ID: `getAppFrameworkInstalledAssetCollection`. Tags: Installed Assets. Returns a list of assets installed using templates. Returns a list of assets installed using templates. To filter the list, specify an asset ID, name, or type. #### Parameters * `assetIdOrName` (query, string) * `assetType` (query, string) #### Responses * **200** Success Media type: `application/json`. Schema: `InstalledAssetCollectionRepresentation`. ### GET getAppFrameworkInstalledAssetByTemplateCollection `GET /app-framework/installed-assets/{templateIdOrApiName}` Operation ID: `getAppFrameworkInstalledAssetByTemplateCollection`. Tags: Installed Assets. Returns a list of assets created from the specified template. Returns a list of assets created from the specified template. To filter the list, specify an asset type or indicate to list assets by latest app only. #### Parameters * `templateIdOrApiName` (path, string, required) * `assetType` (query, string) * `latestApp` (query, boolean) #### Responses * **200** Success Media type: `application/json`. Schema: `AssetByTemplateCollectionRepresentation`. ### GET getAppFrameworkTemplate `GET /app-framework/templates/{templateIdOrApiName}` Operation ID: `getAppFrameworkTemplate`. Tags: Templates. Returns, deletes, or updates the specified template. Returns the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateRepresentation`. ### DELETE deleteAppFrameworkTemplate `DELETE /app-framework/templates/{templateIdOrApiName}` Operation ID: `deleteAppFrameworkTemplate`. Tags: Templates. Returns, deletes, or updates the specified template. Deletes the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success ### PATCH patchAppFrameworkTemplate `PATCH /app-framework/templates/{templateIdOrApiName}` Operation ID: `patchAppFrameworkTemplate`. Tags: Templates. Returns, deletes, or updates the specified template. Updates the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `TemplateUpdateRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateRepresentation`. ### GET getAppFrameworkTemplateChainType `GET /app-framework/templates/{templateIdOrApiName}/chains/{type}` Operation ID: `getAppFrameworkTemplateChainType`. Tags: Template Chains. Returns a specific chain type for the specified template. Returns a specific chain type for the specified template. Valid chain types include `Create`, `Update`, `Delete`, `RefreshData`, and `AutomatedSetup`. #### Parameters * `templateIdOrApiName` (path, string, required) * `type` (path, ChainTypeEnum, required) #### Responses * **200** Success Media type: `application/json`. Schema: `ChainDetailsRepresentation`. ### GET getAppFrameworkTemplateConfiguration `GET /app-framework/templates/{templateIdOrApiName}/configuration` Operation ID: `getAppFrameworkTemplateConfiguration`. Tags: Template Configuration. Returns the configuration details for the specified template. Returns the configuration details for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateConfigurationRepresentation`. ### GET getAppFrameworkTemplateChainCollection `GET /app-framework/templates/{templateIdOrApiName}/chains` Operation ID: `getAppFrameworkTemplateChainCollection`. Tags: Template Chains. Returns a list of chains, creates, or updates a chain for the specified template. Returns a list of chains for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) * `name` (query, string) * `type` (query, ChainTypeEnum) #### Responses * **200** Success Media type: `application/json`. Schema: `ChainDefinitionCollectionRepresentation`. ### PUT putAppFrameworkTemplateChainCollection `PUT /app-framework/templates/{templateIdOrApiName}/chains` Operation ID: `putAppFrameworkTemplateChainCollection`. Tags: Template Chains. Returns a list of chains, creates, or updates a chain for the specified template. Create or update a chain for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `ChainDetailsInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `ChainDetailsRepresentation`. ### POST postAppFrameworkAppUpdateBasicApp `POST /app-framework/apps/{appIdOrApiName}/updateBasicApp` Operation ID: `postAppFrameworkAppUpdateBasicApp`. Tags: Update Basic App. Updates the specified app with new or changed assets if it is a source app. Updates the specified app using a list of resources or a template. #### Parameters * `appIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `BasicAppUpdateRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `AppResultRepresentation`. ### GET getAppFrameworkTemplateChain `GET /app-framework/templates/{templateIdOrApiName}/chains/{type}/{name}` Operation ID: `getAppFrameworkTemplateChain`. Tags: Template Chains. Returns or deletes a specific chain type by name for the specified template. Returns a specific chain type by name for the specified template. #### Parameters * `name` (path, string, required) * `templateIdOrApiName` (path, string, required) * `type` (path, ChainTypeEnum, required) #### Responses * **200** Success Media type: `application/json`. Schema: `ChainDetailsRepresentation`. ### DELETE deleteAppFrameworkTemplateChain `DELETE /app-framework/templates/{templateIdOrApiName}/chains/{type}/{name}` Operation ID: `deleteAppFrameworkTemplateChain`. Tags: Template Chains. Returns or deletes a specific chain type by name for the specified template. Deletes a specific chain type by name from the specified template. #### Parameters * `name` (path, string, required) * `templateIdOrApiName` (path, string, required) * `type` (path, ChainTypeEnum, required) #### Responses * **200** Success ### POST postAppFrameworkAppDecouple `POST /app-framework/apps/{appIdOrApiName}/decouple` Operation ID: `postAppFrameworkAppDecouple`. Tags: App Decouple. Removes template references from the source app. Removes template references from the source app. #### Parameters * `appIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `AppResultRepresentation`. ### POST postAppFrameworkAppRefresh `POST /app-framework/apps/{appIdOrApiName}/refresh` Operation ID: `postAppFrameworkAppRefresh`. Tags: App Refresh. Refreshes the data for the specified app. Runs the tasks that refresh the data for the specified app. #### Parameters * `appIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `AppRefreshInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `AppResultRepresentation`. ### GET getAppFrameworkTemplateCollection `GET /app-framework/templates` Operation ID: `getAppFrameworkTemplateCollection`. Tags: Templates. Returns a list of templates or creates a new template. Returns a list of templates. To filter the list, specify the template type, sub-type, or by a tag key and values. #### Parameters * `tagKey` (query, string) * `tagValues` (query, array of string) * `templateSubtype` (query, TemplateSubtypeEnum) * `type` (query, TemplateTypeEnum) #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateCollectionRepresentation`. ### POST postAppFrameworkTemplateCollection `POST /app-framework/templates` Operation ID: `postAppFrameworkTemplateCollection`. Tags: Templates. Returns a list of templates or creates a new template. Creates a template. #### Request body Media type: `application/json`. Schema: `TemplateInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateRepresentation`. ### GET getAppFrameworkAppActivityItem `GET /app-framework/apps/{appIdOrApiName}/activities/{id}` Operation ID: `getAppFrameworkAppActivityItem`. Tags: App Activities. App Template Framework `activities` operations enable you to: * Get a collection of activities for a templated app. * Get the details for a specific activity. * Get the most recent app activity. Returns the specified activity for the specified app. #### Parameters * `appIdOrApiName` (path, string, required) * `id` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `AppActivityItemRepresentation`. ### GET getAppFrameworkTemplateRuleCollection `GET /app-framework/templates/{templateIdOrApiName}/rules` Operation ID: `getAppFrameworkTemplateRuleCollection`. Tags: Template Rules. Returns a list of rules definitions for the specified template. Returns a shallow list of rules definitions for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `RuleCollectionRepresentation`. ### GET getAppFrameworkAppAssetCollection `GET /app-framework/apps/{appIdOrApiName}/assets` Operation ID: `getAppFrameworkAppAssetCollection`. Tags: App Assets. Provides a list of assets included in a specified app or adds an asset to the app. Returns a list of assets included in the specified app. To filter the list, specify the asset type or the template asset name. #### Parameters * `appIdOrApiName` (path, string, required) * `assetType` (query, string) * `templateAssetName` (query, string) #### Responses * **200** Success Media type: `application/json`. Schema: `AssetCollectionRepresentation`. ### POST postAppFrameworkAppAssetCollection `POST /app-framework/apps/{appIdOrApiName}/assets` Operation ID: `postAppFrameworkAppAssetCollection`. Tags: App Assets. Provides a list of assets included in a specified app or adds an asset to the app. Adds an asset to include in the specified app. #### Parameters * `appIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `AssetInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `AssetRepresentation`. ### POST postAppFrameworkTemplateReadiness `POST /app-framework/templates/{templateIdOrApiName}/readiness` Operation ID: `postAppFrameworkTemplateReadiness`. Tags: Template Readiness. Runs the org readiness checks to validate the specified template. This resource is idempotent. Runs the org readiness checks to validate the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `TemplateReadinessInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `TemplateReadinessRepresentation`. ### GET getAppFrameworkAppScheduleCollection `GET /app-framework/apps/{appIdOrApiName}/schedules` Operation ID: `getAppFrameworkAppScheduleCollection`. Tags: App Schedules. Returns, deletes, and updates schedules for the specified app. Returns a list of schedule records for the specified app. To filter the list, specify a chain name or type. #### Parameters * `appIdOrApiName` (path, string, required) * `chainName` (query, string) * `chainType` (query, ChainTypeEnum) #### Responses * **200** Success Media type: `application/json`. Schema: `AppScheduleCollectionRepresentation`. ### PUT putAppFrameworkAppScheduleCollection `PUT /app-framework/apps/{appIdOrApiName}/schedules` Operation ID: `putAppFrameworkAppScheduleCollection`. Tags: App Schedules. Returns, deletes, and updates schedules for the specified app. Updates the schedules for the specified app. #### Parameters * `appIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `AppScheduleCollectionInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `AppScheduleCollectionRepresentation`. ### DELETE deleteAppFrameworkAppScheduleCollection `DELETE /app-framework/apps/{appIdOrApiName}/schedules` Operation ID: `deleteAppFrameworkAppScheduleCollection`. Tags: App Schedules. Returns, deletes, and updates schedules for the specified app. Deletes the schedules for the specified app. To delete specific schedules, specify the chain name or type. #### Parameters * `appIdOrApiName` (path, string, required) * `chainName` (query, string) * `chainType` (query, ChainTypeEnum) #### Responses * **200** Success ### GET getAppFrameworkApp `GET /app-framework/apps/{appIdOrApiName}` Operation ID: `getAppFrameworkApp`. Tags: Apps. Returns, deletes, updates, or patches the specified app. Returns the specified app. #### Parameters * `appIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `AppRepresentation`. ### PUT putAppFrameworkApp `PUT /app-framework/apps/{appIdOrApiName}` Operation ID: `putAppFrameworkApp`. Tags: Apps. Returns, deletes, updates, or patches the specified app. Updates the specified app from a template. #### Parameters * `appIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `AppUpdateRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `AppResultRepresentation`. ### DELETE deleteAppFrameworkApp `DELETE /app-framework/apps/{appIdOrApiName}` Operation ID: `deleteAppFrameworkApp`. Tags: Apps. Returns, deletes, updates, or patches the specified app. Deletes the specified app. #### Parameters * `appIdOrApiName` (path, string, required) #### Responses * **200** Success ### PATCH patchAppFrameworkApp `PATCH /app-framework/apps/{appIdOrApiName}` Operation ID: `patchAppFrameworkApp`. Tags: Apps. Returns, deletes, updates, or patches the specified app. Patches the specified app from a template #### Parameters * `appIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `BasicAppPatchInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `AppRepresentation`. ### GET getAppFrameworkTemplateAssetCollection `GET /app-framework/templates/{templateIdOrApiName}/assets` Operation ID: `getAppFrameworkTemplateAssetCollection`. Tags: Template Assets. Returns a list of assets for the specified template. Returns a list of assets for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `TemplatedAssetCollectionRepresentation`. ### GET getAppFrameworkLatestAppActivityItem `GET /app-framework/apps/{appIdOrApiName}/activities/latest` Operation ID: `getAppFrameworkLatestAppActivityItem`. Tags: App Activities. Returns the latest activities for a specified app. Returns the latest activities for a specified app. #### Parameters * `appIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `AppActivityItemRepresentation`. ### GET getAppFrameworkTemplateLayout `GET /app-framework/templates/{templateIdOrApiName}/layout` Operation ID: `getAppFrameworkTemplateLayout`. Tags: Template Layout. Returns or updates the layout for the specified template. Returns the layout for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `UiLayoutDefinitionRepresentation`. ### PUT putAppFrameworkTemplateLayout `PUT /app-framework/templates/{templateIdOrApiName}/layout` Operation ID: `putAppFrameworkTemplateLayout`. Tags: Template Layout. Returns or updates the layout for the specified template. Updates the layout for the specified template. #### Parameters * `templateIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `UiLayoutDefinitionInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `UiLayoutDefinitionRepresentation`. ### GET getAppFrameworkTemplateRule `GET /app-framework/templates/{templateIdOrApiName}/rules/{ruleName}` Operation ID: `getAppFrameworkTemplateRule`. Tags: Template Rules. Returns, deletes, or updates a specified rule for the specified template. Returns a specified rule for the specified template. #### Parameters * `ruleName` (path, string, required) * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `RuleDefinitionRepresentation`. ### PUT putAppFrameworkTemplateRule `PUT /app-framework/templates/{templateIdOrApiName}/rules/{ruleName}` Operation ID: `putAppFrameworkTemplateRule`. Tags: Template Rules. Returns, deletes, or updates a specified rule for the specified template. Updates a specified rule for the specified template. #### Parameters * `ruleName` (path, string, required) * `templateIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `RuleDefinitionInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `RuleDefinitionRepresentation`. ### DELETE deleteAppFrameworkTemplateRule `DELETE /app-framework/templates/{templateIdOrApiName}/rules/{ruleName}` Operation ID: `deleteAppFrameworkTemplateRule`. Tags: Template Rules. Returns, deletes, or updates a specified rule for the specified template. Deletes a specified rule from the specified template. #### Parameters * `ruleName` (path, string, required) * `templateIdOrApiName` (path, string, required) #### Responses * **200** Success ### POST postJsonTransformation `POST /jsonxform/transformation` Operation ID: `postJsonTransformation`. Tags: JSON Transformation. Perform a JSON transformation using rules and expressions. Invokes a set of rules and expression on a json document #### Request body Media type: `application/json`. Schema: `JsonTransformationInputRepresentation`. #### Responses * **200** Success Media type: `application/json`. Schema: `JsonTransformationRepresentation`. ## Schemas ### AppActivityCollectionRepresentation The definition for a collection of an app's activity or history records. * `appId` (_string_) The ID or fully qualified API name of the app. * `items` (_array of AppActivityItemRepresentation_) A list of the app's activity records. ### AssetRepresentation The definition of an asset created from a template. * `appAssetVersion` (_number (double)_) The asset version used to create this asset * `appId` (_string_) he ID of the app the asset belongs to. * `assetIdOrName` (_string_) The primary ID or developer name of the asset. * `assetIdOrName2` (_string_) The secondary ID or developer name of the asset. * `assetIdOrName3` (_string_) The tertiary ID or developer name of the asset. * `id` (_string_) The ID of the asset association. * `summary` (_SummaryAssetRepresentation_) * `templateAssetSourceName` (_string_) The name of the source template asset used to create the asset. * `templateSourceId` (_string_) The ID of the source template asset used to create the asset. * `type` (_string_) The asset type. ### AssetInputRepresentation The definition for creating an asset from a template. * `appAssetVersion` (_number (double)_) The version of the app used to create this asset. * `appId` (_string_) The app ID that this asset belongs to. * `assetIdOrName1` (_string_) The primary ID or developer name of the asset. * `assetIdOrName2` (_string_) The secondary ID or developer name of the asset. * `assetIdOrName3` (_string_) The tertiary ID or developer name of the asset. * `templateAssetSourceName` (_string_) The template asset name associated with this asset. * `templateSourceId` (_string_) The app or component template id used to create this asset. * `type` (_string_) Asset Type ### TemplateTaskTypeEnum The template task types. Type: `string`. Allowed values: `App`, `Readiness`, `Setup`, `Template`. ### TemplateTaskCollectionRepresentation The definition for a collection of template tasks. framework * `tasks` (_array of TemplateTaskRepresentation_) A list of available template tasks. ### VariablesRepresentation The definition for the collection of all template variables. * `variables` (_object_) A list of variable definitions for the template. Additional properties: `VariableDefinitionRepresentation`. ### VariablesInputRepresentation The definition for the collection of all template variables. * `variables` (_object_) A list of variable definitions for the template. Additional properties: `VariableDefinitionInputRepresentation`. ### TemplateSubtypeEnum The app framework template subtype types. Type: `string`. Allowed values: `AgentforceAnalytics`, `Dashboard`, `DataCloud`, `Flow`, `Metric`, `SemanticModel`, `Tableau`, `Visualization`. ### TemplateTypeEnum The app framework template types. Type: `string`. Allowed values: `App`, `Component`, `Library`, `Unknown`. ### AppCollectionRepresentation The definition for a collection of template apps. * `apps` (_array of AppRepresentation_) A list of available templated apps. ### BaseAppInputRepresentation The base definition for creating an app from a template. * `assetIcon` (_string_) The icon enumeration that best represents the templated app. Valid values are 1.png through 20.png. * `description` (_string_) The description of the templated app. * `label` (_string_) The name of the templated app. * `name` (_string_) The API name of the templated app. ### AppResultRepresentation The definition for the results of creating a templated app. * `app` (_AppRepresentation_) * `appHubUrl` (_string (url)_) The URL to the app hub page. * `failureMessage` (_string_) The failure message if the app has failed. If the app is running asynchronously, it may not have completed yet. * `runtimeRequestId` (_string_) The ID of the runtime request for app creation. * `state` (_object_) The state of the app creation result. Additional properties: `object`. ### TemplateTagCollectionRepresentation The definition for a collection of template tags. * `tags` (_object_) The collection of tag names and values for a template. Additional properties: `array of string`. * `templateId` (_string_) The ID of the template. ### TemplateTagCollectionInputRepresentation The definition for a collection of template tags. * `tags` (_object_) The map of tag names and values for the template. Additional properties: `array of string`. ### InstalledAssetCollectionRepresentation The definition for a collection of assets associated with an app. * `assets` (_array of AssetRepresentation_) A list of templated and non-templated assets associated with an app. ### AssetByTemplateCollectionRepresentation The definition for a collection of all assets created from a template.. * `assets` (_array of AssetRepresentation_) A list of the assets created from the template. * `templateId` (_string_) The ID or fully qualified API name of the template. ### TemplateRepresentation The definition for a template. * `applicationSourceId` (_string_) The ID of the source app for the template.. * `assetVersion` (_number (double)_) The asset version of the template. * `assetsUrl` (_string (url)_) The URL for the template's assets. * `autoSetupUrl` (_string (url)_) The URL to run the automated setup of an app from the template. * `chainDefinitions` (_array of ChainDefinitionRepresentation_) A list of the chain definitions for the template. * `chainsUrl` (_string (url)_) The URL for the template chain definitions. * `configurationModifier` (_TemplateConfigurationModifierRepresentation_) * `configurationUrl` (_string (url)_) The URL for the template configuration. * `createdDate` (_string (date-time)_) The creation date of the template. * `description` (_string_) The description of the template. * `icons` (_TemplateIconsRepresentation_) * `id` (_string_) The ID or fully qualified API name of the template. * `label` (_string_) The label of the template. * `lastModifiedDate` (_string (date-time)_) The last modified date of the template. * `layoutDefinition` (_string_) The layout definition of the template. * `layoutUrl` (_string (url)_) The URL for the template layout definitions. * `maxAppCount` (_integer_) The maximum number of apps that can be created from this template. * `name` (_string_) The developer name of the template. * `namespace` (_string_) The namespace of the template. * `readinessUrl` (_string (url)_) The URL to run the readiness checks for the template. * `releaseInfo` (_ReleaseInfoRepresentation_) * `rules` (_array of RuleInfoRepresentation_) A list of the rules for the template. * `rulesUrl` (_string (url)_) The URL for the template rule definitions. * `tags` (_object_) A collection of the tag names and values for the template. Additional properties: `array of string`. * `templateStatus` (_TemplateStatusEnum_) * `templateSubtype` (_TemplateSubtypeEnum_) * `templateType` (_TemplateTypeEnum_) * `url` (_string (url)_) The URL for the template. * `variableDefinition` (_string_) The variable definition of the template. * `variablesUrl` (_string (url)_) The URL for the template variable definitions. ### TemplateUpdateRepresentation The definition for updating a template. Includes all fields of `BaseTemplateInputRepresentation`. ### ChainTypeEnum The chain types for a template. Type: `string`. Allowed values: `AutomatedSetup`, `Create`, `Delete`, `OrgReadiness`, `RefreshData`, `Update`. ### ChainDetailsRepresentation chain details. * `chain` (_DominoChainRepresentation_) * `dominoChainId` (_string_) The chain ID. * `file` (_string_) The json file name * `name` (_string_) The name of the chain * `type` (_ChainTypeEnum_) ### TemplateConfigurationRepresentation The definition for a template configuration. * `id` (_string_) The ID or fully qualified API name of the template. * `layout` (_UiLayoutDefinitionRepresentation_) * `name` (_string_) The developer name of the template. * `variables` (_object_) The variable names and values for the template. Additional properties: `VariableDefinitionRepresentation`. ### ChainDefinitionCollectionRepresentation The definition for the list of chains for a template. * `chains` (_array of ChainDefinitionRepresentation_) A list of chains for the template. * `templateId` (_string_) The ID or name of the template for which these chains belong. ### ChainDetailsInputRepresentation The definition for chain details. * `chain` (_DominoChainInputRepresentation_) * `file` (_string_) The file reference for the chain. * `name` (_string_) The name of the chain. * `type` (_ChainTypeEnum_) ### BasicAppUpdateRepresentation The definition for updating a basic app from a list of asset IDs. * `assetIds` (_array of string_) A list of asset IDs to associate with the app. ### AppRefreshInputRepresentation The definition to perform a data refresh on a templated app. * `logLevel` (_ConnectRuntimeLogEntryLevel_) * `refreshType` (_RefreshTypeEnum_) * `templateValues` (_object_) The runtime template values used to the control conditions in the chain. Additional properties: `object`. ### TemplateCollectionRepresentation The definition for a collection of templates. * `templates` (_array of TemplateRepresentation_) A list of the available templates. ### TemplateInputRepresentation The definition of a template.. Includes all fields of `BaseTemplateInputRepresentation`. * `assetVersion` (_number (double)_) The version of the template assets. * `chainDefinitions` (_array of ChainDefinitionInputRepresentation_) The Template chain definitions * `configurationModifier` (_TemplateConfigurationModifierInputRepresentation_) * `icons` (_TemplateIconsInputRepresentation_) * `id` (_string_) The ID of the template. * `layoutDefinition` (_string_) The layout definition for the template. * `maxAppCount` (_integer_) The maximum number of apps that can be created from this template. * `name` (_string_) The developer name of the template. * `namespace` (_string_) The namespace of the template. * `rules` (_array of RuleInfoInputRepresentation_) A list of rules for the template. * `tags` (_object_) A collection of the tag names and values for the template. Additional properties: `array of string`. * `templateStatus` (_TemplateStatusEnum_) * `templateSubtype` (_TemplateSubtypeEnum_) * `templateType` (_TemplateTypeEnum_) * `variableDefinition` (_string_) The variables definition for the template. ### AppActivityItemRepresentation The definition for an app activity record. * `activityType` (_ActivityTypeEnum_) * `appId` (_string_) The ID of app. * `id` (_string_) The ID of the app activity item record. * `runtimeRequest` (_DominoRuntimeRequestRepresentation_) * `url` (_string (url)_) The URL for the app activity item. ### RuleCollectionRepresentation he definition for a collection of rules for a template. * `rules` (_array of RuleSummaryRepresentation_) A list of the rule summaries for a template. * `testUrl` (_string (url)_) The URL for testing the rules. ### AssetCollectionRepresentation The definition for a collection of app assets created from a template. * `appId` (_string_) The ID or fully qualified API name of the app. * `assets` (_array of AssetRepresentation_) A list of the assets created from the template for the app. ### TemplateReadinessInputRepresentation The definition for validating org readiness for a template. * `logLevel` (_ConnectRuntimeLogEntryLevel_) * `templateValues` (_object_) The runtime template values used to control conditions in the chain. Additional properties: `object`. ### TemplateReadinessRepresentation The definition for validating org readiness for a template. * `id` (_string_) The ID of the validated template. * `runtimeRequestId` (_string_) The ID of the runtime request for the readiness check. * `state` (_object_) The state for the template readiness. Additional properties: `object`. * `status` (_ConnectRuntimeRequestStatusEnum_) * `tasks` (_array of TemplateReadinessItemRepresentation_) A list of the validation results from each requirement task. * `warningMessage` (_string_) A warning message for the readiness check. ### AppScheduleCollectionRepresentation The definition for a collection of app schedules. * `appId` (_string_) The ID or fully qualified API name of the app. * `schedules` (_array of AppScheduleRepresentation_) A list of app schedule records. ### AppScheduleCollectionInputRepresentation The definition for creating app schedules. * `schedules` (_array of AppScheduleInputRepresentation_) The list of schedules for the app. ### AppRepresentation The definition for a templated app. * `activitiesUrl` (_string (url)_) The URL for the most recent app installation activities. * `appAssetVersion` (_number (double)_) The asset version of the template used to create the app. * `applicationStatus` (_ConnectRuntimeRequestStatusEnum_) * `assetUrl` (_string (url)_) The URL for the app's assets. * `createdBy` (_UserRepresentation_) * `createdDate` (_string (date-time)_) The creation date of the app. * `description` (_string_) The description of the app. * `id` (_string_) The ID or fully qualified API name of the app. * `installationHistoryUrl` (_string (url)_) The URL to the installation history page for the app. * `label` (_string_) The label of this app. * `lastModifiedBy` (_UserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modification date of the app. * `latestActivityUrl` (_string (url)_) The URL to the most recent app activity. * `name` (_string_) The developer name of the app. * `refreshUrl` (_string (url)_) The URL to rerun the data assets and refresh the data. * `schedule` (_AppScheduleRepresentation_) * `templateSourceId` (_string_) The ID of the template used to create this app. * `templateSubtype` (_TemplateSubtypeEnum_) * `templateType` (_TemplateTypeEnum_) * `templateValues` (_object_) The variable values used to create the custom app. Additional properties: `object`. * `templateVersion` (_string_) The version of the template used to create the app. * `updateBasicAppUrl` (_string (url)_) The URL to run the update for a source app of a template. * `url` (_string (url)_) The URL to the app. ### AppUpdateRepresentation The definition to update or reconfigure a templated app. * `chainName` (_string_) The update chain name to run during the update, defined in the template-info file. to run. * `logLevel` (_ConnectRuntimeLogEntryLevel_) * `runtimeMethod` (_ConnectRuntimeMethodTypeEnum_) * `templateSourceId` (_string_) The template ID used to create the app. * `templateValues` (_object_) The runtime template values to use during app upgrade. Additional properties: `object`. ### BasicAppPatchInputRepresentation The definition for patching an existing basic app. * `description` (_string_) The updated description of the app. * `label` (_string_) The updated name of the app. ### TemplatedAssetCollectionRepresentation The definition for a collection of templated assets for an app. * `templatedAssets` (_array of TemplatedAssetRepresentation_) A list of the available templated assets. ### UiLayoutDefinitionRepresentation The top-level layout definition for a template configuration wizard. * `appDetails` (_AppDetailsRepresentation_) * `displayMessages` (_array of DisplayMessageRepresentation_) A list of display messages for the layout. * `navigationPanel` (_NavigationPanelRepresentation_) * `pages` (_array of PageLayoutRepresentation_) A list of page layouts for the layout. ### UiLayoutDefinitionInputRepresentation The top-level layout definition for a template configuration wizard. * `appDetails` (_AppDetailsInputRepresentation_) * `displayMessages` (_array of DisplayMessageInputRepresentation_) A list of display messages for the layout. * `navigationPanel` (_NavigationPanelInputRepresentation_) * `pages` (_array of PageLayoutInputRepresentation_) A list of page layouts for the layout. ### RuleDefinitionRepresentation The definition of the details for a template rule. * `constants` (_array of ConstantRepresentation_) A list of the constants for the rule. * `macros` (_array of MacroRepresentation_) A list of the macros for the rule. * `rules` (_array of RuleRepresentation_) A lists of rules for the rule. ### RuleDefinitionInputRepresentation The definition for a JSON rule. * `constants` (_array of ConstantInputRepresentation_) A list of the constants of the rule definition. * `macros` (_array of MacroInputRepresentation_) A list of the macros of the rule definition. * `rules` (_array of RuleInputRepresentation_) A list of the rules of the rule definition. ### JsonTransformationInputRepresentation The definition for a JSON transformation including the document, context, and rules. * `definition` (_RuleDefinitionInputRepresentation_) * `document` (_object_) The arbitrary JSON document to run the rules against. Additional properties: `object`. * `values` (_object_) A map of value or context objects used to resolve variables in expressions Additional properties: `object`. ### JsonTransformationRepresentation The definition for the transformed JSON after any rules are applied. * `document` (_object_) The collection of JSON diffs. Additional properties: `object`. ### SummaryAssetRepresentation The definition for a summary asset. * `description` (_string_) The description of the asset. * `id` (_string_) The ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The developer name of the asset. * `url` (_string (url)_) The URL to the asset. ### TemplateTaskRepresentation The definition for a template task. * `parameterExample` (_any_) A parameter example for the task. * `recommendedActivityTypes` (_array of string_) A list of the recommended activity types. * `taskDescription` (_string_) The description of the task. * `taskDescriptionItems` (_array of string_) A list of the task description items. * `taskName` (_string_) The name of the task. ### VariableDefinitionRepresentation The definition for a template variable. * `computedValue` (_any_) The computed value of the variable. This value is set by integrated apex implementations. * `defaultValue` (_any_) The default value of the variable. * `description` (_string_) The description of the variable. * `excludeSelected` (_boolean_) Indicates whether the variable is excluding values selected for other variables or not. * `excludes` (_array of string_) A list of values to exclude from the variable selection list. * `label` (_string_) The label for the variable. * `mostRecentValue` (_any_) The value specified in the most recent app creation process. * `required` (_boolean_) Indicates whether the variable is required by the template or not. * `variableType` (_VariableTypeRepresentation_) ### VariableDefinitionInputRepresentation The definition for a template variable. * `computedValue` (_any_) The computed value for the variable. This value is set by integrated apex implementations. * `defaultValue` (_any_) The default value for the variable. * `description` (_string_) The description of the variable. * `excludeSelected` (_boolean_) Indicates whether the variable is excluding values selected for other variables or not. * `excludes` (_array of string_) A list of values to exclude from the variable value selection list. * `label` (_string_) The label for the variable. * `required` (_boolean_) Indicates whether the variable is required by the template or not. * `variableType` (_VariableTypeInputRepresentation_) ### ChainDefinitionRepresentation The definition of a chain for a template. * `dominoChainId` (_string_) The ID of the chain definition. * `file` (_string_) The file name of the chain definition. * `name` (_string_) The name of the chain definition. * `type` (_ChainTypeEnum_) * `url` (_string (url)_) The url to the chain definition. ### TemplateConfigurationModifierRepresentation The definition for a template configuration modifier. * `name` (_string_) The name of the configuration modifier. * `namespace` (_string_) The namespace of the configuration modifier. ### TemplateIconsRepresentation The definition for the template's icons. * `appBadge` (_TemplateImageRepresentation_) * `layoutImages` (_array of TemplateImageRepresentation_) The images used in the layout. * `templateBadge` (_TemplateImageRepresentation_) * `templatePreviews` (_array of TemplateImageRepresentation_) The preview images for a template, displayed in the template details. ### ReleaseInfoRepresentation The definition for template release notes and version. * `notesFile` (_string_) The release notes file name for the template. * `templateVersion` (_string_) The version of the template. ### RuleInfoRepresentation The definition for a rule for a template. * `file` (_string_) The JSON file defining the rule. * `type` (_RuleTypeEnum_) ### TemplateStatusEnum The template status types. Type: `string`. Allowed values: `Draft`, `Published`. ### BaseTemplateInputRepresentation The base definition for a template. * `applicationSourceId` (_string_) The source app ID for this template. * `assetIds` (_array of string_) A list of asset IDs to templatize. * `description` (_string_) The description of the template. * `label` (_string_) The label for the template. * `releaseInfo` (_ReleaseInfoInputRepresentation_) ### DominoChainRepresentation The definition for an app template framework chain. * `createdBy` (_DominoUserRepresentation_) * `createdDateTime` (_string (date-time)_) The date and time the chain was created. * `definition` (_DominoGraphNodeDefinitionRepresentation_) * `description` (_string_) The description of the chain. * `dominoVariant` (_string_) The variant or implementation of the chain. * `finallyDefinition` (_DominoGraphNodeDefinitionRepresentation_) * `id` (_string_) The ID of the chain. * `label` (_string_) The label of the chain. * `lastModifiedBy` (_DominoUserRepresentation_) * `lastModifiedDateTime` (_string (date-time)_) The date and time the chain was last modified. * `name` (_string_) The API name of the chain. * `parameters` (_object_) The parameters of the chain. Additional properties: `object`. * `runtimesUri` (_string (url)_) The URL to runtimes of this chain. * `uri` (_string (url)_) The URL to the individual chain definition. ### DominoChainInputRepresentation The definition for an app template framework chain. * `createdBy` (_DominoUserInputRepresentation_) * `createdDateTime` (_string (date-time)_) Ignored attribute. The date and time the chain was created. * `definition` (_DominoGraphDefinitionInputRepresentation_) * `description` (_string_) The description for the chain. * `dominoVariant` (_string_) The app template framework variant associated with the chain. * `finallyDefinition` (_DominoGraphDefinitionInputRepresentation_) * `id` (_string_) The ID of the chain. * `label` (_string_) The label for the chain. * `lastModifiedBy` (_DominoUserInputRepresentation_) * `lastModifiedDateTime` (_string (date-time)_) Ignored attribute. The date and time the chain was last modified. * `name` (_string_) The API name of the chain. * `parameters` (_object_) The parameter payload for the chain. Additional properties: `object`. ### ConnectRuntimeLogEntryLevel The logging level of a single log entry. Type: `string`. Allowed values: `FineLevel`, `FinerLevel`, `FinestLevel`, `InfoLevel`, `SevereLevel`, `WarningLevel`. ### RefreshTypeEnum The data refresh types for an app. Type: `string`. Allowed values: `Full`, `Partial`. ### ChainDefinitionInputRepresentation The definition for a template chain declaration. * `file` (_string_) The file name for the chain definition. * `name` (_string_) The name of the chain definition. * `type` (_ChainTypeEnum_) ### TemplateConfigurationModifierInputRepresentation The definition for a template configuration modifier. * `name` (_string_) The name of the configuration modifier. * `namespace` (_string_) The namespace of the configuration modifier. ### TemplateIconsInputRepresentation The definition for the template's icons. * `appBadge` (_TemplateImageInputRepresentation_) * `layoutImages` (_array of TemplateImageInputRepresentation_) The images used in the layout. * `templateBadge` (_TemplateImageInputRepresentation_) * `templatePreviews` (_array of TemplateImageInputRepresentation_) The preview images for a template, displayed in the template details. ### RuleInfoInputRepresentation The definition for the template rule. * `file` (_string_) The JSON file defining the rule. * `type` (_RuleTypeEnum_) ### ActivityTypeEnum The activity types for an app. Type: `string`. Allowed values: `AutomatedSetup`, `Create`, `Delete`, `OrgReadiness`, `RefreshData`, `Update`. ### DominoRuntimeRequestRepresentation The definition for an app template framework runtime request. * `chain` (_DominoChainRepresentation_) * `configuration` (_DominoRuntimeConfigurationRepresentation_) * `createdBy` (_DominoUserRepresentation_) * `createdDateTime` (_string (date-time)_) The date and time the runtime request was created. * `definition` (_DominoRuntimeTaskNodeDefinitionRepresentation_) * `durationInSeconds` (_number (int64)_) The total duration in seconds for the runtime request. * `endDateTime` (_string (date-time)_) The date and time the runtime request completed. * `finallyDefinition` (_DominoFinallyTaskNodeDefinitionRepresentation_) * `id` (_string_) The ID of the runtime request. * `lastModifiedBy` (_DominoUserRepresentation_) * `lastModifiedDateTime` (_string (date-time)_) The date and time the runtime request was last modified. * `log` (_DominoAttachmentInfoRepresentation_) * `requestIndexMetadata` (_object_) The index metadata for the runtime request. Additional properties: `DominoIndexMetadataRepresentation`. * `requestMethod` (_ConnectRuntimeMethodTypeEnum_) * `requestStatus` (_ConnectRuntimeRequestStatusEnum_) * `startDateTime` (_string (date-time)_) The date and time the runtime request was started. * `state` (_DominoAttachmentInfoRepresentation_) * `stateUri` (_string (url)_) The URL to the most recent state of the runtime request. * `taskSummary` (_DominoSummarizedItemEntryRepresentation_) * `totalAttachmentSize` (_number (int64)_) The total attachment size, in bytes, consumed by the request. * `uri` (_string (url)_) The URL to the runtime task node's details. ### RuleSummaryRepresentation The definition of a summary for a template rule. * `file` (_string_) The file name of the rule. * `name` (_string_) The name of the rule. * `type` (_RuleTypeEnum_) * `url` (_string (url)_) The URL to the rule details. ### ConnectRuntimeRequestStatusEnum The status of app template framework execution requests. Type: `string`. Allowed values: `AbortedStatus`, `CancelledStatus`, `EnqueuedStatus`, `FailedStatus`, `InProgressStatus`, `NewStatus`, `SuccessStatus`, `SuccessWithWarningsStatus`. ### TemplateReadinessItemRepresentation The definition for the validation result of a readiness item for a template. * `message` (_string_) The specific message for the readiness item. * `readinessStatus` (_TemplateReadinessStatusEnum_) * `tags` (_array of string_) A list of the tags describing the purpose of the validation. * `type` (_string_) The type of the readiness check. ### AppScheduleRepresentation The definition for an app schedule. * `chainName` (_string_) The chain name to apply the schedule to. * `chainType` (_ChainTypeEnum_) * `schedule` (_ScheduledItemRepresentation_) * `url` (_string (url)_) The URL to the schedule details. ### AppScheduleInputRepresentation The definition of an app schedule. * `chainName` (_string_) The chain name to apply the schedule to. * `chainType` (_ChainTypeEnum_) * `schedule` (_ScheduledItemInputRepresentation_) ### UserRepresentation The definition of a user, in the context of templates and templated apps and assets. * `id` (_string_) The 18-character ID for the user. * `name` (_string_) The name of the user. * `profilePhotoUrl` (_string (url)_) The Chatter profile photo of the user. ### ConnectRuntimeMethodTypeEnum The types of execution methods for app template framework runtime requests. Type: `string`. Allowed values: `Asynchronous`, `Synchronous`. ### TemplatedAssetRepresentation The definition for a templated asset. * `assetType` (_string_) The type of the asset. * `body` (_string_) The body of the asset. * `fileName` (_string_) The file name of the asset. * `id` (_string_) The ID of the asset. * `templateId` (_string_) The ID of the template used to create the asset. * `templatedAssetName` (_string_) The name of the asset within the template. ### AppDetailsRepresentation The definition for the app details page of the template configuration wizard. * `guidancePanel` (_GuidancePanelRepresentation_) * `navigation` (_PageNavigationInfoRepresentation_) ### DisplayMessageRepresentation The definition for a display message on a template configuration wizard page. * `location` (_string_) The name of the page where the text content is displayed. * `text` (_string_) The text content to display. ### NavigationPanelRepresentation The definition for the navigation panel in the template configuration wizard. * `title` (_string_) The title for the navigation panel. ### PageLayoutRepresentation The definition for a page layout in the template configuration wizard. Discriminator: `type` selects the concrete type. Mapping: `Configuration` → `ConfigurationPageLayoutRepresentation`, `Validation` → `ValidationPageLayoutRepresentation`. * `backgroundImage` (_ImageReferenceRepresentation_) * `condition` (_string_) The conditional expression in which the page should be shown. Values should be client-side EL notation (e.g. {{Variables.selectedOption}}) * `guidancePanel` (_GuidancePanelRepresentation_) * `helpUrl` (_string_) A URL to the help content for the page. * `navigation` (_PageNavigationInfoRepresentation_) * `title` (_string_) The title for the page. * `type` (_PageTypeEnum_, required) ### AppDetailsInputRepresentation The definition for the app details page of the template configuration wizard. * `guidancePanel` (_GuidancePanelInputRepresentation_) * `navigation` (_PageNavigationInfoInputRepresentation_) ### DisplayMessageInputRepresentation The definition for a display message in the template configuration wizard. * `location` (_string_) The name of the page where the text content is displayed. * `text` (_string_) The text content to display. ### NavigationPanelInputRepresentation The definition for the navigation panel in the template configuration wizard. * `title` (_string_) The title for the navigation panel. ### PageLayoutInputRepresentation The definition for a page in the template configuration wizard. Discriminator: `type` selects the concrete type. Mapping: `Configuration` → `ConfigurationPageLayoutInputRepresentation`, `Validation` → `ValidationPageLayoutInputRepresentation`. * `backgroundImage` (_ImageReferenceInputRepresentation_) * `condition` (_string_) A conditional expression in which the page should be shown in the wizard flow or not. Values should be client-side EL notation (e.g. {{Variables.selectedOption}}). * `guidancePanel` (_GuidancePanelInputRepresentation_) * `helpUrl` (_string_) A URL to the help content for the page. * `navigation` (_PageNavigationInfoInputRepresentation_) * `title` (_string_) The title for the page. * `type` (_PageTypeEnum_, required) ### ConstantRepresentation The definition of a constant value for the template rules. * `name` (_string_) The name of the constant. * `value` (_any_) The expression value of the constant. ### MacroRepresentation The definition for a macro for template rules. * `definitions` (_array of MacroDefinitionRepresentation_) A list of the macro definitions for the macro. . * `namespace` (_string_) The namespace of the macro. ### RuleRepresentation The definition of a rule for a template. * `actions` (_array of ActionRepresentation_) A list of the actions the rule performs. * `appliesTo` (_array of AppliesToRepresentation_) A list of the assets the rule applies to. * `condition` (_string_) The EL condition for when to run the rule. * `name` (_string_) The name of the rule. ### ConstantInputRepresentation The definition for a constant in the JSON rules. * `name` (_string_) The name of the rule. * `value` (_any_) The value of the rule. ### MacroInputRepresentation The definition for a macro in the JSON rules. * `definitions` (_array of MacroDefinitionInputRepresentation_) A list of definitions for the macro. * `namespace` (_string_) The namespace of the macro. ### RuleInputRepresentation The definition for a JSON rule. * `actions` (_array of ActionInputRepresentation_) The actions of the rule. * `appliesTo` (_array of AppliesToInputRepresentation_) The name of the JSON to apply the rule to. * `condition` (_string_) The condition of the rule. * `name` (_string_) The name of the rule. ### VariableTypeRepresentation The base definition for a template variable type. Discriminator: `type` selects the concrete type. * `type` (_VariableTypeEnum_, required) ### VariableTypeInputRepresentation The base definition for a template variable type. Discriminator: `type` selects the concrete type. * `type` (_VariableTypeEnum_, required) ### TemplateImageRepresentation The definition for a template image. * `file` (_string_) The file path for the image. * `name` (_string_) The name of the image. * `url` (_string (url)_) The URL for the image. ### RuleTypeEnum The types of rules for a template. Type: `string`. Allowed values: `TemplateToApp`. ### ReleaseInfoInputRepresentation The definition for template release notes and version. * `notesFile` (_string_) The release notes file name for the template. * `templateVersion` (_string_) The version of the template. ### DominoUserRepresentation The definition for an app template framework user. * `id` (_string_) The ID of the user. * `name` (_string_) The full name of the user. * `profilePhotoUrl` (_string (url)_) The URL to the user's profile photo. * `username` (_string_) The username of the user. ### DominoGraphNodeDefinitionRepresentation The definition for a graph node in a chain. * `nodes` (_object_) The map of nodes representing the definition. Additional properties: `DominoGraphNodeRepresentation`. ### DominoUserInputRepresentation The definition for an app template framework user. * `id` (_string_) The ID of the user. * `name` (_string_) The full name of the user. * `username` (_string_) The username of the user. ### DominoGraphDefinitionInputRepresentation The definition for the graph nodes of a chain. * `nodes` (_object_) The map of graph nodes for the definition. Additional properties: `DominoGraphNodeInputRepresentation`. ### TemplateImageInputRepresentation The definition for a template image. * `file` (_string_) The image file. * `name` (_string_) The name of the image. ### DominoRuntimeConfigurationRepresentation The definition for the configuration of an app template framework runtime request. * `loggingLevel` (_ConnectRuntimeLogEntryLevel_) ### DominoRuntimeTaskNodeDefinitionRepresentation The definition for an app template framework runtime task node in an execution request. * `nodes` (_object_) The map of nodes representing the definition. Additional properties: `DominoRuntimeTaskNodeRepresentation`. ### DominoFinallyTaskNodeDefinitionRepresentation The definition for an app template framework runtime task node in an execution request. * `nodes` (_object_) The map of nodes representing the 'finally' definition. Additional properties: `DominoFinallyTaskNodeRepresentation`. ### DominoAttachmentInfoRepresentation The definition for an attachment. * `id` (_string_) The ID of the attachment. * `size` (_number (int64)_) The size of the attachment. * `uri` (_string (url)_) The URL to the attachment. ### DominoIndexMetadataRepresentation The definition for a request index metadata. * `chainId` (_string_) The chain ID of the index metadata. * `graphNodeId` (_string_) The graph node ID of the index metadata. * `id` (_string_) The ID of the index metadata. * `indexMetadataType` (_ConnectIndexMetadataTypeEnum_) * `key` (_string_) The key of the index metadata. * `requestId` (_string_) The request ID of the index metadata. * `value` (_string_) The value of the index metadata. ### DominoSummarizedItemEntryRepresentation The definition for an entry in the summarized report. * `failures` (_number (int64)_) The number of items that failed. * `inProgress` (_number (int64)_) The number of items that are currently in progress. * `notStarted` (_number (int64)_) The number of items that have not been started. * `successes` (_number (int64)_) The number of items that were successful. * `total` (_number (int64)_) The total number of items. * `totalAttachmentSizeInBytes` (_number (int64)_) The total attachment size in bytes. * `totalDurationInSeconds` (_number (int64)_) Total runtime duration in seconds. * `warnings` (_number (int64)_) The number of items that completed with warnings. ### TemplateReadinessStatusEnum The status types for a template readiness step. Type: `string`. Allowed values: `Complete`, `Failed`, `Warning`. ### ScheduledItemRepresentation The definition for a scheduled item. Discriminator: `frequency` selects the concrete type. Mapping: `Daily` → `DailyScheduledItemRepresentation`, `Hourly` → `HourlyScheduledItemRepresentation`, `Weekly` → `WeeklyScheduledItemRepresentation`. * `frequency` (_ConnectScheduleFrequencyTypeEnum_, required) * `nextScheduledRun` (_string (date-time)_) The next scheduled runtime. * `time` (_ScheduledTimeRepresentation_) ### ScheduledItemInputRepresentation The abstract definition for a scheduled item. Discriminator: `frequency` selects the concrete type. Mapping: `Daily` → `DailyScheduledItemInputRepresentation`, `Hourly` → `HourlyScheduledItemInputRepresentation`, `Weekly` → `WeeklyScheduledItemInputRepresentation`. * `frequency` (_ConnectScheduleFrequencyTypeEnum_, required) * `time` (_ScheduledTimeInputRepresentation_) ### GuidancePanelRepresentation The definition for the guidance panel on a template configuration wizard page. * `backgroundImage` (_ImageReferenceRepresentation_) * `items` (_array of PanelItemRepresentation_) A list of items to display in the guidance panel. * `title` (_string_) The title for the guidance panel. ### PageNavigationInfoRepresentation The definition for a page to display in the navigation panel. * `label` (_string_) The label for the page in the navigation panel. * `parentLabel` (_string_) The label for the parent node of the page in the navigation panel. ### ImageReferenceRepresentation The definition for an image reference on a template configuration wizard page. Includes all fields of `StaticResourceReferenceRepresentation`. ### PageTypeEnum The page type for a template configuration flow page. Type: `string`. Allowed values: `Configuration`, `Validation`. ### GuidancePanelInputRepresentation The description for a guidance panel on a template configuration wizard page. * `backgroundImage` (_ImageReferenceInputRepresentation_) * `items` (_array of PanelItemInputRepresentation_) A list of items to display in the guidance panel. * `title` (_string_) The title for the guidance panel. ### PageNavigationInfoInputRepresentation The definition for a page to display in the navigation panel. * `label` (_string_) The label for the page in the navigation panel. * `parentLabel` (_string_) The label for the parent node of this page in the navigation panel. ### ImageReferenceInputRepresentation The description for an image reference on a template configuration wizard page. * `name` (_string_) The path to the image file. ### MacroDefinitionRepresentation The definition for a macro in the JSON rules. * `actions` (_array of ActionInputRepresentation_) The actions of the rule. * `description` (_string_) The description of the rule. * `name` (_string_) The name of the rule. * `parameters` (_array of string_) The parameters of the rule. * `returns` (_any_) The returns of the rule. ### ActionRepresentation he definition of a template rules action. * `action` (_ConnectActionTypeEnum_) * `condition` (_string_) A conditional EL expression to determine if this action should be performed. * `description` (_string_) The description of the action. * `index` (_integer_) The index in the JSON array to insert the value. * `key` (_string_) The name of the JSON attribute. * `maxVersion` (_number (double)_) The maximum asset version for this action. * `minVersion` (_number (double)_) The minimum asset version for the action. * `path` (_string_) The JSON path pointing to where in the JSON to perform the action. * `value` (_any_) The value to set for the JSON attribute. ### AppliesToRepresentation The definition of which asset a template rule applies to. * `label` (_string_) The label of the asset the rule applies to. The label value isn't reliable as an identifier. * `name` (_string_) The template asset name of the asset to apply the rule to. Wildcard '\*' is supported. * `type` (_string_) The type of asset the rule applies to. ### MacroDefinitionInputRepresentation The definition for the details of a macro for template rules. * `actions` (_array of ActionRepresentation_) A list of the actions for the macro. * `description` (_string_) The description of the macro. * `name` (_string_) The name of the macro. * `parameters` (_array of string_) A list of the parameters for the macro. * `returns` (_any_) The return value of the macro. ### ActionInputRepresentation The definition for a rules action. * `action` (_ConnectActionTypeEnum_) * `condition` (_string_) The condition of the rule. * `description` (_string_) The description of the rule. * `index` (_integer_) The index into an array * `key` (_string_) The key of the rule. * `maxVersion` (_number (double)_) The maximum API version this rule applies to. * `minVersion` (_number (double)_) The minimum API version this rule applies to. * `path` (_string_) The JSON path of the rule. * `value` (_any_) The value of the rule. ### AppliesToInputRepresentation The definition for the JSON Rules applies to expression. * `label` (_string_) The label of the rule. * `name` (_string_) The name of the rule. * `type` (_string_) The type of the rule. ### VariableTypeEnum The variable types for the template variable definition. Type: `string`. Allowed values: `ArrayType`, `BooleanType`, `CalculatedInsightFieldType`, `CalculatedInsightType`, `ConnectorType`, `DataLakeObjectFieldType`, `DataLakeObjectType`, `DataModelObjectFieldType`, `DataModelObjectType`, `DataSpaceType`, `DatasetAnyFieldType`, `DatasetDateType`, `DatasetDimensionType`, `DatasetMeasureType`, `DatasetType`, `DateTimeType`, `NumberType`, `ObjectType`, `SemanticMetricType`, `SemanticModelFieldType`, `SemanticModelType`, `SobjectFieldType`, `SobjectType`, `StringType`. ### DominoGraphNodeRepresentation The definition for a graph node in a chain. Includes all fields of `DominoGraphableRepresentation`. * `graphNodeType` (_DominoGraphNodeTypeRepresentation_) * `parameters` (_object_) The parameters of the node. Additional properties: `object`. * `runAs` (_ConnectRuntimeRunAsEnum_) * `runAsUser` (_DominoUserRepresentation_) ### DominoGraphNodeInputRepresentation The definition for an app template framework graph node. Includes all fields of `DominoGraphableInputRepresentation`. * `graphNodeType` (_DominoGraphNodeTypeInputRepresentation_) * `parameters` (_object_) The parameter payload for the graph node. Additional properties: `object`. * `runAs` (_ConnectRuntimeRunAsEnum_) * `runAsUser` (_DominoUserInputRepresentation_) ### DominoRuntimeTaskNodeRepresentation The definition for a runtime task node in a runtime request. Includes all fields of `DominoGraphableRepresentation`. * `graphNode` (_DominoGraphNodeRepresentation_) * `id` (_string_) The ID of the runtime task node. * `log` (_DominoAttachmentInfoRepresentation_) * `results` (_object_) The collection of results this runtime task node maintains. Additional properties: `DominoRuntimeTaskResultRepresentation`. * `runtimeRequest` (_DominoRuntimeRequestRepresentation_) * `state` (_DominoAttachmentInfoRepresentation_) * `taskStatus` (_ConnectRuntimeTaskStatusEnum_) * `uri` (_string (url)_) The URL to this runtime task node. ### DominoFinallyTaskNodeRepresentation The definition for a finally task node in a runtime request. Includes all fields of `DominoGraphableRepresentation`. * `graphNode` (_DominoGraphNodeRepresentation_) * `id` (_string_) The ID of the finally task node. * `log` (_DominoAttachmentInfoRepresentation_) * `result` (_DominoRuntimeTaskResultRepresentation_) * `runtimeRequest` (_DominoRuntimeRequestRepresentation_) * `state` (_DominoAttachmentInfoRepresentation_) * `taskStatus` (_ConnectRuntimeTaskStatusEnum_) * `uri` (_string (url)_) The URL to this finally task node. ### ConnectIndexMetadataTypeEnum The type of app template framework index metadata entry. Type: `string`. Allowed values: `ChainIndex`, `CustomIndex`, `GraphNodeIndex`. ### ConnectScheduleFrequencyTypeEnum The type of schedule frequency. Type: `string`. Allowed values: `Daily`, `Hourly`, `Monthly`, `MonthlyRelative`, `Weekly`. ### ScheduledTimeRepresentation The definition for a scheduled time of day. * `hour` (_integer_) The hour of day. * `minute` (_integer_) The minute of hour. * `timezone` (_ScheduledTimezoneRepresentation_) ### ScheduledTimeInputRepresentation The definition for a scheduled time. * `hour` (_integer_) The hour of day. * `minute` (_integer_) The minute of hour. * `timezone` (_ScheduledTimezoneInputRepresentation_) ### PanelItemRepresentation The base definition of a panel item for a template configuration wizard page. Discriminator: `type` selects the concrete type. Mapping: `Component` → `CustomComponentItemRepresentation`, `GroupBox` → `GroupBoxItemRepresentation`, `Image` → `ImageItemRepresentation`, `LinkBox` → `LinkBoxItemRepresentation`, `Text` → `TextItemRepresentation`, `Variable` → `VariableItemRepresentation`. * `type` (_PanelItemTypeEnum_, required) * `visibility` (_string_) The visibility expression for the item. ### StaticResourceReferenceRepresentation The definition for a static resource reference. * `id` (_string (Id)_) The 18 character ID of the static resource. * `label` (_string_) The label of the static resource. * `name` (_string_) The developer name of the static resource. * `namespace` (_string_) The namespace of the static resource name. * `url` (_string (url)_) The URL of the static resource. ### PanelItemInputRepresentation The base definition of a panel item for a template configuration wizard page. Discriminator: `type` selects the concrete type. Mapping: `Component` → `CustomComponentItemInputRepresentation`, `GroupBox` → `GroupBoxItemInputRepresentation`, `Image` → `ImageItemInputRepresentation`, `LinkBox` → `LinkBoxItemInputRepresentation`, `Text` → `TextItemInputRepresentation`, `Variable` → `VariableItemInputRepresentation`. * `type` (_PanelItemTypeEnum_, required) * `visibility` (_string_) The visibility expression for the item. ### ConnectActionTypeEnum The supported types of rule actions. Type: `string`. Allowed values: `Add`, `Delete`, `Eval`, `Put`, `Replace`, `Set`. ### DominoGraphableRepresentation The definition for a graphable node. * `referenceId` (_string_) The reference ID of this node. * `sources` (_array of string_) The list of source reference IDs that this graph node depends on. This list may be empty or null when a node is requested individually. ### DominoGraphNodeTypeRepresentation The definition for a graph node type, per variant, in a chain. * `label` (_string_) The label of the graph node type. * `name` (_string_) The API name of the graph node type, per variant. * `phases` (_array of string_) The list of supported phases by the graph node type. ### ConnectRuntimeRunAsEnum The user to run task as. Type: `string`. Allowed values: `CurrentUser`. ### DominoGraphableInputRepresentation The definition for a graphable node. * `referenceId` (_string_) The reference ID of the graph node. * `sources` (_array of string_) The list of source reference IDs that this graph node depends on. ### DominoGraphNodeTypeInputRepresentation The definition for a graph node type. * `label` (_string_) The label of the graph node type. This value is ignored. * `name` (_string_) The API name of the variant graph node type. * `phases` (_array of string_) This attribute is for internal use only, values will be ignored. ### DominoRuntimeTaskResultRepresentation The definition for a runtime task result. * `durationInSeconds` (_number (int64)_) The duration in seconds for the runtime task. * `endDateTime` (_string (date-time)_) The date and time the runtime request completed. * `id` (_string_) The ID of the runtime task result. * `phase` (_string_) The phase of the runtime request. * `startDateTime` (_string (date-time)_) The date /time the runtime request was started. * `statusMessage` (_string_) The message related to the returned status. * `taskStatus` (_ConnectRuntimeTaskStatusEnum_) ### ConnectRuntimeTaskStatusEnum The status of runtime task nodes in a runtime request. Type: `string`. Allowed values: `AbortedStatus`, `CancelledBySystemStatus`, `CancelledByUserStatus`, `CompleteStatus`, `EnqueuedStatus`, `FailEndOfPhaseStatus`, `FailTerminalStatus`, `InProgressPollAtIntervalStatus`, `InProgressSelfReportStatus`, `InProgressWithObservationStatus`, `NewStatus`, `SkippedStatus`, `WarnAndContinueStatus`. ### ScheduledTimezoneRepresentation The definition for a time zone. * `gmtOffset` (_number (double)_) The signed offset, in hours, from GMT. * `name` (_string_) The display name of this time zone. * `zoneId` (_string_) The zone ID of this time zone. ### ScheduledTimezoneInputRepresentation The definition for a scheduled timezone. * `zoneId` (_string_) The valid timezone id for this scheduled timezone. ### PanelItemTypeEnum The item types for a panel on a template configuration flow page. Type: `string`. Allowed values: `Component`, `GroupBox`, `Image`, `LinkBox`, `Text`, `Variable`. ### VariableItemInputRepresentation The definition of a variable item type in the template configuration wizard. Includes all fields of `PanelItemInputRepresentation`. * `description` (_string_) The description of the variable. * `label` (_string_) The label of the variable. * `name` (_string_) The name of the variable. This must match the name of a defined variable. * `tiles` (_object_) A collection of tiles for the checkbox values. Additional properties: `VariableItemTileInputRepresentation`. * `type` (_PanelItemTypeEnum_) * `variant` (_string_) The variant of the variable. The valid values are CheckboxTiles and CenteredCheckboxTiles, SubHeader. ### ValidationPageGroupRepresentation The definition for a readiness requirement group on a validation page in the template configuration wizard. * `includeUnmatched` (_boolean_) Indicates whether the group should include any requirements that are otherwise unmatched by other groups. * `tags` (_array of string_) The tags for readiness requirements that will be included in this group. * `text` (_string_) The display text for the group. ### ValidationPageLayoutRepresentation The definition for a validation page in the template configuration wizard. Includes all fields of `PageLayoutRepresentation`. * `groups` (_array of ValidationPageGroupRepresentation_) A list of validation groups for the page. * `header` (_HeaderRepresentation_) ### NumberTypeRepresentation The definition for numeric variable types in templates. Includes all fields of `VariableTypeRepresentation`. * `enums` (_array of number (double)_) The restricted list of enumerated values, where applicable for numeric variable types. * `enumsLabels` (_array of string_) The display labels for the enumerated values. * `format` (_NumberTypeFormatEnum_) * `max` (_number (double)_) The maximum allowed value for the number. * `min` (_number (double)_) The minimum allowed value for the number. * `scale` (_integer_) The maximum scale for the number, digits after the decimal point. ### ValidationPageGroupInputRepresentation The definition for a readiness requirement group on a validation page in the template configuration wizard. * `includeUnmatched` (_boolean_) Indicates whether the group should include any requirements that are otherwise unmatched by other groups. * `tags` (_array of string_) A list of readiness requirements tags for the group. * `text` (_string_) The display text for the group. ### HeaderInputRepresentation The description for the header on a template configuration wizard page. * `description` (_string_) The description for the header. * `text` (_string_) The title for the header. ### BooleanTypeRepresentation The definition for boolean variable types in templates. Includes all fields of `VariableTypeRepresentation`. * `enums` (_array of boolean_) A restricted list of enumerated values, where applicable for boolean variable types. ### ArrayTypeRepresentation The definition for array variable types in templates. Includes all fields of `VariableTypeRepresentation`. * `enums` (_any_) The restricted list of enumerated values, where applicable for the inner variable types. * `itemsType` (_VariableTypeRepresentation_) * `sizeLimit` (_SizeLimitRepresentation_) ### BasicAppInputRepresentation The definition to create an app from asset IDs not associated with a template. Includes all fields of `BaseAppInputRepresentation`. * `assetIds` (_array of string_) A list of asset IDs to associate with the app. ### BaseObjectTypeInputRepresentation The base definition for object variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `properties` (_object_) A collection of the defined properties and types for the object variable type. type. Additional properties: `VariableTypeInputRepresentation`. * `required` (_array of string_) A list of the required properties for the object variable type. * `strictValidation` (_boolean_) Indicates whether to use strict validation when unexpected properties exist in the object's payload or not. ### SemanticMetricTypeRepresentation The definition for semantic metric variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. ### TwoColumnLayoutRepresentation The definition of a two column layout for a template configuration wizard page. Includes all fields of `LayoutRepresentation`. * `left` (_PanelRepresentation_) * `right` (_PanelRepresentation_) ### VariableItemRepresentation The definition of a variable item type in the template configuration wizard.. Includes all fields of `PanelItemRepresentation`. * `description` (_string_) The description of the variable * `label` (_string_) The label of the variable. * `name` (_string_) The name of the variable. * `tiles` (_object_) A collection of tiles for the checkbox values. Additional properties: `VariableItemTileRepresentation`. * `variant` (_string_) The variable variant. The valid values are CheckboxTiles and CenteredCheckboxTiles. ### StringTypeInputRepresentation The definition for string variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `enums` (_array of string_) The restricted list of enumerated values, where applicable for string variable types. * `enumsLabels` (_array of string_) The display labels for the enumerated values. * `type` (_VariableTypeEnum_) ### SingleColumnLayoutRepresentation The definition of a single column layout for a template configuration wizard page. Includes all fields of `LayoutRepresentation`. * `center` (_PanelRepresentation_) ### LinkBoxItemInputRepresentation The definition of a link box item type in the template configuration wizard. Includes all fields of `PanelItemInputRepresentation`. * `icon` (_string_) The icon for the link. * `text` (_string_) The text for the link. * `title` (_string_) The title for the link. * `type` (_PanelItemTypeEnum_) * `url` (_string_) The URL for the link. ### DataLakeObjectFieldTypeInputRepresentation The definition for data lake object field variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataType` (_string_) The data type for the data lake object field. * `type` (_VariableTypeEnum_) ### CalculatedInsightFieldTypeRepresentation The definition for calculated insight field variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataType` (_string_) The data type for calculated insights field. Valid values are 'string', 'number', 'date\_time', or 'date'. * `fieldType` (_string_) The type of the calculated insight field. Valid values are 'dimension' or 'measure'. ### CustomComponentLayoutVariableInputRepresentation The definition for a custom component layout variable on a template configuration wizard page. * `name` (_string_) The name of the variable. * `visibility` (_string_) The visibility expression for the variable. ### DataModelObjectTypeInputRepresentation The definition for data model object variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataSpace` (_string_) The data space for the data model object. * `type` (_VariableTypeEnum_) ### SObjectTypeRepresentation The definition for sObject variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. ### TextItemInputRepresentation The definition of a text item type in the template configuration wizard. Includes all fields of `PanelItemInputRepresentation`. * `text` (_string_) The text value for the item. * `type` (_PanelItemTypeEnum_) * `variant` (_string_) The text variant. The valid values are SubHeader and RichText. ### DateTimeTypeRepresentation The definition for date/time variable types in templates. Includes all fields of `VariableTypeRepresentation`. ### CalculatedInsightFieldTypeInputRepresentation The definition for calculated field variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataType` (_string_) The data type for the calculated field. * `fieldType` (_string_) The field type for the calculated field. * `type` (_VariableTypeEnum_) ### CustomComponentItemVariableRepresentation The definition for a custom component item variable on a template configuration wizard page. * `name` (_string_) The name of the variable. * `visibility` (_string_) The visibility expression for the variable. ### DataModelObjectFieldTypeInputRepresentation The definition for data model object field variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataType` (_string_) The data type for the data model object field. * `type` (_VariableTypeEnum_) ### SemanticMetricTypeInputRepresentation The definition for semantic metric variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `type` (_VariableTypeEnum_) ### CalculatedInsightTypeRepresentation The definition for calculated insights variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataSpace` (_string_) The data space for the calculated insight. ### PanelRepresentation The definition for a panel on a template configuration wizard page. * `items` (_array of PanelItemRepresentation_) A list of items in the panel. ### SObjectFieldTypeRepresentation The definition for sObject field variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataType` (_string_) The data type of the field. ### DataLakeObjectFieldTypeRepresentation The definition for data lake object field variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataType` (_string_) The data type of the data lake object field. Valid values are 'string', 'number', 'date\_time', or 'date'. ### DataSpaceTypeRepresentation The definition for data space variable types in templates.. Includes all fields of `BaseObjectTypeRepresentation`. ### DataSpaceTypeInputRepresentation The definition for data space variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `type` (_VariableTypeEnum_) ### DataLakeObjectTypeRepresentation The definition for data lake object variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataSpace` (_string_) The data space for the data lake object. ### CustomComponentItemRepresentation The definition for a custom component item on a template configuration wizard page. Includes all fields of `PanelItemRepresentation`. * `module` (_string_) The name of the LWC module. * `properties` (_object_) The additional properties to pass to the LWC. Additional properties: `object`. * `variables` (_array of CustomComponentItemVariableRepresentation_) The variables to be used by the LWC. ### BaseObjectTypeRepresentation The base definition for object variable types in templates. Includes all fields of `VariableTypeRepresentation`. * `properties` (_object_) A collection of the defined properties and types for the object variable type. type. Additional properties: `VariableTypeRepresentation`. * `required` (_array of string_) A list of the required properties for the object variable type. * `strictValidation` (_boolean_) Indicates whether to use strict validation when unexpected properties exist in the object's payload. ### VariableItemTileInputRepresentation The definition of checkbox tile details for a template configuration wizard variable item. * `badge` (_string_) The badge text for the tile. * `bodyDescription` (_string_) The body description of the tile. * `bodyTitle` (_string_) The body title of the tile. * `description` (_string_) The description of the tile. * `iconName` (_string_) The SLDSicon name for the tile. * `iconSize` (_string_) The icon size for the tile. Valid values are 'xx-small', 'x-small', 'small', 'medium', or 'large' (default). * `image` (_VariableItemTileImageInputRepresentation_) * `label` (_string_) The label for the tile. * `size` (_string_) The size of the tile. Valid values are 'large' (default), 'medium', or 'small'. * `visibility` (_string_) The visibility expression for the tile. ### NamespacedReferenceRepresentation The definition for a namespaced reference. * `name` (_string_) The name of the reference. * `namespace` (_string_) The namespace of the reference. ### TextItemRepresentation The definition of a text item type in the template configuration wizard. Includes all fields of `PanelItemRepresentation`. * `text` (_string_) The text for the item. * `variant` (_string_) The text variant. The valid values are SubHeader and RichText. ### HeaderRepresentation The definition for the header on a template configuration wizard page. * `description` (_string_) The description of the header. * `text` (_string_) The title for the header. ### ObjectTypeRepresentation The definition for object variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. ### LayoutTypeEnum The layout type for a template configuration page. Type: `string`. Allowed values: `Component`, `SingleColumn`, `TwoColumn`. ### ConfigurationPageLayoutInputRepresentation The definition for a configuration page in the template configuration wizard. Includes all fields of `PageLayoutInputRepresentation`. * `layout` (_LayoutInputRepresentation_) * `type` (_PageTypeEnum_) ### ImageItemInputRepresentation The description for an image panel item on a template configuration wizard page. Includes all fields of `PanelItemInputRepresentation`. * `image` (_ImageReferenceInputRepresentation_) * `type` (_PanelItemTypeEnum_) ### SingleColumnLayoutInputRepresentation The definition of a single column layout for a template configuration wizard page. Includes all fields of `LayoutInputRepresentation`. * `center` (_PanelInputRepresentation_) * `type` (_LayoutTypeEnum_) ### ObjectTypeInputRepresentation The definition for object variable types in templates. Includes all fields of `BaseObjectTypeInputRepresentation`. * `type` (_VariableTypeEnum_) ### VariableItemTileRepresentation The definition of tile details for a template configuration wizard variable item. * `badge` (_string_) The badge text for the tile. * `bodyDescription` (_string_) The body description of the tile. * `bodyTitle` (_string_) The body title of the tile. * `description` (_string_) The description of the tile. This overrides the description defined in the variable definition. * `iconName` (_string_) The name of the SLDS icon for the tile. * `iconSize` (_string_) The size of the icon. One of 'xx-small', 'x-small', 'small', 'medium', or 'large' (default). * `image` (_VariableItemTileImageRepresentation_) * `label` (_string_) The label of the tile. This overrides the label defined in the variable definition. * `size` (_string_) The size of the tile. One of 'large' (default), 'medium', or 'small'. * `visibility` (_string_) The visibility expression for the tile. ### DataModelObjectFieldTypeRepresentation The definition for data model object field variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataType` (_string_) The date type of the data model object field. Valid values are 'string', 'number', 'date\_time', or 'date'. ### SizeLimitInputRepresentation The definition of the size limit for an array type variable in templates. * `max` (_integer_) The maximum number of elements in the array. * `min` (_integer_) The minimum number of elements in the array. ### CustomComponentLayoutInputRepresentation The definition of a custom component layout on a template configuration wizard page. Includes all fields of `LayoutInputRepresentation`. * `module` (_string_) The name of the LWC module. * `properties` (_object_) The additional properties to pass to the LWC. Additional properties: `object`. * `type` (_LayoutTypeEnum_) * `variables` (_array of CustomComponentLayoutVariableInputRepresentation_) A list of variables to use for the LWC. ### SemanticModelTypeRepresentation The definition for semantic model variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataSpace` (_string_) The data space for the semantic model. ### CustomComponentLayoutRepresentation Representation for a custom component layout definition for template wizard pages. Includes all fields of `LayoutRepresentation`. * `module` (_string_) The name of the LWC module. * `properties` (_object_) The additional properties to pass to the LWC. Additional properties: `object`. * `variables` (_array of CustomComponentLayoutVariableRepresentation_) A list of variables to use for the LWC. ### AppInputRepresentation The definition for creating a templated app. Includes all fields of `BaseAppInputRepresentation`. * `appAssetVersion` (_number (double)_) The asset version for the template used to create this app. * `logLevel` (_ConnectRuntimeLogEntryLevel_) * `runtimeMethod` (_ConnectRuntimeMethodTypeEnum_) * `templateSourceId` (_string_) The ID of the template used to create this app. * `templateSubtype` (_TemplateSubtypeEnum_) * `templateType` (_TemplateTypeEnum_) * `templateValues` (_object_) The runtime template values used during application creation, as specified by the template. Additional properties: `object`. * `templateVersion` (_string_) The version of the template used to create this app. ### ArrayTypeInputRepresentation The definition for array variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `enums` (_any_) The restricted list of enumerated values, where applicable for the inner variable types. * `itemsType` (_VariableTypeInputRepresentation_) * `sizeLimit` (_SizeLimitInputRepresentation_) * `type` (_VariableTypeEnum_) ### SemanticModelTypeInputRepresentation The definition for semantic model variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataSpace` (_string_) The data space for the semantic model. * `type` (_VariableTypeEnum_) ### AppActivityItemInputRepresentation The definition for an app activity item. * `activityType` (_ActivityTypeEnum_) * `appId` (_string_) The ID of the app. * `dominoRuntimeRequestId` (_string_) The ID of the associated runtime request. * `id` (_string_) The ID of the app activity item. ### SObjectTypeInputRepresentation The definition for sObject variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `type` (_VariableTypeEnum_) ### CalculatedInsightTypeInputRepresentation The definition for calculated insight variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataSpace` (_string_) The data space for the calculated insight. * `type` (_VariableTypeEnum_) ### NamespacedReferenceInputRepresentation he definition for a namespaced reference. * `name` (_string_) The developer name. * `namespace` (_string_) The developer namespace. ### GroupBoxItemInputRepresentation The definition for a group box item on a template configuration wizard page. Includes all fields of `PanelItemInputRepresentation`. * `description` (_string_) The description of the group box. * `items` (_array of PanelItemInputRepresentation_) A list of items to include in the group. * `text` (_string_) The text for the group box title. * `type` (_PanelItemTypeEnum_) ### GroupBoxItemRepresentation The definition for a group box item on a template configuration wizard page. Includes all fields of `PanelItemRepresentation`. * `description` (_string_) The description of the group box. * `items` (_array of PanelItemRepresentation_) A list of items to include in the group. * `text` (_string_) The text for the group box title. ### NumberTypeInputRepresentation The definition for numeric variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `enums` (_array of number (double)_) The restricted list of enumerated values, where applicable for numeric variable types. * `enumsLabels` (_array of string_) The display labels for the enumerated values. * `format` (_NumberTypeFormatEnum_) * `max` (_number (double)_) The maximum allowed value for the number. * `min` (_number (double)_) The minimum allowed value for the number. * `scale` (_integer_) The maximum scale for the number, digits after the decimal point. * `type` (_VariableTypeEnum_) ### SObjectFieldTypeInputRepresentation The definition for sObject field variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataType` (_string_) The data type for the sObject field. * `type` (_VariableTypeEnum_) ### DataModelObjectTypeRepresentation The definition for data model object variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataSpace` (_string_) The data space for the data model object. ### DateTimeTypeInputRepresentation The definition for date/time variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `type` (_VariableTypeEnum_) ### SizeLimitRepresentation The definition of the size limit for an array type variable in templates. * `max` (_integer_) The maximum number of elements in an array. * `min` (_integer_) The minimum number of elements in an array. ### SemanticModelFieldTypeInputRepresentation The definition for semantic model field variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataType` (_string_) A comma-separated filter for the data type of allowed fields, for example Text, Number, Date.. * `fieldType` (_string_) The type of the semantic model field. Valid values are 'Dimension' or 'Measure'. * `metricId` (_string_) The ID to specific only fields from the specified metric in the semantic model. * `sourceType` (_string_) The source type of the semantic model field. Valid values are 'DataObject' or 'Calculated'. * `type` (_VariableTypeEnum_) ### SemanticModelFieldTypeRepresentation The definition for semantic model field variable types in templates. Includes all fields of `BaseObjectTypeRepresentation`. * `dataType` (_string_) A comma-separated filter for the data type of allowed fields, for example Text, Number, Date. * `fieldType` (_string_) The type of the semantic model field. Valid values are 'Dimension' or 'Measure'. * `metricId` (_string_) The ID to specific only fields from the specified metric in the semantic model. * `sourceType` (_string_) The source type of the semantic model field. Valid values are 'DataObject' or 'Calculated'. ### ConfigurationPageLayoutRepresentation The definition for a configuration page in the template configuration wizard. Includes all fields of `PageLayoutRepresentation`. * `layout` (_LayoutRepresentation_) ### ImageItemRepresentation The definition for an image panel item on a template configuration wizard page. Includes all fields of `PanelItemRepresentation`. * `image` (_ImageReferenceRepresentation_) ### LayoutRepresentation The base layout definition for the pages in a template configuration wizard. Discriminator: `type` selects the concrete type. Mapping: `Component` → `CustomComponentLayoutRepresentation`, `SingleColumn` → `SingleColumnLayoutRepresentation`, `TwoColumn` → `TwoColumnLayoutRepresentation`. * `header` (_HeaderRepresentation_) * `type` (_LayoutTypeEnum_, required) ### BooleanTypeInputRepresentation The definition for boolean variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `enums` (_array of boolean_) The restricted list of enumerated values, where applicable for boolean variable types. * `type` (_VariableTypeEnum_) ### VariableItemTileImageInputRepresentation The definition of checkbox tile image details for a template configuration wizard variable item. * `name` (_string_) The path to the image file. * `padding` (_string_) The padding for the tile image. * `size` (_string_) The size of the tile image. Either null/empty or 'wholetile'. ### StringTypeRepresentation The definition for string variable types in templates. Includes all fields of `VariableTypeRepresentation`. * `enums` (_array of string_) The restricted list of enumerated values, where applicable for string variable types. * `enumsLabels` (_array of string_) The display labels for the enumerated values. ### PanelInputRepresentation The definition for a panel on a template configuration wizard page. * `items` (_array of PanelItemInputRepresentation_) A list of items to display in the panel. ### ValidationPageLayoutInputRepresentation The definition of a validation page for the template configuration wizard. Includes all fields of `PageLayoutInputRepresentation`. * `groups` (_array of ValidationPageGroupInputRepresentation_) A list of validation groups for the validation page. * `header` (_HeaderInputRepresentation_) The header for the validation page. * `type` (_PageTypeEnum_) ### TwoColumnLayoutInputRepresentation The definition of a two column layout for a template configuration wizard page. Includes all fields of `LayoutInputRepresentation`. * `left` (_PanelInputRepresentation_) * `right` (_PanelInputRepresentation_) * `type` (_LayoutTypeEnum_) ### LinkBoxItemRepresentation The definition of a link box item type in the template configuration wizard. Includes all fields of `PanelItemRepresentation`. * `icon` (_string_) The icon for the link. * `text` (_string_) The text for the link. * `title` (_string_) The title for the link. * `url` (_string_) The URL for the link. ### VariableItemTileImageRepresentation The definition of a tile image reference for a variable item on a template configuration wizard page. Includes all fields of `StaticResourceReferenceRepresentation`. * `padding` (_string_) The padding for the tile image. * `size` (_string_) The size of the tile image. Either null/empty or 'wholetile'. ### NumberTypeFormatEnum The display format types for number variables. Type: `string`. Allowed values: `Currency`, `Decimal`, `Percent`, `PercentFixed`. ### TemplatedAssetInputRepresentation The definition of a templated asset. * `assetType` (_string_) The type of the asset. * `body` (_string_) The JSON body of the templated asset. * `templateId` (_string_) The ID of the parent template. * `templatedAssetName` (_string_) The name of the templated asset. ### LayoutInputRepresentation The base layout definition for the pages in a template configuration wizard. pages. Discriminator: `type` selects the concrete type. Mapping: `Component` → `CustomComponentLayoutInputRepresentation`, `SingleColumn` → `SingleColumnLayoutInputRepresentation`, `TwoColumn` → `TwoColumnLayoutInputRepresentation`. * `header` (_HeaderInputRepresentation_) * `type` (_LayoutTypeEnum_, required) ### DataLakeObjectTypeInputRepresentation The definition for data lake object variable types in templates. Includes all fields of `VariableTypeInputRepresentation`. * `dataSpace` (_string_) The data space for the data lake object. * `type` (_VariableTypeEnum_) ### CustomComponentItemInputRepresentation A definition of a custom component item on a template configuration wizard page. Includes all fields of `PanelItemInputRepresentation`. * `module` (_string_) The name of the LWC module. * `properties` (_object_) The additional properties to pass to the LWC. Additional properties: `object`. * `type` (_PanelItemTypeEnum_) * `variables` (_array of CustomComponentItemVariableInputRepresentation_) A list of variables to use for the LWC. ### CustomComponentLayoutVariableRepresentation The definition for a custom component layout variable on a template configuration wizard page. * `name` (_string_) The name of the variable. * `visibility` (_string_) The visibility expression for the variable. ### CustomComponentItemVariableInputRepresentation The definition of a custom component item variable on a template wizard page panel. * `name` (_string_) The name of the variable. * `visibility` (_string_) The visibility expression for the variable. ### DailyScheduledItemRepresentation The definition for a daily scheduled item. Includes all fields of `ScheduledItemRepresentation`. ### WeeklyScheduledItemRepresentation The definition for a weekly scheduled item. Includes all fields of `ScheduledItemRepresentation`. * `daysOfWeek` (_array of ConnectJsonXformDayOfWeekEnum_) The collection of days of week for the schedule. ### HourlyScheduledItemRepresentation The definition for an hourly scheduled item. Includes all fields of `ScheduledItemRepresentation`. * `daysOfWeek` (_array of ConnectJsonXformDayOfWeekEnum_) The collection of days of week for the schedule. * `hourlyInterval` (_integer_) The collection of days of week for the schedule. ### DailyScheduledItemInputRepresentation The definition for a daily scheduled item. Includes all fields of `ScheduledItemInputRepresentation`. ### RuleActionRepresentation The definition for a JSON rule action. * `action` (_ConnectActionTypeEnum_) * `condition` (_string_) The condition of the rule action. * `description` (_string_) The description of the rule action. * `index` (_integer_) The index for the action. Only applies to add action. * `key` (_string_) The key for set or put actions. * `path` (_string_) The JSON path to perform the action on. * `value` (_any_) The value to edit with the action. This only applies to put, set, add, and eval actions. ### HourlyScheduledItemInputRepresentation The definition for an hourly scheduled item. Includes all fields of `ScheduledItemInputRepresentation`. * `daysOfWeek` (_array of ConnectJsonXformDayOfWeekEnum_) The days of week for the scheduled item. * `hourlyInterval` (_integer_) The number of hours in between queueing or scheduling of an asset. ### WeeklyScheduledItemInputRepresentation The definition for a daily scheduled item. Includes all fields of `ScheduledItemInputRepresentation`. * `daysOfWeek` (_array of ConnectJsonXformDayOfWeekEnum_) The days of week for the scheduled item. ### ConnectJsonXformDayOfWeekEnum The day of week for the scheduled item. Type: `string`. Allowed values: `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday`, `Wednesday`. ### DominoAttachmentRepresentation The definition for a app template framework attachment. * `attachment` (_any_) The attachment object. * `format` (_ConnectAttachmentFormatEnum_) * `id` (_string_) The ID of the attachment. * `uri` (_string (url)_) The URL to the current attachment. ### DominoRuntimeTaskLogInputRepresentation The definition for inserting or appending to the runtime task node's log. * `entries` (_array of DominoRuntimeTaskLogEntryInputRepresentation_) The collection of log entries to append. ### DominoRuntimeRequestCollectionRepresentation The definition for a collection of app template framework runtime requests. * `items` (_array of DominoRuntimeRequestRepresentation_) The collection of runtime requests. * `size` (_integer_) The size of the request collection. ### DominoRuntimeLogRepresentation The definition for a runtime object log associated with a runtime requests. * `entries` (_array of DominoRuntimeLogEntryRepresentation_) The collection of runtime node log entries. * `eTag` (_string_, read-only) An ETag like field, readOnly, handy while caching. * `weakEtag` (_string_, read-only) A record version like field, readOnly, handy while caching and comparing versions of records. ### DominoSummaryReportRepresentation The definition for a report summary. * `entries` (_object_) The map of summarized item entries. Additional properties: `DominoSummarizedItemEntryRepresentation`. ### DominoFinallyTaskNodeCollectionRepresentation The definition for a collection of finally task nodes. * `items` (_array of DominoFinallyTaskNodeRepresentation_) The collection of runtime task nodes. * `size` (_integer_) The size of the collection of tasks. ### DominoChainCollectionRepresentation The definition for a collection of app template framework chains. * `items` (_array of DominoChainRepresentation_) The collection of chains. * `size` (_integer_) The size of the collection of chains. ### DominoRuntimeTaskResultUpdateInputRepresentation The definition for updating an existing runtime task node. * `log` (_DominoRuntimeTaskLogInputRepresentation_) * `phase` (_string_) The name of the phased result to update. * `resultId` (_string_) A unique ID that represents the result of this runtime task node. * `state` (_object_) The updated runtime task node state. Additional properties: `object`. * `statusMessage` (_string_) The updated status message of the runtime task node. * `taskStatus` (_ConnectRuntimeTaskStatusEnum_) ### ConnectAttachmentFormatEnum The format of app template framework attachments. Type: `string`. Allowed values: `JsonFormat`, `TextFormat`. ### DominoRuntimeTaskLogEntryInputRepresentation The definition for a runtime task log entry. * `logLevel` (_ConnectRuntimeLogEntryLevel_) * `logSource` (_ConnectRuntimeLogSource_) * `message` (_string_) The message of the logged entry. * `phase` (_string_) The iteration or phase of the log entry. * `timestamp` (_string (date-time)_) The timestamp of the logged event. * `username` (_string_) The username of the logged event. This may not be associated with a Salesforce username, but a username of an external system. ### ConnectSummarizedReportByEnum The configuration for the grouping of the summary report. Type: `string`. Allowed values: `GraphNodeType`, `ResultId`, `SearchIndex`, `Variant`. ### DominoRuntimeRequestInsertInputRepresentation The definition for creating a chain runtime request. * `chain` (_DominoChainInputRepresentation_) * `completionPhase` (_string_) When set, the runtime request only executes the specified phase and prerequisite phases. Optional. * `configuration` (_DominoRuntimeConfigurationInputRepresentation_) * `requestStatus` (_ConnectRuntimeRequestStatusEnum_) * `state` (_object_) The original state of the runtime request. Additional properties: `object`. ### ConnectRuntimeLogSource The logging level of a single log entry. Type: `string`. Allowed values: `ExternalApi`, `InternalEvent`, `VariantObserver`, `VariantRuntimeTask`. ### DominoVariantRepresentation The definition for an app template framework chain. * `chains` (_string (url)_) The URL to the chains resource of this variant. * `description` (_string_) The description of the variant. * `fullyQualifiedApiName` (_string_) The API name of the variant. * `graphNodeTypes` (_array of DominoGraphNodeTypeRepresentation_) The collection of supported graph node types. * `label` (_string_) The label of the variant. * `phases` (_array of string_) The phases of the variant. * `uri` (_string (url)_) The URL to this app template framework variant. ### DominoRuntimeTaskNodeCollectionRepresentation The definition for a collection of runtime task nodes. * `items` (_array of DominoRuntimeTaskNodeRepresentation_) The collection of runtime task nodes. * `size` (_integer_) The size of the collection of tasks. ### DominoRuntimeRequestUpdateInputRepresentation The definition for updating a chain runtime request. * `requestStatus` (_ConnectRuntimeRequestStatusEnum_) ### DominoRuntimeLogEntryRepresentation Representation for a runtime object log entry associated with a runtime object. * `logLevel` (_ConnectRuntimeLogEntryLevel_) * `logSource` (_ConnectRuntimeLogSource_) * `message` (_string_) The message for the log entry. * `phase` (_string_) The iteration or phase the log entry was produced. * `timestamp` (_string (date-time)_) The timestamp for the log entry. * `username` (_string_) The username for the log entry. * `eTag` (_string_, read-only) An ETag like field, readOnly, handy while caching. * `weakEtag` (_string_, read-only) A record version like field, readOnly, handy while caching and comparing versions of records. ### DominoRuntimeConfigurationInputRepresentation The definition for a runtime request configuration. * `loggingLevel` (_ConnectRuntimeLogEntryLevel_) ### DominoRuntimeStateRepresentation The definition for a runtime request state. * `state` (_object_) The runtime request state. Additional properties: `object`. ### DominoVariantCollectionRepresentation Representation for a collection of domino variants. * `items` (_array of DominoVariantRepresentation_) The collection of variants. * `size` (_integer_) The size of the collection of variants. # Attributes for Analytics Dashboards Aura Component The Aura CRM Analytics dashboard component has attributes that you can set programmatically to render and interact with a CRM Analytics dashboard on a page at runtime. ## Attributes | Name | Type | Required or Optional | Description | | -------------------------- | ----------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `access​Token` | string | Optional | A valid access token obtained by logging into Salesforce. Useful when Lightning Out uses the component in a non-Salesforce domain. | | `body` | component[] | Optional | Inherited from `aura:component`. The body of the component. In markup, this is everything in the body of the tag.| | `dashboard​Id` | string | Required if `developerName` isn’t specified. | The unique ID of the dashboard. You can get the ID using the `describeDashboard` method of the `wave:sdk` component. If the `developerName` attribute is specified, don’t include this attribute. | | `developer​Name` | string | Required if `dashboardId` isn’t specified. | The unique developer name of the dashboard. You can get the developerName using the `describeDashboard` method of the `wave:sdk` component. If the `dashboardId` attribute is specified, don’t include this attribute. | | `enable​Notifications` | boolean | Optional | Allows users to set conditions and get notified about updates to dashboard widgets (`true`) or not (`false`). And when Show Header is true, this option also surfaces the notifications icon in the dashboard header, which opens the notifications management panel for editing and deleting notifications. If you enable Show Header, it’s recommended that the dashboard is at least 400 pixels in width to accommodate the management panel. The default value is `true`. | | `enable​Subscriptions` | boolean | Optional | Allows users with permission to subscribe for periodic email updates on dashboard widgets (`true`) or not (`false`). And when Show Header is true, this option also surfaces the subscriptions icon in the dashboard header, which opens the subscriptions management panel for editing and deleting subscriptions. If you enable Show Header, it’s recommended that the dashboard is at least 400 pixels in width to accommodate the management panel. The default value is `true`. | | `filter` | string | Optional | Adds selections or filters to the embedded dashboard at runtime. The filter attribute is configured using JSON. With the filter option, the dashboard is shown with only filtered data. For more information, see [Filter and Selection Syntax for Embedded Dashboards](https://help.salesforce.com/articleView?id=bi_embed_filters.htm). | | `height` | integer | Optional | Specifies the height of the dashboard in pixels. The default value is `300`. | | `hide​On​Error` | boolean | Optional | Indicates whether users can see a dashboard that has an error (`false`) or not (`true`). When false, the dashboard appears but doesn’t show any data. The default value is `false`. An error can occur when a user doesn't have permission to view the dashboard or the dashboard has been deleted. | | `is​Loaded` | boolean | Set by the component | Indicates whether the dashboard is fully loaded on the page (`true`) or not (`false`). The component code sets this flag to inform the user when the dashboard is ready for interaction. The default value is `false`. | | `open​Links​In​New​Window` | boolean | Optional | Indicates whether links to other dashboards open in a new window (`true`) or not (`false`). The default value is `true`. | | `open​Location` | string | Optional | This option specifies where the dashboard opens when users click the open icon. The default behavior is to open the dashboard in Analytics Studio (`OPEN_IN_STUDIO`). Other options include opening the dashboard in the Salesforce Lightning tab (`OPEN_IN_TAB`) or disabling the open icon (`HIDE`). | | `page​Id` | string | Optional | Specifies the initial dashboard page when the component renders. If not provided, the default dashboard page is rendered. | | `record​Id` | string | Optional | The ID of the current entity for the component’s display context. | | `rendered` | boolean | Set by the component | Indicates whether the component is rendered (`true`) or not (`false`). The component code sets this flag to inform the user when the component is ready for interaction. The default value is `true`. | | `show​Header` | boolean | Optional | Indicates whether the dashboard displays with a header bar that includes dashboard information and controls including the Open in Analytics icon and the dashboard views menu (`true`) or not (`false`). The default value is `true`. The header bar automatically appears when either `showSharing` or `showTitle` is `true`. | | `show​Sharing` | boolean | Optional | Indicates whether the dashboard shows the Share icon (`true`) or not (`false`). The dashboard must be shareable. When true, users can click the icon to open the Share dialog, where they can post to Chatter and download images and data. To show the Share icon, the minimum dashboard height is 612 pixels. The default value is `false`. | | `show​Title` | boolean | Optional | Indicates whether the dashboard renders with a title (`true`) or not (`false`). The default value is `true`. | ## Example Here’s an example of a CRM Analytics dashboard component with most of the attributes specified. This example shows custom values overriding the default values. ```xml ``` **See Also** - [Dashboard Component Methods](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-methods.md) - [Dashboard Component Use Cases](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-usecases.md) # Aura Component for CRM Analytics Dashboards The Aura component `wave:waveDashboard` displays a CRM Analytics dashboard in a Visualforce or Lightning page. The component, **CRM Analytics Dashboard** is available in the Lightning App Builder as a drag-and-drop component. You can also create your own component to interact programmatically with the `wave:waveDashboard` component. To display a CRM Analytics dashboard, pass in the required attribute, which is either the `dashboardId` or the `developerName`. All other attributes have a default value and are only specified if you want to override with your own custom value. To change the dashboard state dynamically, use the `filter` attribute to add selections or filters to the embedded dashboard. You can filter dataset fields by variables or specified values. See [Filter and Selection Syntax for Embedded Dashboards](https://help.salesforce.com/s/articleView?id=analytics.bi_embed_filters.htm) in Salesforce Help. You can also update the dashboard state via the `setState` component method or by using the CRM Analytics Web SDK Events like `wave:update`. For details on using events to interact with this component, see [CRM Analytics Aura Events](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_sdk.meta/bi_dev_guide_sdk/bi_sdk_web.htm) in the _Analytics SDK Developer Guide_. Here's an example of a simple Aura component for CRM Analytics dashboards. ```xml ``` **See Also** - [Wave Dashboard Aura Component Reference](https://developer.salesforce.com/docs/component-library/bundle/wave:waveDashboard/documentation) - _Salesforce Help_: [Embed Dashboards in Lightning Pages](https://help.salesforce.com/s/articleView?id=analytics.bi_embed_lightning.htm) - [Add an Analytics Dashboard to a Visualforce Page](https://help.salesforce.com/s/articleView?id=analytics.bi_embed_vf.htm) - [Lightning Web Components Developer Guide](https://developer.salesforce.com/docs/platform/lwc/guide) # Authenticate for Tableau Next Salesforce Connect API Endpoints Connect REST API uses OAuth to securely identify your application before connecting to Salesforce. ## OAuth and Connect REST API For current OAuth information, see [OAuth and Connect REST API](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/intro_using_oauth.htm) in the Connect REST API developer guide. ## More Resources Salesforce offers the following resources to help you navigate connected apps and OAuth: - _Salesforce Help_: [Connected Apps](https://help.salesforce.com/articleView?id=connected_app_overview.htm) - _Salesforce Help_: [Authorize Apps with OAuth](https://help.salesforce.com/articleView?id=remoteaccess_authenticate.htm) - _Salesforce Help_: [OpenID Connect Token Introspection](https://help.salesforce.com/articleView?id=remoteaccess_oidc_token_introspection_endpoint.htm) - _Trailhead_: [Build Integrations With External Client Apps](https://trailhead.salesforce.com/content/learn/projects/build-integrations-with-external-client-apps) # Authenticate for Tableau Next Salesforce REST API Endpoints The Tableau Next REST API is a REST API that connects your application to large language models (LLMs). Start by creating a Salesforce app and generating a JSON Web Token (JWT) that you can use to access this API. ![API Flow](https://developer.salesforce.com/docs/media/api/api-onboarding-steps.png '{"class": "image-full"}') ## Step 1. Create a Salesforce App To securely communicate with Salesforce using the Tableau Next REST API, you must create an [External Client App](https://help.salesforce.com/s/articleView?id=xcloud.external_client_apps.htm) or a [Connected App](https://help.salesforce.com/s/articleView?id=xcloud.connected_app_overview.htm). Both app types allow external services to integrate with Salesforce APIs using well-known authorization protocols, such as OAuth. External Client Apps (ECAs) are the new generation of Salesforce apps, and we suggest that you use an ECA for this purpose. However, these basic guidelines apply to both app types. Create an external client app with OAuth and JWT enabled. Use these instructions to get set up: [Create a Local External Client App](https://help.salesforce.com/s/articleView?id=xcloud.create_a_local_external_client_app.htm). When creating the app, include these settings. 1. Use these OAuth scopes. - **Manage user data via APIs (api):** Gives you access to user data. - **Perform requests at any time (refresh_token, offline_access):** Permits you to get an OAuth access token. - **Access the Salesforce API Platform (sfap_api):** Enables access to the Salesforce REST API platform. ![OAuth settings scope](https://developer.salesforce.com/docs/media/api/oauth-settings-1.png) 2. Select these additional OAuth settings. - **Enable Client Credentials Flow:** Allows your app to exchange its client credentials for an access token. - **Issue JWT Web Token (JWT)-based access tokens for named users:** Allows app to issue tokens for named users. ![OAuth settings checkboxes](https://developer.salesforce.com/docs/media/api/oauth-settings-2.png) 3. After creating the app, ensure that the API caller has the correct client credentials and that the client can issue JWT-based access tokens. - Click the **Policies** tab for the app, and then click **Edit**. - Select the **Enable Client Credentials Flow** checkbox. - Specify the client user in the **Run As** field. - Select the **Issue JSON Web Token (JWT)-based access tokens** checkbox. By default, this token expires in 30 minutes. You can change this value to less than 30 minutes. ![OAuth user settings](https://developer.salesforce.com/docs/media/api/oauth-settings-3.png '{"class": "image-md"}') ## Step 2. Generate a JWT A JSON Web Token (JWT) is required for authorization. 1. From Setup, in the Quick Find box, enter `External Client Apps`, and then select **External Client Apps Manager**. 2. Select your app, and click the **Settings** tab. 3. Expand the **OAuth Settings** section. 4. Click the **Consumer Key and Secret** button, and copy your key and secret. You need these values to mint this token. **important:** Store your consumer secret in a secure location. 5. From Setup, in the Quick Find box, enter `My Domain`, and then select **My Domain**. 6. Copy the value shown in the **Current My Domain URL** field. 7. Request a JWT from Salesforce using a POST request, specifying the values for your domain, consumer key, and consumer secret. For example: ```bash curl -X POST https://{my_domain}/services/oauth2/token -d "grant_type=client_credentials&client_id={consumer_key}&client_secret={consumer_secret}" ``` ```json {"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IlNBTVBMRSBKV1QgRk9SIERFTU8gUFVSUE9TRVMiLCJpYXQiOjE1MTYyMzkwMjJ9.XYwlhE_q0-yVwswgaXuOx2nbXRFpEbagcScXnjWt2yo","signature":"uSs/SAlD/i+pL93EdLVUUY4F8uqfHHtteFii2E3zkhc=","token_format":"jwt","scope":"sfap_api analytics_agent_api api","instance_url":"https://sample-company.my.salesforce.com","id":"https://login.pc-rnd.salesforce.com/id/XYZ/ABC","token_type":"Bearer","issued_at":"1713195676742","api_instance_url":"https://api.salesforce.com"} ``` **tip:** If you receive an `invalid_grant` error with the description, `request not supported on this domain`, verify that the domain is the domain specified when you view **My Domain** in Setup. 8. Use the `access_token` value in this response for the `Authorization` header in your API requests. For example: ```bash Authorization: Bearer {access_token} ``` ## See Also - _Salesforce Help_: [External Client Apps](https://help.salesforce.com/s/articleView?id=xcloud.external_client_apps.htm) - _Salesforce Help_: [Connected Apps](https://help.salesforce.com/s/articleView?id=xcloud.connected_app_overview.htm) # Authentication The Tableau Next REST API uses JSON Web Tokens (JWT) for authentication. This ensures secure access to the API endpoints while maintaining stateless authentication. ## Getting Started with Authentication To authenticate your requests to the Tableau Next REST API: 1. Obtain an API key from your Tableau Next administrator 2. Generate a JWT token using your API key 3. Include the token in the Authorization header of your requests ## API Key Management Your API key is a sensitive credential that should be kept secure. Best practices include: - Store API keys in environment variables or secure credential stores - Never commit API keys to version control - Rotate API keys periodically - Use different API keys for development and production environments ## Making Authenticated Requests Include your JWT token in the Authorization header of your requests: ```bash curl -X GET https://api.tableaunext.com/v1/dashboards \ -H "Authorization: Bearer YOUR_JWT_TOKEN" ``` ## Token Expiration and Refresh JWT tokens have an expiration time for security. Your application should: 1. Check token expiration before making requests 2. Refresh tokens before they expire 3. Handle token expiration errors gracefully ## Security Best Practices To maintain the security of your API access: - Keep API keys and tokens secure - Use HTTPS for all API requests - Implement token refresh logic - Monitor API usage for suspicious activity - Follow the principle of least privilege when requesting access scopes # auto-install.json Attributes The `auto-install.json` file attributes are: | Attribute | Required | Description | | ----------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `hooks` | No | Container for hook types. | | `hooks` → `type` | Yes | The type of auto-install hook. Valid values are: `PackageInstall`. | | `hooks` → `requestName` | No | The name for the auto-install request. | | `configuration` → `appConfiguration` | No | The configuration to use for creating the app. | | `configuration` → `appConfiguration` → `autoShareWithLicensedUsers` | No | Indicates whether the app is automatically shared with users that have the AnalyticsViewOnlyEmbeddedApp license (`true`) or not (`false`). The default value is `false`. | | `configuration` → `appConfiguration` → `autoShareWithOriginator` | No | Indicates whether the app is automatically shared with the user who initiated the auto-install request (`true`) or not (`false`). The default value is `true`. | | `configuration` → `appConfiguration` → `deleteAppOnConstructionFailure` | No | Indicates whether the app is deleted when the auto-install request fails due to a construction error (`true`) or not (`false`). The default value is `false`. | | `configuration` → `appConfiguration` → `failOnDuplicateName` | No | Indicates whether the app creation fails when an existing app or asset exists with the same developer name (`true`) or not (`false`). The default value is `false`. | | `configuration` → `appConfiguration` → `values` | No | A map of variable values to use when creating the app. The variable names must correspond to variables defined in the `variables.json` file | **See Also** - [Edit auto-install.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-edit-auto-install-json.md) # avg() Takes the average of row values in a given column. `avg()` follows this syntax. ```nolang SELECT avg(COLUMN_NAME) FROM DATASET WHERE CONDITION; ``` # avg() or average() Returns the average of the values of a measure field. ## Example - Calculate the Average Amount of an Opportunity Grouped by Type Use `avg()` to compare the average size of opportunities for each account type. ```nolang q = load "DTC_Opportunity"; q = group q by 'Account_Type'; q = foreach q generate 'Account_Type' as 'Account_Type', avg('Amount') as 'avg_Amount'; ``` **See Also** - [median()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-med.md) # Basic Structure of the XMD JSON File The XMD file is in JSON format. It contains a block of parameters for each dataset field. This design makes it easier to debug specific field behavior and maintain consistent syntax usage, and it streamlines the generation process. XMD doesn’t support empty strings. The file uses this structure. ```nolang { "dataset": {}, "dates": [], "dimensions": [], "derivedDimensions": [], "measures": [], "derivedMeasures": [], "organizations": [], "showDetailsDefaultFields": [] } ``` The `dataset` field specifies the dataset to which the XMD applies. CRM Analytics sets and maintains this parameter internally. Do not modify it. For descriptions of the fields, see [Extended Metadata (XMD) Reference](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference.md). To learn how to structure and format the XMD parameters for different purposes, see the [use cases](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-formatting-dataset-fields-and-values.md). # Best Practices When creating template dependencies, follow these guidelines. 1. Make the `templateVersion` as broad as possible. 2. Always include namespace. 3. For ease of maintenance, keep your template dependencies simple. There’s no technical limitation to the number of dependencies you can create. But in practice, it’s best to avoid creating multiple dependencies from one template to others. Also, avoid making supporting templates dependent on other templates. # Best Practices for the Tableau Next Embedding SDK These are best practices to get the most from your embedding implementation. ## Authentication Management - Don't hardcode OAuth tokens or Frontdoor URLs in your client-side code. - Pass credentials to the browser only when strictly necessary. Credentials can be scraped from the browser by malicious actors. ## Event Handling Add event listeners to your component to handle interactions. Customize component actions and messaging to your end users ## Build for Responsiveness Use an HTML container to embed your component. The built-in container responsiveness to the changes in the web page ensures the component changes height and width smoothly. ## Utilize Debug Mode Before deploying your web app for production, turn on debug mode to check for warnings and errors. Remember to turn off debug mode in production. # BETWEEN Operator Use `BETWEEN` to check whether values fall within a given range. `BETWEEN` accepts numeric, string, and date data types, and can be used with aggregate, window, and math functions. `BETWEEN` takes this syntax. ```nolang BETWEEN (SYMMETRIC | ASYMMETRIC) AND ``` ## Numeric Example This example filters results on flights whose prices are between $300 and $600. ```nolang SELECT price, origin, dest FROM FlightsData WHERE price BETWEEN 300 and 600 ORDER BY price ASC ``` | Dest | Origin | Price | | ---- | ------ | ----- | | PHX | LAX | 300 | | LAX | PHX | 400 | | PHX | LAX | 400 | | LAX | PHX | 500 | | LAX | SFO | 550 | | LAX | OAK | 560 | | SFO | LAX | 600 | | OAK | LAX | 600 | | LAX | PHX | 600 | ## Aggregate and Window Functions Example This example checks whether the sum of profits for each account is less than 5% of the total sum of profits for all accounts. It returns the account name, account ID, and `IsLowPercent`, a boolean value that is `true` if the sum of profits is less than 5%. ```nolang SELECT Account_ID, Account_Name, SUM(Profit) BETWEEN 0 AND 5 * SUM(SUM(Profit)) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) / 100 AS IsLowPercent FROM "Opportunity" GROUP BY Account_ID, Account_Name LIMIT 10; ``` | Account ID | Account Name | isLowPercent | | ------------------ | ----------------- | ------------ | | 00137000003dT6qAAE | Alphenymp | true | | 00137000003dT6rAAE | AboveRosa | true | | 00137000003dT6sAAE | Acidyles | true | | 00137000003dT6tAAE | Angelstage | true | | 00137000003dT6uAAE | Animorror | true | | 00137000003dT6vAAE | AnnouncerKing | true | | 00137000003dT6wAAE | ApenguinInca | true | | 00137000003dT6xAAE | AttractivePenguin | true | | 00137000003dT6yAAE | BearDigestAir | true | | 00137000003dT6zAAE | BertramWillow | true | ## Date Example with TIMESTAMP This example returns ten `CloseDate` values that are between two `TIMESTAMP` values, `2014-12-31` and `2015-12-31`. ```nolang SELECT CloseDate FROM "Opportunity" WHERE CloseDate BETWEEN TIMESTAMP '2014-12-31 00:00:00' AND TIMESTAMP '2015-12-31 00:00:00' LIMIT 10; ``` | CloseDate | | ------------------- | | 2014-12-31 16:00:00 | | 2015-01-01 16:00:00 | | 2015-01-30 16:00:00 | | 2015-01-31 16:00:00 | | 2015-02-28 16:00:00 | | 2015-03-30 17:00:00 | | 2015-03-31 17:00:00 | | 2015-04-29 17:00:00 | | 2015-04-30 17:00:00 | | 2015-05-30 17:00:00 | ## Date Example with EXTRACT This example uses SQL for CRM Analytics’s `EXTRACT` function to access the `MONTH` values from the `CloseDate` field and return dates between April (4) and July (7). ```nolang SELECT CloseDate FROM "Opportunity" WHERE EXTRACT(MONTH FROM CloseDate) BETWEEN 4 AND 7 LIMIT 10; ``` | CloseDate | | ------------------- | | 2015-04-29 17:00:00 | | 2015-04-30 17:00:00 | | 2015-05-30 17:00:00 | | 2015-05-31 17:00:00 | | 2015-07-31 17:00:00 | ## Asymmetric and Symmetric Example By default, the `BETWEEN` statement evaluates a value that falls between the lower and upper bounds in order of least to greatest as `true`. If the lower and upper bound values are reversed, `BETWEEN` evaluates the statement as `false`. To specify this behavior, use the `ASYMMETRIC` operator. Let’s go back to the numeric example. Here, the range is specified as `ASYMMETRIC BETWEEN 300 and 600`. The statement evaluates to `true`. ```nolang SELECT price, origin, dest FROM FlightsData WHERE price ASYMMETRIC BETWEEN 300 and 600 ORDER BY price ASC ``` When the range is specified as `ASYMMETRIC BETWEEN 600 and 300`, the statement evaluates to `false`. ```nolang SELECT price, origin, dest FROM FlightsData WHERE price ASYMMETRIC BETWEEN 600 and 300 ORDER BY price ASC ``` By using the `SYMMETRIC` operator, the order of the upper and lower bounds of your `BETWEEN` statement remain true if reversed. The order is irrelevant. ```nolang SELECT price, origin, dest FROM FlightsData WHERE price SYMMETRIC BETWEEN 600 and 300 ORDER BY price ASC ``` By using `SYMMETRIC`, the `BETWEEN` statement evaluates to `true`. Here’s the date example using `EXTRACT` and the `SYMMETRIC` operator. By including `SYMMETRIC`, the query returns the same results, even though the months are filtered `BETWEEN 7 AND 4`. ```nolang SELECT CloseDate FROM "Opportunity" WHERE EXTRACT(MONTH FROM CloseDate) SYMMETRIC BETWEEN 7 AND 4 LIMIT 10; ``` # Bind a Custom Query with Other Queries Instead of getting values from a query, you can create custom queries to specify your own values. For example, you can create a custom query to show “Top 5 Customers” and “Bottom 5 Customers” in a toggle widget. After you create the custom query, to make it interact with the other widgets in the dashboard, manually bind the custom query to the queries of the other widgets. For an example, see [Measure Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-measure.md). # Bind columnMaps in Dashboard Interactions Bind the `columnMap` parameter in a dashboard widget and in the widget section of your queries. Binding is useful when you have multiple measures or groupings and you want to control the order in which they're selected and portrayed in a chart. This example shows how to bind the `columnMap` parameter in a custom (static) query and in an aggregateflex query in a simple dashboard. In the custom query, you can select either Industry or Country. The aggregateflex query shows ‘Sum of Amount’, grouped first by Industry and second by Opportunity Type and ordered by the Sum of Amount. ![Columns on the Dashboard Homepage](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_bindings_columnmap_1.webp) The way the two queries interact is that the user selects a value from the custom query, which sets the first grouping in the aggregateflex query and is used in the X axis. ## Add the interaction to the groups parameter On the right side of the page, click **Advanced Editor**, click the Query tab, and then locate the `groups` parameter in the JSON. ![Advanced Editor Query Tab](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_bindings_advanced_editor_query_tab.png) Replace `Account.Industry` with the interaction. ```json "groups": [ "{{cell(SelectGroup_1.selection, 0, \"Dim\").asObject()}}", "Type" ], ``` ## Add the Interaction to the columnMap Parameter After you add your interaction to the `groups` parameter, locate the `columnMap` parameter in the JSON and add the interaction as the value of the `dimensionAxis` parameter. ```json "columnMap": { "split": [ "Type" ], "trellis": [], "dimensionAxis": [ "{{cell(SelectGroup_1.selection, 0, \"Dim\").asObject()}}" ], "plots": [ "A" ] }, ``` Click the **Widget** tab and then repeat this process. After you add your interactions, save your changes, refresh the page, and then click **Preview** to view your dashboard with the `columnMap` bindings. # Bind Parts of a Query You can dynamically set parts of a query based on the selection or results of another query. For example, you can set the grouping in a query based on the grouping selected in a chart. Before we discuss how to bind the different parts of the query, let’s look at a comprehensive example. This example illustrates the interactions for different parts of a query. The chart is bound based on selections for grouping, measure, filter, order, and limit. When you make a selection in one of the toggle widgets, the chart changes to show the results of the modified query. ![The dashboard shows toggle widgets that dynamically modify the chart's query based on selections of groupings, measures, filters, orders, and limits.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_binding_query_parts_flex.png) Here’s the JSON for the queries that power this dashboard. The `Account_BillingCount_1` query is the underlying query for the chart widget. This query contains multiple interactions based on other queries. ```json "steps": { "Account_BillingCount_1": { "datasets": [ { "id": "0FbB00000000oEkKAI", "label": "Opportunities", "name": "opportunity", "url": "/services/data/v38.0/wave/datasets/0FbB00000000oEkKAI" } ], "isFacet": true, "isGlobal": false, "query": { "measures": "{{column(StaticMeasureNames.selection, [\\"value\\"]).asObject()}}", "limit": "{{column(StaticLimits.selection, [\\"value\\"]).asObject()}}", "groups": "{{column(StaticGroupingNames.selection, [\\"value\\"]).asObject()}}", "filters": "{{column(StaticFilters.selection, [\\"value\\"]).asObject()}}", "order": "{{column(StaticOrdering.selection, [\\"value\\"]).asObject()}}" }, "selectMode": "single", "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "visualizationType": "hbar", "options": {} } }, "StaticGroupingNames": { "datasets": [], "dimensions": [], "isFacet": true, "isGlobal": false, "selectMode": "single", "start": { "display": [ "Country" ] }, "type": "staticflex", "useGlobal": true, "values": [ { "display": "Country", "value": "Account.BillingCountry" }, { "display": "Industry", "value": "Account.Industry" }, { "display": "Product", "value": "Product.Product.Family" }, { "display": "Source", "value": "Account.AccountSource" } ], "visualizationParameters": { "options": {} } }, "StaticFilters": { "datasets": [], "dimensions": [], "isFacet": true, "isGlobal": false, "selectMode": "single", "start": { "display": "Ads Only" }, "type": "staticflex", "useGlobal": true, "values": [ { "display": "Ads Only", "value": [ "LeadSource", [ "Advertisement" ], "in" ] }, { "display": "Partners Only", "value": [ "Account.Type", [ "Partner" ], "in" ] }, { "display": "$1M+ Only", "value": [ "Amount", [ [ 1000000, 11921896 ] ], ">=<=" ] } ], "visualizationParameters": { "options": {} } }, "StaticOrdering": { "datasets": [], "dimensions": [], "isFacet": true, "isGlobal": false, "selectMode": "single", "start": { "display": "Ads Only" }, "type": "staticflex", "useGlobal": true, "values": [ { "display": "Ascending", "value": [ -1, { "ascending": true } ] }, { "display": "Descending", "value": [ -1, { "ascending": false } ] } ], "visualizationParameters": { "options": {} } }, "StaticLimits": { "datasets": [], "dimensions": [], "isFacet": true, "isGlobal": false, "selectMode": "single", "start": { "display": [ "5" ] }, "type": "staticflex", "useGlobal": true, "values": [ { "display": "5", "value": 5 }, { "display": "10", "value": 10 }, { "display": "25", "value": 25 } ], "visualizationParameters": { "options": {} } }, "StaticMeasureNames": { "datasets": [], "dimensions": [], "isFacet": true, "isGlobal": false, "selectMode": "singlerequired", "start": { "display": [ "Total Amount" ] }, "type": "staticflex", "useGlobal": true, "values": [ { "display": "Max Employees", "value": [ "max", "Account.NumberOfEmployees" ] }, { "display": "Total Amount", "value": [ "sum", "Amount" ] }, { "display": "Avg Amount", "value": [ "avg", "Amount" ] } ], "visualizationParameters": { "options": {} } }, "Account_AccountSourc_1": { "datasets": [ { "id": "0FbB00000000oEkKAI", "label": "Opportunities", "name": "opportunity", "url": "/services/data/v38.0/wave/datasets/0FbB00000000oEkKAI" } ], "isFacet": true, "isGlobal": false, "query": { "measures": [ [ "count", "*" ] ], "groups": [ "Account.AccountSource" ], "order": [ [ -1, { "ascending": false } ] ] }, "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "visualizationType": "hbar", "options": {} } } }, "widgetStyle": { "backgroundColor": "#FFFFFF", "borderColor": "#E6ECF2", "borderEdges": [], "borderRadius": 0, "borderWidth": 1 } ``` **note:** If you bind a measure or grouping in a query used for a chart, you must also replace the `columnMap` section in the widget-level chart JSON with an empty `columns` array. For more information, see [Measure Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-measure.md) and [Group Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-group.md). # Bind Queries from Different Datasets You can bind queries from different datasets. For example, this dashboard contains two charts, each based on its own dataset. ![The dashboard shows two charts, each based on a different dataset.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_2_charts_2_datasets.png) When a selection is made in the Opportunities DS chart, that selection also filters the SalesOpp DS chart because of a selection interaction. The `filters` attribute of the `Country_1` query contains a selection interaction based on the `Account_BillingCount_1` query. Here’s the full dashboard JSON for the queries and chart widgets, which contains the `{{column(Account_BillingCount_1.selection, [\\"Account.BillingCountry\\"]).asObject()}}` selection interaction described previously. ```json { "label": "Cross-Dataset Bindings", "state": { "gridLayouts": [...], "layouts": [], "steps": { "Account_BillingCount_1": { "datasets": [ { "id": "0Fbx000000000LzCAI", "label": "Opportunities", "name": "opportunity1", "url": "/services/data/v38.0/wave/datasets/0Fbx000000000LzCAI" } ], "isFacet": true, "isGlobal": false, "query": { "measures": [ [ "count", "*" ] ], "groups": [ "Account.BillingCountry" ] }, "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "visualizationType": "hbar", "options": {} } }, "Country_1": { "datasets": [ { "id": "0Fbx000000000NACAY", "label": "SalesOpps", "name": "SalesOpps", "url": "/services/data/v38.0/wave/datasets/0Fbx000000000NACAY" } ], "isFacet": true, "isGlobal": false, "query": { "measures": [ [ "count", "*" ] ], "groups": [ "Country" ], "filters": [ [ "Country", "{{column(Account_BillingCount_1.selection, [\\"Account.BillingCountry\\"]).asObject()}}" ] ] }, "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "visualizationType": "hbar", "options": {} } } }, "widgetStyle": {...}, "widgets": { "text_1": { "parameters": { "fontSize": 20, "text": "Opportunities DS", "textAlignment": "center", "textColor": "#000000" }, "type": "text" }, "text_2": { "parameters": { "fontSize": 20, "text": "SalesOpp DS", "textAlignment": "center", "textColor": "#000000" }, "type": "text" }, "chart_2": { "parameters": { "legend": { "showHeader": true, "show": true, "position": "right-top", "inside": false }, "showMeasureTitle": true, "showTotal": true, "visualizationType": "pie", "step": "Country_1", "exploreLink": true, "inner": 70, "title": { "label": "", "subtitleLabel": "", "align": "center" }, "theme": "wave", "trellis": { "enable": false, "type": "x", "chartsPerLine": 4 } }, "type": "chart" }, "chart_1": { "parameters": { "legend": { "showHeader": true, "show": true, "position": "right-top", "inside": false }, "showMeasureTitle": true, "showTotal": true, "visualizationType": "pie", "step": "Account_BillingCount_1", "exploreLink": true, "inner": 70, "title": { "label": "", "subtitleLabel": "", "align": "center" }, "theme": "wave", "trellis": { "enable": false, "type": "x", "chartsPerLine": 4 } }, "type": "chart" } } }, "datasets": [ { "id": "0Fbx000000000LzCAI", "label": "Opportunities", "name": "opportunity1", "url": "/services/data/v38.0/wave/datasets/0Fbx000000000LzCAI" }, { "id": "0Fbx000000000NACAY", "label": "SalesOpps", "name": "SalesOpps", "url": "/services/data/v38.0/wave/datasets/0Fbx000000000NACAY" } ] } ``` # Bind the Initial Filter Selection You can use a results interaction to dynamically set the initial selection of a query based on a characteristic of the logged-in user. For example, you can filter a region-based dashboard based on the country of the logged-in user. - **Example** **note:** Only `staticflex`-, `saql`-, or `soql`-type queries can use interactions for initial filter selections. For example, to focus the dashboard on the logged-in user’s country, configure the list widget to select the country when the dashboard first opens. !["USA" is automatically selected as the country when you first open the dashboard.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboards_binding_initial_selection.png) To implement this behavior, define a query that retrieves the logged-in user’s country from the Salesforce User object. To do this, select the list widget, navigate to the Advanced Editor in the Query section, and add the following JSON query in the Query tab. ```json "UserData": { "groups": [], "numbers": [], "query": "SELECT Username, Country, FirstName, LastLoginDate FROM User WHERE Name = '!{user.name}'", "selectMode": "single", "strings": [ "Username", "Country", "FirstName", "LastLoginDate" ], "type": "soql" } ``` Then bind the initial selection in the list widget’s query to the logged-in user’s country. Here the binding is in the `start` attribute. ```json "Billing_Country_2": { "groups": [], "isFacet": true, "label": "Billing Country", "numbers": [], "query": "q = load \"Opp_Icons\"; q = group q by 'Billing_Country'; q = foreach q generate 'Billing_Country' as 'Billing_Country', sum('Amount') as 'sum_Amount'; q = order q by 'sum_Amount' desc;", "selectMode": "multi", "start": "{{ cell(UserData.result, 0, 'Country').asObject() }}", "strings": [], "type": "saql", "useGlobal": true } ``` For more information about results interactions and bindings, visit the [Use Bindings to Compare Data](https://trailhead.salesforce.com/content/learn/projects/advanced-dashboard-techniques/use-bindings) Trailhead module. # Boolean Expressions in SELECT Clause A boolean expression is a logical statement that returns either `true` or `false`. A boolean expression in `SELECT` follows this syntax: `SELECT {boolean_expression} as {alias}`. This example demonstrates a query that satisfies one numerical logical condition. ```nolang SELECT Profit > 0 as Profits FROM "Superstore" LIMIT 5; ``` | Profits | | ------- | | true | | true | | true | | false | | true | This example demonstrates a query that satisfies two numerical logical conditions. ```nolang SELECT Profit > 0 and Profit < 100 as Profits FROM "Superstore" LIMIT 5; ``` | Profits | | ------- | | true | | false | | true | | false | | true | This example demonstrates a text comparison. ```nolang SELECT Customer_Name LIKE 'A%' as "A Names" FROM "Superstore" LIMIT 5; ``` | A Names | | ------- | | false | | false | | false | | false | | true | # Boolean Literals A boolean literal represents true or false (yes or no) in your script. Boolean literals true and false are supported in SAQL. The literal values are case-sensitive. # Browser Requirements for Tableau Next Embedding The Embedded SDK supports these web browsers. - Google Chrome™ (latest stable version) - Mozilla® Firefox® (latest stable version) - Microsoft® Edge (latest stable version) - Apple® Safari® (latest stable version) For embedding to work as expected in these browsers, ensure your browser has the correct settings ## Google Chrome To render embedded Tableau Next components in Chrome browsers successfully, users must enable use of third-party cookies. 1. On your device, launch the Chrome browser. 2. Click the customize menu icon ![Chrome browser menu icon.](https://developer.salesforce.com/docs/media/sdk/chrome_menu_icon.png '{"class": "image-icon-lg"}') in the top-right corner of the browser window. 3. Select **Settings**, then select **Privacy and security** in the left-hand menu. 4. Click **Third-party cookies** and enable **Allow third-party cookies**. ![Google Chrome browser settings to enable third-party cookies.](https://developer.salesforce.com/docs/media/sdk/chrome_settings.png '{"class": "image-lg"}') 5. Changes are saved automatically. ## Mozilla Firefox To render embedded Tableau Next components in Firefox browsers successfully, users must enable use of third-party cookies. 1. On your device, launch the Firefox browser. 2. Click the app menu icon ![Firefox browser app menu icon.](https://developer.salesforce.com/docs/media/sdk/firefox_app_icon.png '{"class": "image-icon-lg"}') in the top-right corner of the browser window. 3. Select **Settings**, then select **Privacy & Security** in the left-hand menu. 4. Under **Enhanced Tracking Protection**, select **Custom**. 5. Disable **Cookies** to allow third-party cookies. ![Mozilla Firefox browser settings to enable third-party cookies.](https://developer.salesforce.com/docs/media/sdk/firefox_settings.png '{"class": "image-lg"}') 6. Changes are saved automatically. ## Microsoft Edge To render embedded Tableau Next components in Edge browsers successfully, users must update the tracking prevention settings. 1. On your device, launch the Edge browser. 2. Click the menu icon ![Chrome browser menu icon.](https://developer.salesforce.com/docs/media/sdk/chrome_menu_icon.png '{"class": "image-icon-lg"}') in the top-right corner of the browser window. 3. Select **Settings**, then select **Private, Search, and Services** in the left-hand menu. 4. In the Tracking prevention section, select the **Basic** option. ![Microsoft Edge browser settings for basic tracking prevention.](https://developer.salesforce.com/docs/media/sdk/ms_edge_settings.png '{"class": "image-lg"}') 5. Restart the browser to ensure the updated settings are applied properly. ## Apple Safari To render embedded Tableau Next components in Safari browsers successfully, users must update the cross-site tracking setting. 1. On your device, launch the Safari browser. 2. From the Safari menu, select **Settings**. 3. Select **Privacy**. 4. Disable **Prevent cross-site tracking**. ![Apple Safari browser privacy settings for cross-site tracking.](https://developer.salesforce.com/docs/media/sdk/safari_settings.png '{"class": "image-lg"}') 5. Changes are saved automatically. # Build Data Serialization Interactions The most common SAQL interactions are data serializations. You can build filter, grouping, and projection interactions. These examples show queries that start with `q = filter q by` or `q = group q by` followed by the filter or grouping logic. To make the query dynamic, you replace this static logic with an interaction. You can execute this full sample SAQL query and these interaction examples in a Trailhead Analytics developer org by using the DTC Opportunity data. ```sql q = load "DTC_Opportunity_SAMPLE"; q = filter q by date('Close_Date_Year', 'Close_Date_Month', 'Close_Date_Day') in ["1 year ago".."1 year ago"]; q = filter q by 'Account_Type' == "Customer"; q = filter q by 'Amount' >= 2910928 && 'Amount' <= 8577295; q = group q by 'Industry'; q = foreach q generate 'Industry' as 'Industry', sum('Amount') as 'sum_Amount'; q = order q by 'Industry' asc; q = limit q 2000; ``` These examples use a static step as the query source for simplicity. Each example illustrates the SAQL without and then with an interaction. ## Date Range Filter Interaction The static step to filter is: ```json "values": [ { "display": "CY", "value": ["current year", "current year"] }, { "display": "LY", "value": ["1 year ago", "1 year ago"] } ] ``` A date range filter in SAQL is: ```sql q = filter q by date('Close_Date_Year', 'Close_Date_Month', 'Close_Date_Year') in ["1 year ago".."1 year ago"]; ``` To get that specific format, use the `asDateRange()` interaction with the `date` function and parameters. ```sql q = filter q by {{cell(StaticFilterDate_1.selection, 0, "value").asDateRange("date('Close_Date_Year', 'Close_Date_Month', 'Close_Date_Day')")}}; ``` ## Range Filter Interaction The static step to filter is: ```json "values": [ { "display": "Low", "value": [0, 5000000] }, { "display": "High", "value": [5000000, 10000000] } ] ``` The SAQL filter for a measure uses the between option `&&`: ```sql q = filter q by 'Amount' >= 2910928 && 'Amount' <= 8577295; ``` This type of filter has a minimum and maximum value like the `asDateRange()` function. The interaction looks like: ```sql q = filter q by {{cell(StaticFilterRange_1.selection, 0, "value").asRange("Amount")}}; ``` ## Equality Filter Interaction The most commonly used filter is the equality filter where one field or column is equal to a specific value. The static step to filter is: ```json "values": [ { "display": "Account Type: Partner", "value": "Partner" }, { "display": "Account Type: Customer", "value": "Customer" } ] ``` Here's a SAQL example: ```sql q = filter q by 'Account_Type' == "Customer"; ``` The interaction is: ```sql q = filter q by {{cell(StaticFilterDim_1.selection, 0, "value").asEquality("Account_Type")}}; ``` ## Range Interactions Without a Static Step For nonstatic steps, use binding ranges with minimum and maximum values. To bind multiple cell values, use the `row` data selection function. Define one or more rows that you want to take data from directly after the binding function. In these examples, the value is `[0]`, which indicates only data from the first row of the query results. To define multiple rows, use a comma-separated list, `[0,1,2,3]`. To include all the rows of the results, use an empty array, `[]`. Here's a SAQL example for a date range: ```sql q = filter q by {{row(Close_Date_1.selection, [0], ["min", "max"]).asDateRange("date('Close_Date_Year', 'Close_Date_Month', 'Close_Date_Day')")}}; ``` Here's a SAQL example for a numeric range: ```sql q = filter q by {{row(Amount_1.selection, [0], ["min", "max"]).asRange("Amount")}}; ``` ## Group and Projection Interaction To create a group interaction, define the grouping and then project it. The static step for this example is: ```json "values" : [ { "display": "Industry", "value": "AccountId.Industry", "expression": "'AccountId.Industry'", "alias": "Industry" }, { "display": "Stage", "value": "StageName", "expression": "'StageName'", "alias": "Stage" } ] ``` Here’s a SAQL example for a grouping: ```sql q = group q by 'Industry'; q = foreach q generate 'Industry' as 'Industry', ...; ``` To create the grouping interaction, use this statement: ```sql q = group q by {{cell(StaticGroup_1.selection, 0, "value").asGrouping()}}; ``` The data selection function is `cell` and it references the `value` field from the static step. The second part of the interaction, the projection, is a little more complex. The projection takes a field from the dataset, in this example it's the grouping, and defines how it’s displayed. This interaction uses the `expression` and `alias` values. With two or more values, you must use the `row` selection function. ```sql q = foreach q generate {{row(StaticGroup_1.selection, [0], ["expression", "alias"]).asProjection()}}, ...; ``` # Build the Resource URL Access all Reports and Dashboards REST API resources by using the URI for your Salesforce org, combined with version and Experience Cloud site information, and the URI for the resource. When building a URL, start with your My Domain login URL. To get your My Domain name, use the getMyDomainName() Apex method. You can also find your full My Domain login URL on the My Domain page in Setup. ```nolang https://MyDomainName.my.salesforce.com ``` Then add the version information: ```nolang /services/data/v ``` Then add the resource: ```nolang /analytics/reports ``` Put together, the full URL is: ```nolang https://MyDomainName.my.salesforce.com/services/data/v66.0/analytics/reports ``` Some resources, such as `notifications`, often require one or more URL parameters without which API requests return an error: ```nolang https://MyDomainName.my.salesforce.com/services/data/v66.0/analytics/notifications?source=lightningReportSubscribe ``` # Calculate Grand Totals and Subtotals with the rollup Modifier and grouping() Function Calculate subtotals of grouped data in your SAQL query using the `rollup` modifier on the `group by` statement, then work with subtotaled data using `grouping()`. For example, to see the subtotaled value of opportunities by type and lead source, roll up the type and lead source groups. Then, label the subtotals with the grouping function. Invoking `rollup` adds rows to your query results with null values for dimensions and subtotaled results for measures. Invoking `grouping()` returns 1 if null dimension values are due to higher-level aggregates (which usually means the row is a subtotal), otherwise it returns 0. Using `grouping()` alongside `rollup` lets you work with subtotaled data. After subtotaling data, common next steps include logically evaluating subtotaled data with a case statement. Or filtering on subtotaled data with a filter statement. Suppose that you have an opportunity dataset, and want to see the value of deals by lead source and type. Plus, you want to see the total value of all lead sources and all types. Write a query that returns the sum of opportunity amount grouped by type and lead source. To see the value of all lead sources and all types, use `rollup` to subtotal opportunities, then use `grouping()` to label the subtotaled rows. **note:** All query results for `rollup` and `grouping()` display only in the format as shown in the examples below. ## Example: rollup Open the SAQL editor in the dashboard. Instead of grouping data by a field, specify the `rollup` modifier as the group and pass the fields you want subtotaled - Type and Lead Source - as parameters. Set `q = group q by rollup('Type', 'LeadSource');`. Here's the full query. ```nolang q = load "opportunityData"; q = group q by rollup('Type', 'LeadSource'); q = order q by ('Type', 'LeadSource'); q = foreach q generate 'Type' as 'Type', 'LeadSource' as 'LeadSource', sum('Amount') as 'sum_Amount'; ``` The query results show sum of amount by opportunity type and then by lead source. Subtotaled and grand totaled rows have null values for dimensions. ![Subtotals and grand totals calculated with the rollup statement](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_rollup_example.png) ## Example: grouping() Null values in place of labeled totals can confuse query results. Avoid this confusion by labeling totals as `All Types` or `All Lead Sources` using case statements with `grouping()` functions. ```nolang q = load "opportunityData"; q = group q by rollup('Type', 'LeadSource'); q = order q by ('Type', 'LeadSource'); q = foreach q generate (case when grouping('Type') == 1 then "All Types" else 'Type' end) as 'Type', (case when grouping('LeadSource') == 1 then "All Lead Sources" else 'LeadSource' end) as 'LeadSource', sum('Amount') as 'sum_Amount'; ``` Now the query results include labeled totals. ![Subtotals and grand totals calculated with the rollup statement and labeled with the grouping statement](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_rollup_grouping_example.png) To have multiple grouping levels but only display subtotals for one group, add a filter to the end of your query that resembles the following example: `q = filter q by 'LeadSource' != "All Lead Sources" || 'Type' == "Existing Business"` # Calculate How Long Activities Take Use `daysBetween()` and `date_diff()` to calculate the difference between two dates or times. ## Example: Display the Number of Days Since an Opportunity Opened Suppose that you have an opportunity dataset with the account name and the epoch seconds fields: ![Diagram showing the opportunity dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_opp_dataset.png) You want to see how many days ago an opportunity was opened. Use `daysBetween()` and `now()`. Use `toDate()` to convert the order date epoch seconds to a date format that can be passed to `daysBetween()`. ```nolang q = load "OpsDates1"; q = foreach q generate Account, daysBetween(toDate(OrderDate_sec_epoch), now()) as 'daysOpened'; ``` The resulting data stream displays the number of days since the opportunity was opened. ![Diagram showing the number of days each account has been opened for.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_daysopened.png) ## Example - How Many Weeks Did Each Opportunity Take to Close? Use `date_diff()` with _datepart_ = `week` to calculate how long, in weeks, it took to close each opportunity. ```nolang q = load "DTC_Opportunity"; q = foreach q generate date_diff("week", toDate(CreatedDate_sec_epoch), toDate(CloseDate_sec_epoch) ) as 'Weeks to Close'; q = order q by 'Weeks to Close'; ``` **See Also** - [daysBetween()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-date-between.md) - [date_diff()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-date-diff.md) # Calculate the Slope of the Regression Line Use SAQL to perform linear analysis on your data to find the line that best fits the data. Then use .`regr_slope` to return the slope of this line. ## Example - Calculate the Relationship Between Number of Activities and Deal Amount Suppose that you have a dataset that includes the number of activities (such as meetings) and the won opportunity amount. ![Sample scatter plot.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_regint.png) How much bigger will the deal size be for each extra activity? `regr_slope` performs a linear analysis on your data then calculates the slope (that is, the increased amount you win for each extra activity). ```nolang q = load "data/sales"; q = group q by all; --trunc() truncates the result to two decimal places q = foreach q generate trunc(regr_slope('Amount', 'NumActivities'),2) as 'Gain per Activity'; ``` Based on your existing data, every extra activity that you have tends to increase the deal size by \$1.45 million, on average. ![Diagram showing slope of a regression line.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_slope.png) **See Also** - [regr_slope()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-rs.md) # Calculate the Time Between Two Dates Use `date_diff()` and `daysBetween()` to calculate the time between two dates. Use `now()` to get the current time. You can use these functions with `DateTime`, `DateOnly`, or `Date` types. - **[date_diff(datepart, startdate, enddate)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-date-diff.md)** Returns an integer representing the interval that has elapsed between two dates. - **[daysBetween(date1, date2)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-days-between.md)** Returns the number of days between two dates as an integer. - **[now()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-now.md)** Returns current datetime in the specified time zone. This function is valid only in a `foreach` statement. # CASE Statements Use case statements to express if/then logic. A case statement always has a pair of `WHERE` and `THEN` statements. CRM Analytics supports the simple and searched forms of case expressions in a `SELECT` statement. Case statements have two formats: simple and searched. ## Simple Form A simple statement compares a case expression against a set of expressions. The result is the matched expression. ```nolang SELECT Category, CASE Category WHEN 'Furniture' THEN 'Available' WHEN 'Office Supplies' THEN 'Unavailable' ELSE 'Unknown' END AS Availability FROM "Superstore" GROUP BY Category; ``` Here are the results. | Category | Availability | | --------------- | ------------ | | Furniture | Available | | Office Supplies | Unavailable | | Technology | Unknown | ## Searched Form The searched form evaluates to a result. A searched statement compares an expression against a series of boolean expressions. If it matches a boolean expression, the result is the corresponding THEN clause. If the expression does not return true for any of the boolean expressions, then the result is the corresponding `ELSE` clause. ```nolang SELECT Region, CASE WHEN sum(Profit) <= -500000 THEN 'Huge Loss' WHEN sum(Profit) <= 0 THEN 'Loss' WHEN sum(Profit) > 500000 THEN 'Huge Profit' ELSE 'Profit' END AS ProfitLoss FROM "Superstore" GROUP BY Region; ``` | Region | ProfitLoss | | ------- | ---------- | | Central | Profit | | East | Profit | | South | Profit | | West | Profit | # ceil({n}), ceiling({n}) Returns the nearest integer of equal or greater value to _n_. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. `ceil({n})` takes the following syntax. ```nolang SELECT ceil(COLUMN_NAME) as ALIASNAME FROM DATASET; ``` ## Example This example takes the ceiling of the Profit field. ```nolang SELECT ceil(Profit) as ceilProfit FROM Superstore LIMIT 1; ``` | ceilProfit | | ---------- | | 42 | # ceil(n) Returns the nearest integer of equal or greater value to _n_. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate ceil(miles) as distance; ``` # Change Chart Colors for Dimension Values You can customize the colors of dimension values in a stacked bar, stacked column, or stacked waterfall chart. If you specify one measure and two groups, you can also customize the color for donut, funnel, treemap, stacked pyramid, line, and timeline charts. **note:** The customizations described in this topic can now be configured using the CRM Analytics UI. It is no longer necessary to edit by modifying the XMD file. For the UI instructions, see [Change the Labels and Colors of Dataset Dimension Values](https://help.salesforce.com/articleView?id=bi_datasets_dimension_value_labels_colors_change.htm) and [View and Configure Dataset Columns](https://help.salesforce.com/articleView?id=bi_explorer_dataset_fields.htm) This example shows a bar chart with default colors. ![Default colors](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi-xmdnocustomcolors.png) Custom colors are specified in the `chartColor` section of the XMD file. If you have a large XMD file, you can do a text search to find the appropriate `chartColor` section. For example, the bold text in this XMD snippet shows how to change the colors for the true and false values of the `Stage_IsAdvanced` dimension. The XMD snippet is located in the dimension section of the XMD file. ```nolang "conditionalFormatting":{ "chartColor":{ "parameters":{ "values":[ { "formatValue":"#E8963B", "value":"false" }, { "formatValue":"#3AE867", "value":"true" } ] }, "referenceField":"Stage_IsAdvanced", "type":"categories" } ``` Here’s how the color customization appears in the chart. ![Default colors](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi-xmdwithcustomcolors.png) **See Also** - [Dimensions and Derived Dimensions in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-dimensions.md) # Change Display Labels for Dataset Fields and Values When you change display labels for fields and values, the changes affect only the appearance in the UI. The changes don’t alter the underlying data stored in the dataset or the API names of the fields. **note:** The customizations described in this topic can now be configured using the CRM Analytics UI. It’s no longer necessary to change the XMD file. For the UI instructions, see [Change the Labels and Colors of Dataset Dimension Values](https://help.salesforce.com/s/articleView?id=bi_datasets_dimension_value_labels_colors_change.htm) and [View and Configure Dataset Columns](https://help.salesforce.com/s/articleView?id=bi_explorer_dataset_fields.htm). You can customize display labels for: - Dimensions, derived dimensions, measures, and derived measures. - Values in dimensions and derived dimensions. Consider these limitations: - You can’t customize date labels. - XMD doesn't update formatting for fields that are controlled by user input or context. Formatting can only be applied to a static or preset value. The following sample chart shows field names and values as they’re stored in the dataset. ![Default colors](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi-xmdnocustomlabels.png) Custom display labels for dimension field values are specified in the `members` section of the XMD file within the section you’re modifying (such as `dimensions`). If you have a large XMD file, you can do a text search to find the appropriate `members` section. For example, the bold text in this XMD snippet shows how to change the labels for two values of the `StageName` field. ```nolang "field":"StageName", "members":[ { "label":"Closed (Lost)", "member":"Closed Lost" }, { "label":"Closed (Won)", "member":"Closed Won" } ], ``` Here’s how the label customizations appear in the chart. ![Default colors](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi-xmdcustomlabels.png) **See Also** - [Dimensions and Derived Dimensions in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-dimensions.md) - [Measures and Derived Measures in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-measures.md) # Change the Default Fields for a Values Table When you create a values table, particular dataset fields are shown by default. When the fields are sorted in alphabetical order, which includes dates, the table shows the first five measures and first five dimensions. You can change the default fields by editing the XMD. For example, the explorer shows the following default fields. ![The values table shows the first 5 measures and first 5 dimensions, when they are sorted alphabetically.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_values_table_default_fields.png) To change the default fields, specify the field names, not the labels, in the XMD. ```nolang "showDetailsDefaultFields":[ "CreatedDate_day_epoch", "Id", "Type", "Name", "Owner.Name", "Account.Name", "Amount" ] ``` After applying the XMD to the dataset, here’s the values table with the default fields. ![The values table shows the new, default fields.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_values_table_custom_fields.png) **See Also** - [ShowDetailsDefaultFields in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-showdetailsdefaultfields.md) # Change the Label for the Row Count Measure When you add a row count measure, it appears as “Count of Rows” by default. You can change this label to whatever you want. Here’s the default label. ![The default label for a count measure is "Count of Rows."](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_count_rows_default_label.png) You can specify a new label in the `derivedMeasures` section of the XMD. Because you’re counting rows and not a particular field, use `*` as the field name. ```nolang "derivedMeasures": [{ "field": "*", "label": "Data Points" }], ``` This change yields the following results. ![The new label for a count measure is Count of Data Points.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_count_rows_custom_label.png) **See Also** - [Measures and Derived Measures in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-measures.md) # Change the Map Type Based on a Toggle Widget You can dynamically change the map type based on selections in a toggle widget. For example, you can create a toggle that switches between two different types of maps. Let’s say you want to analyze your company's performance globally and in the United States. You add a toggle that switches from a world map by country to a country map by state. And you show the world map by default if no selection is made. ![The Country and State toggle options allow you to change the map.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_choropleth_map_countries_flex.png) When you click State, the dashboard shows your results for each state. ![The map of the United States shows because the State toggle option is selected.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_choropleth_map_USstates_flex.png) The custom query (`static_1`) provides the "Country" and "State" values that appear in the toggle widget. The chart widget has a Map Type property so you can select the type of map to display. To dynamically set the map type based on a selection in the custom query (`static_1`), bind the Map Type property in the query (`State__c_1`) of the chart widget to the custom query (`static_1`). For more information about maps, see [Map Charts](https://help.salesforce.com/apex/HTViewHelpDoc?id=bi_chart_intro_map.htm). Here’s the dashboard JSON. Focus on the `values` attribute of `static_1`, the `groups` attribute of the `State__c_1` query, and the `maps` parameter of the `chart_1` widget. ```json { "label": "Choropleth Binding", "state": { "gridLayouts": [...], "layouts": [], "steps": { "static_1": { "datasets": [], "dimensions": [], "isFacet": false, "isGlobal": false, "selectMode": "single", "type": "staticflex", "useGlobal": false, "values": [ { "display": "Country", "grouping": "Country__c", "mapType": "World Countries" }, { "display": "State", "grouping": "State__c", "mapType": "US States" } ], "visualizationParameters": { "options": {} } }, "State__c_1": { "datasets": [ { "id": "0FbB000000001uGKAQ", "label": "GUS Roster", "name": "Roster", "url": "/services/data/v38.0/wave/datasets/0FbB000000001uGKAQ" } ], "isFacet": true, "isGlobal": false, "query": { "measures": [ [ "count", "*" ] ], "groups": [ "{{coalesce(cell(static_1.selection, 0, \\"grouping\\"), cell(static_1.result, 0, \\"grouping\\")).asString()}}" ] }, "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "visualizationType": "hbar", "options": {} } } }, "widgetStyle": {...}, "widgets": { "pillbox_1": { "parameters": { "compact": false, "exploreLink": false, "step": "static_1" }, "type": "pillbox" }, "chart_1": { "parameters": { "legend": { "showHeader": true, "show": true, "position": "right-top", "inside": false }, "highColor": "#1674D9", "lowColor": "#C5DBF7", "visualizationType": "choropleth", "step": "State__c_1", "theme": "wave", "exploreLink": true, "title": { "label": "", "align": "center", "subtitleLabel": "" }, "trellis": { "enable": false, "type": "x", "chartsPerLine": 4 }, "map": "{{coalesce(cell(static_1.selection, 0, \\"mapType\\"), cell(static_1.result, 0, \\"mapType\\")).asString()}}" }, "type": "chart" } } }, "datasets": [...] } ``` # Changes to Resource Property Names **important:** Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations. |Resource|Property in version 27.0 was called|Same property in version 28.0 is called| |--------|-----------------------------------|---------------------------------------| |Report Describe|`reportAggregateColumnInfo`|`aggregateColumnInfo`| |Report Describe|`reportDimensionColumnInfo`|`groupingColumnInfo`| |Report Describe|`displayName`|`masterLabel`| |Report Describe|`columnSummaryLevel`|`acrossGroupingContext`| |Report Describe|`rowSummaryLevel`|`downGroupingContext`| |Report Describe|`devname`|`developerName`| |Report Describe|`acrossDimensions`|`groupingsAcross`| |Report Describe|`downDimensions`|`groupingsDown`| |Report Execute|`aggs`|`aggregates`| # char_length({str}) Returns the number of characters in a given string. ## Example This example returns the number of characters in the first five entries in the City column. ```nolang SELECT City, CHAR_LENGTH(City) as "CityLen" FROM "Superstore" GROUP BY City LIMIT 5; ``` | City | CityLen | | ----------- | ------- | | Aberdeen | 8 | | Abilene | 7 | | Akron | 5 | | Albuquerque | 11 | | Alexandria | 10 | # Check for Redundant Filters Binding and faceting in your dashboard design can generate redundant filters. Check the SAQL queries that your dashboard produces to remove unnecessary filters. Consider how a filter in your dashboard UI interacts with one in your query and vice versa. # Check Limits for Analytics Notifications Check analytics notification limits using a GET request. Use a GET request on the [Analytics Notification Limits](https://developer.salesforce.com/docs/analytics/reference/notifications/analytics-api-notifications-reference-notification-limits.md) resource to check limits for analytics notifications. ## Example Usage `/services/data/v38.0/analytics/notifications/limits?source=waveNotification` |Method|Description| |------|-----------| |`GET`|Check how many analytic notifications you have, and the maximum number you can have.| ## Example Response Body ```nolang { "userLimit" : { "max" : 5, "remaining" : 2 } } ``` # Choose Your Tool Microsoft Visual Studio (VS) Code together with Analytics plugin for Salesforce command-line interface (CLI) commands is the recommended way to develop CRM Analytics templates. Or, to create and manage CRM Analytics templates, you can use CRM Analytics Studio, the Salesforce Analytics CLI by itself, or VS Code. **See Also** - [Analytics Development Tools](https://help.salesforce.com/s/articleView?id=analytics.bi_dev_tools.htm&type=5) # chr() Returns the UTF-8 character of integer _n_. ## Syntax `chr`(_n_) ## Usage Returns `null` if _n_ is `null`. ## Example ```nolang q = foreach q generate chr(97) as char_value; - -char_value == a ``` # chr({int}) Returns the UTF-8 character for integer `n`. Returns `null` if `{n}` is `null`. ## Example This example returns the character value of 67. ```nolang SELECT CHR(67) as "charValue" FROM "Superstore" LIMIT 1; ``` | charValue | | --------- | | C | # CLI Deprecation Policy Salesforce deprecates CLI commands and flags when, for example, the underlying API changes. The Salesforce CLI deprecation policy is: - Salesforce announces new and upcoming deprecations of commands and flags in the weekly Salesforce CLI release notes. - Salesforce can deprecate a command or flag at any time. - When you run the deprecated command, Salesforce provides a deprecation warning for a minimum of 4 months. - Salesforce removes the deprecated command or flag 4 months, or more, after the deprecation warning first appears. - If you use a command or flag that’s been deprecated but not yet removed, you get a warning message in `stderr` in the human-readable output. If you specify JSON output, the warning is presented as a property. The message includes the plugin version in which we plan to remove the command or flag. The command help also includes deprecation information when appropriate. - When possible, Salesforce provides a functional alternative to the deprecated command or flag. - For our policy on changes to a Salesforce CLI command’s JSON response, see [Support for JSON Responses](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_json_support.htm). # Clone a Dashboard Creates a copy of a dashboard by sending a POST request to the Dashboard List resource. ## Example You want to clone dashboard 01ZR00000008gkvMAA and save it in a new folder with ID 00lR0000000DnRZIA0. This POST request `/services/data/v35.0/analytics/dashboards/?cloneId=01ZR00000008gkvMAA` to the Dashboard List resource clones the dashboard. ```nolang {"folderId":"00lR0000000DnRZIA0"} ``` The response to the POST request returns the following details about the cloned dashboard. ```nolang { "attributes" : { "dashboardId" : "01ZR00000004SZZMA2", "dashboardName" : "Sales Manager Dashboard", "statusUrl" : "/services/data/v35.0/analytics/dashboards/01ZR00000004SZZMA2/status", "type" : "Dashboard" }, ... "folderId" : "00lR0000000DnRZIA0", "id" : "01ZR00000004SZZMA2", "layout" : { "columns" : [ { "components" : [ 0, 1, 2, 3 ] }, { "components" : [ 4, 5, 6 ] }, { "components" : [ 7 ] } ], "gridLayout" : false }, "name" : "Sales Manager Dashboard", "runningUser" : { "displayName" : "Fred Wiliamson", "id" : "005R0000000Hv5rIAC" } } ``` # Clone Reports Creates a copy of a custom, standard, or public report by sending a POST request to the Report List resource. ## Example You want to clone report 00OD0000001cxIE and name the cloned report as "myNewReport." This POST request `/services/data/v34.0/analytics/reports?cloneId=00OD0000001cxIE` to the Report List resource clones the report. ```nolang { "reportMetadata" : {"name":"myNewReport"} } ``` The response to the POST request returns the following details about the cloned report. ```nolang { "reportExtendedMetadata" : { ... }, "reportMetadata" : { "aggregates" : [ "RowCount" ], "chart" : null, "currency" : null, "description" : null, "detailColumns" : [ "USERS.NAME", "ACCOUNT.NAME", "TYPE", "DUE_DATE", "LAST_UPDATE", "ADDRESS1_STATE" ], "developerName" : "myreport2", "division" : null, "folderId" : "005D0000001UlszIAC", "groupingsAcross" : [ ], "groupingsDown" : [ ], "hasDetailRows" : true, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OD0000001jabSMAQ", "name" : "myNewReport", "reportBooleanFilter" : null, "reportFilters" : [ ], "reportFormat" : "TABULAR", "reportType" : { "label" : "Accounts", "type" : "AccountList" }, "scope" : "user", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CREATED_DATE", "durationValue" : "CUSTOM", "endDate" : null, "startDate" : null }, "standardFilters" : null }, "reportTypeMetadata" : { ... } } ``` # coalesce Use `coalesce()` to get the first non-null value from a list of parameters, or to replace nulls with a different value. ```nolang coalesce(value1 , value2 , value3 , ... ) ``` The arguments must all be convertible to a common data type, which will be the type of the result. This function is often used to substitute a default value for null values when data is retrieved for display. For example: `SELECT COALESCE(description, short_description, '(none)') ...` The above example  returns `description` if it is not null, otherwise `short_description` if it is not null, otherwise `(none)`. ## Example: Left Outer Cogroup with coalesce() A left outer cogroup combines the right data stream with the left data stream. If a record on the left stream does not have a match on the right stream, the missing right value comes through as null. To replace null values with a different value, use `coalesce()`. For example, suppose that you have a dataset of meeting information from the Salesforce Event object, and you join it with data from the Salesforce Opportunity object. This shows amount won with the total time spent in meetings. ```nolang ops = load "Ops"; meetings = load "Meetings"; q = cogroup ops by 'Account' left, meetings by 'Company' ; q = foreach q generate ops.'Account' as 'Account', sum(ops.'Amount') as 'sum_Amount', sum(meetings.'MeetingDuration') as 'TimeSpent'; ``` It looks like we had no meetings with Zen Retreats. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_coalesce_1.png) Let’s use `coalesce()` to change that null value to a zero. ```nolang ops = load "Ops"; meetings = load "Meetings"; q = cogroup ops by 'Account' left, meetings by 'Company' ; –-use coalesce() to replace null values with zero q = foreach q generate ops.'Account' as 'Account', sum(ops.'Amount') as 'sum_Amount', coalesce(sum(meetings.'MeetingDuration'), 0) as 'TimeSpent'; ``` ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_coalesce_2.png) # COALESCE() You can use the `coalesce()`function as shorthand for case statements. The `coalesce()` function replaces null values in your dataset with another value. The function takes a series of arguments and returns the first value that is not null. In this query, the first case statement says that if the City value is not null, return the City value. Otherwise, return `NULL`. For the second case, it says if a Country value is not null, return the Country. If it is null, return the string "Unknown." ```nolang SELECT CASE WHEN City IS NOT NULL THEN City ELSE NULL END AS City, CASE WHEN Country IS NOT NULL ELSE 'Unknown' END As Country FROM "Superstore" Group by City, Country; ``` Here's the same query rewritten with `coalesce().` ```nolang SELECT COALESCE(City, NULL) as City, COALESCE(Country, 'Unknown') as Country FROM "Superstore" GROUP BY City, Country; ``` There are no null City or Country values in the first five results returned from the query. | City | Country | | ----------- | ------------- | | Aberdeen | United States | | Abilene | United States | | Akron | United States | | Albuquerque | United States | | Alexandria | United States | # cogroup Use `cogroup` to blend data from two or more data streams into a single data stream. The data streams must have at least one common field. `cogroup` is similar to relational database joins, but with some important differences. Unlike a relational database join, in a cogroup the datasets are grouped first, and then the groups are joined. You can use `cogroup` in these ways: - inner `cogroup` - left outer `cogroup` - right outer `cogroup` - full outer `cogroup` **note:** The statements `cogroup` and `group` are interchangeable. For clarity, we use `group` for statements involving one data stream and `cogroup` for statements involving two or more data streams. ## Inner cogroup Inner `cogroup` blends data from two or more data streams into a resulting data stream. The resulting data stream only contains values that exist in both data streams. That is, unmatched records are dropped. **Syntax** ```nolang result = cogroup data_stream_1 by field1, data_stream_2 by field2; ``` _field1_ and _field2_ must be the same type, but can have different names. For example, `q=group ops by 'Owner', quota by 'Name';` ## Example - Inner cogroup Suppose that you want to understand how much time your reps spend meeting with each account. Is there a relationship between spending more time and winning an account? Are some reps spending much more or much less time than average? To answer these questions, first blend meeting data with account data using `cogroup`. Suppose that you have a dataset of meeting information from the Salesforce Event object. In this example, your reps have had six meetings with four different companies. The Meetings dataset has a MeetingDuration column, which contains the meeting duration in hours. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_meeting.png) The account data exists in the Salesforce Opportunity object. The Ops dataset has an Account, Won, and Amount column. The Amount column contains the dollar value of the opportunity, in millions. ![Diagram showing the Ops datasets.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_account.png) To see the effect of meeting duration on opportunities, you start by blending these two datasets into a single data stream using `cogroup`. ```nolang q = cogroup ops by 'Account', meetings by 'Company'; ``` Internally (you cannot see these results yet), the resulting cogrouped data stream contains the following data. Note how the data streams are rolled up on one or more dimensions. ```nolang (1,{(Shoes2Go,2),(Shoes2Go,5)},{(Shoes2Go,1,1.5),(Shoes2Go,0,3}) (2,{(FreshMeals,3),(FreshMeals, 1)},{(FreshMeals,1,2) (FreshMeals,1,1.4)}) (3,{(ZipBikeShare,4)},{(ZipBikeShare,1,1.1)}) (4,{(ZenRetreats,6)},{(ZenRetreats,0,2)}) ``` Now the datasets are blended. To see the data, you create a projection using `foreach`: ```nolang ops = load "Ops"; meetings = load "Meetings"; q = cogroup ops by 'Account', meetings by 'Company'; q = foreach q generate ops.'Account' as 'Account', sum(ops.'Amount') as 'Sum of Amount', sum(meetings.'MeetingDuration') as 'TimeSpent'; ``` The resulting data stream contains the sum of amount and total meeting time for each company. The sum of amount is the sum of the dollar value for every opportunity for the company. ![Diagram showing the blended dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_result.png) Now that you have blended the data into a single data stream, you can analyze the effects that total meeting time has on your opportunities. ## Left Outer cogroup Left outer `cogroup` blends data from the right data stream with the left data stream. The resulting data stream only contains values that exist in the left data stream. If the left data stream has a value that the right data stream does not, the missing value is null in the resulting data stream. **tip:** Use `coalesce` to replace a null value with the value of your choice. See [Example: Left Outer Cogroup with `coalesce()`](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-coalesce.md). **Syntax** ```nolang result = cogroup data_stream_1 by field1 left, data_stream_2 by field2; ``` _field1_ and _field2_ must be the same type, but can have different names. For example, `q=group ops by 'Owner' left, quota by 'Name';` ## Example - Left Outer cogroup With coalesce Suppose that you want to see what percentage of quota that your reps have obtained. Your quota dataset shows each employee's quota (notice that Farah does not have a quota): ![Quota dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_quota.png) Your opportunities data shows the opportunity amount that each employee has won (notice that Jonathan does not have a won opportunity). ![Opportunities dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_ops.png) Use a left outer `cogroup` to show only employees that have quotas. Also show the percentage of quota attained. ```nolang quota = load "Quota"; opp = load "Opportunity"; q = group quota by 'Employee' left, opp by 'Employee'; q = foreach q generate quota.'Employee' as 'Employee', trunc(sum(opp.'Amount')/sum(quota.'Quota')*100, 2) as 'Percent Attained'; ``` Jonathan has not won any opportunities yet, so his percent attained is null. ![Opportunities dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_jonNull.png) Use `coalesce` to replace the null opportunities with a zero. ```nolang quota = load "Quota"; opp = load "Opportunity"; q = group quota by 'Employee' left, opp by 'Employee'; q = foreach q generate quota.'Employee' as 'Employee', trunc(coalesce(sum(opp.'Amount'),0)/sum(quota.'Quota')*100, 2) as 'Percent Attained'; ``` Now Jonathan's percent attained is displayed as zero. ![Opportunities dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_jonzero.png) ## Right Outer cogroup Right outer `cogroup` blends data from the left data stream with the right data stream. The resulting data stream only contains values that exist in the right data stream. If the right data stream has a value that the left data stream does not, the missing value is null in the resulting data stream. **tip:** Use `coalesce` to replace a null value with the value of your choice. See [Example: Right Outer Cogroup with `coalesce()`](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-coalesce.md). **Syntax** ```nolang result = cogroup data_stream_1 by field1 right, data_stream_2 by field2; ``` _field1_ and _field2_ must be the same type, but can have different names. For example, `q=group ops by 'Owner' right, quota by 'Name';` ## Full Outer cogroup Full outer `cogroup` blends data from the left and right data streams. The resulting data stream contains all values. If one data stream has a value that the other data stream does not, the missing value is null in the resulting data stream. **tip:** Use `coalesce` to replace a null value with the value of your choice. **Syntax** ```nolang result = cogroup data_stream_1 by field1 full, data_stream_2 by field2; ``` _field1_ and _field2_ must be the same type, but can have different names. For example, `q=group ops by 'Owner' full, quota by 'Name';` **See Also** - [union](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-union.md) - [join semi and anti](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-join-semi-anti.md) - [Combine Data from Multiple Data Streams with cogroup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-cogroup.md) - [Replace Null Values with coalesce()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-coalesce.md) - [group-by](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-groupby.md) # columns Properties Use the `columns` property to add a column to a step query source in Compact form 2.0. ## Example: Aggregate measure column defined in Compact form 2.0 ```nolang "columns": [ { "field": [ "sum", "Amount" ] } ] ``` ## Example: Non-aggregate columns defined in Compact form 2.0 ```nolang "columns": [ { "field": "Customer_Name", "name": "Customer_Name" }, { "field": "Product_Name", "name": "Product_Name" }, { "field": "Profit", "name": "Profit" } ] ``` ## Example: Formula column defined in Compact form 2.0 ```nolang "columns": [ { "formula": "A*2", "name": "B" } ] ``` # Combine Data from Multiple Data Streams with cogroup You can combine data from two or more data streams into a single data stream using `cogroup`. The data streams must have at least one common field. ## Example - Inner cogroup Suppose that you want to understand how much time your reps spend meeting with each account. Is there a relationship between spending more time and winning an account? Are some reps spending much more or much less time than average? To answer these questions, first combine meeting data with account data using `cogroup`. Suppose that you have a dataset of meeting information from the Salesforce Event object. In this example, your reps have had six meetings with four different companies. The Meetings dataset has a MeetingDuration column, which contains the meeting duration in hours. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_meeting.png) The account data exists in the Salesforce Opportunity object. The Ops dataset has an Account, Won, and Amount column. The Amount column contains the dollar value of the opportunity, in millions. ![Diagram showing the Ops datasets.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_account.png) To see the effect of meeting duration on opportunities, you start by combining these two datasets into a single data stream using `cogroup`. ```nolang q = cogroup ops by 'Account', meetings by 'Company'; ``` Internally (you cannot see these results yet), the resulting cogrouped data stream contains the following data. Note how the data streams are rolled up on one or more dimensions. ```nolang (1,{(Shoes2Go,2),(Shoes2Go,5)},{(Shoes2Go,1,1.5),(Shoes2Go,0,3}) (2,{(FreshMeals,3),(FreshMeals, 1)},{(FreshMeals,1,2) (FreshMeals,1,1.4)}) (3,{(ZipBikeShare,4)},{(ZipBikeShare,1,1.1)}) (4,{(ZenRetreats,6)},{(ZenRetreats,0,2)}) ``` Now the datasets are combined. To see the data, you create a projection using `foreach`: ```nolang ops = load "Ops"; meetings = load "Meetings"; q = cogroup ops by 'Account', meetings by 'Company'; q = foreach q generate ops.'Account' as 'Account', sum(ops.'Amount') as 'Sum of Amount', sum(meetings.'MeetingDuration') as 'TimeSpent'; ``` The resulting data stream contains the sum of amount and total meeting time for each company. The sum of amount is the sum of the dollar value for every opportunity for the company. ![Diagram showing the combined dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_cogroup_ds_result.png) Now that you have combined the data into a single data stream, you can analyze the effects that total meeting time has on your opportunities. **See Also** - [cogroup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-cogroup.md) # Comments To add a single-line comment in SAQL, preface your comment with two hyphens (`--`). To add a multi-line comment, start your comment with a forward slash and asterisk (`/*`) and end it with an asterisk and forward slash (`*/`). ## Single-Line Comments Here’s an example of a single-line comment on its own line. ```nolang --Load a data stream. a = load "myData"; ``` You can put a comment at the end of a line of SAQL code. ```nolang a = load "myData"; --Load a data stream. ``` To comment a line of SAQL code, add two hyphens at the beginning of the line. ```nolang --The following line is commented out: --a = load "myData"; ``` ## Multi-Line Comments Here’s an example of a multi-line comment. ```nolang q = load "campaign_data"; q = group q by Owner; q = foreach q generate count() as 'count'; /* q = limit q 5; */ ``` # Comparison Operators Use comparison operators to compare values of the same type. For example, you can compare strings with strings and numbers with numbers. | Operator | Name | Description | | --------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `==` | Equals | Returns `True` if the operands are equal. String comparisons that use the equals operator are case-sensitive. | | `!=` | Not equals | Returns `True` if the operands aren't equal. | | `<` | Less than | Returns `True` if the left operand is less than the right operand. | | `<=` | Less or equal | Returns `True` if the left operand is less than or equal to the right operand. | | `>` | Greater than | Returns `True` if the left operand is greater than the right operand. | | `>=` | Greater or equal | Returns `True` if the left operand is greater than or equal to the right operand. | | `like` | Like | Returns `True` if the left operand contains the string on the right. Wildcards and regular expressions aren't supported. This operator is case-sensitive. To match any single character in the string, include an underscore (`_`). To match any pattern of zero or more characters include a percent sign (`%`). Starting a pattern with a percent sign returns all words that are either the pattern itself or that end with it. Ending a pattern with a percent sign returns all the words that are either the pattern itself or that begin with it. To match a pattern anywhere in a string, the pattern must start and end with a percent sign. To include a literal percent sign or underscore in a pattern, you must escape them with a backwards slash (`\`). Use with `!` to exclude records. | | `matches` | Matches | Returns `True` if the left operand contains the string on the right. Wildcards and regular expressions aren't supported. This operator isn't case-sensitive. Single-character matches aren't supported. | | `in` | In | Returns `True` if the left operand contains one or more of the values in the array on the right. If the left operand is a measure, the query returns `True` if the left operand is in the array on the right. Use the [`date()` function](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date.md) to filter by date ranges. If you search for values in an empty array, in returns `False`. Ranges that are out of order evaluate to `False`. For example, `["Z" .. "A"]` evaluates to `False`. | | `in*` | In star | Use in\* to search multivalue fields. Returns `True` for each row that contains every value in an array on the right. | | `not in` | Not in | Returns `True` if the left operand isn't equal to any of the values in an array on the right. | | `not in*` | Not in star | Use `not in*` with multivalue fields. Returns `True` if the left operand doesn't contain any of the values in the array on the right. | **Note:** For multivalue fields, use `in` to identify rows that contain some value. **Note:** For multivalue fields, use `not in` to identify rows that don't contain some value. This query matches names such as Anita Boyle, Annie Booth, Derek Jernigan, and Hazel Jennings: ```nolang q = filter q by Customer_Name like "%ni%"; ``` This query matches names that end with "ne" or contain "ne." These names include Andrew Levine, Annette Boone, Annette Cline, and Annie Horne: ```nolang q = filter q by Customer_Name like "%ne"; ``` This query shows all customer names that don't contain "po": ```nolang q = filter q by !(Customer_Name like "%po%"); ``` This query matches airport codes such as LAX, LAS, ALA, and BLA: ```nolang my_matches = filter a by origin matches "LA"; ``` Use `!` to exclude records. This query shows all opportunities where Stage isn't equal to Closed Lost or Closed Won: ```nolang q = filter q by !('Stage' matches "Closed"); ``` For example: ```nolang a1 = filter a by origin in ["ORD", "LAX", "LGA"]; ``` **note:** If you use `matches` or `like` with multivalue fields, make sure to use `mv_to_string()` to match all relevant values. If any of the values in the array satisfies the condition, the query returns the first value. The query returns array values in numerical or alphabetical order. The first value it returns in this case isn't necessarily the value that satisfied the condition. **See Also** - [filter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-filter.md) - [Multivalue Field](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-multivalue.md) # 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](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/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 } } } ``` # Component Attributes You can convert any Lightning Web Component into a CRM Analytics Lightning Web Component by adding specific attributes. The Lightning Web Component framework requires a special tag to know your component is compatible for use in CRM Analytics dashboards. Let’s start by adding this XML to your `js-meta.xml` file: ```nolang analytics__Dashboard ``` The `target` attribute informs the designer UI that this widget is compatible with CRM Analytics and Lightning dashboards, and allows the component to show up in the component selector. This stage in the process is also a good time to make sure your component widget is visible. To enable visibility, check out this line in the js-meta.xml: ```nolang true ``` Now any dashboard author can add your widget after it’s published to an org, but you also want to expose configuration options. To do that, create an attribute: ```nolang false ``` Here, you set `hasStep` to `false` because you aren’t using any query data. You’re adding a single attribute title, which is type `String`, so that the dashboard author can type any free text to configure. Set `required="true"` so that authors can’t make blank components. When you’re done, the whole file looks something like: **note:** In Lightning dashboards, the \ tag is always set to false since the custom Lightning web components don't query any data. ```nolang 53.0 true Hello LWC Test project for LWC. analytics__Dashboard false ``` **note:** Your API version can be different so that it matches the version of the Salesforce org that you’re developing your Lightning Web Component for. To wire up the component, start by adding these attributes with `@api` annotations in your `.js` file. After you add them, the `.js` file looks like: ```javascript import { LightningElement, api } from "lwc"; export default class HelloWorld extends LightningElement { @api title; } ``` You don’t use any custom logic in this example, so no additional code is needed. You do need your component to say hello, so edit the HTML template in the `.html` file. ```html ``` **See Also** - [CRM Analytics Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-config.md) - [Lightning Dashboards Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-lightning-dashboard-config.md) - [Query Data](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-query-data.md) - [Other Widgets](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-other.md) # Configure a JWT Bearer Flow The standard External Client App (ECA) setup for Tableau Next embedding uses the OAuth 2.0 web server flow. If your app requires non-interactive, server-to-server authentication, you can configure a JWT bearer flow by using the Salesforce External Client App Manager. The web server flow remains the recommended flow for SDK embedding on behalf of interactive users. The JWT bearer flow is an alternative for non-interactive scenarios only. | **User Permissions Needed** | | | --------------------------------------------------- | --------------------------------------------- | | To view Salesforce Setup: | View Setup and Configuration | | To manage External Client Apps in Salesforce Setup: | Create, edit, and delete External Client Apps | | To assign permission sets: | Assign Permission Sets | ## JWT Bearer Flow Overview For Tableau Next Embedding, the web server flow is the recommended and default flow. The JWT bearer flow is a non-interactive, server-to-server OAuth 2.0 flow. Your app proves its identity by signing a JSON Web Token (JWT) with an RSA private key and sending it to the Salesforce token endpoint. Salesforce verifies the signature against a public certificate uploaded to the ECA and returns an access token directly. There’s no browser redirect and no user login. To use the JWT bearer flow with embedding, you're required to perform extra configuration steps. You must create a public certificate, upload it to your ECA, and then create and assign a custom permission set. ## Generate an RSA Key Pair and X.509 Certificate The JWT bearer flow signs each token request with your app's private key. Generate a 2048-bit RSA private key and a self-signed X.509 public certificate. The private key stays with your app, and you upload the public certificate to your ECA. ```bash # Generate the private key openssl genrsa -out sf_private_key.pem 2048 # Generate the public X.509 certificate (valid for 365 days) openssl req -new -x509 -key sf_private_key.pem -out sf_public_cert.crt -days 365 ``` The `openssl req -new -x509` command is interactive and prompts for a subject. To skip prompts, add `-subj` to your command, similar to `-subj "/CN=tableau-next-eca"`. ## Update Your External Client App in Salesforce Setup This flow assumes you've created your ECA in Tableau Next and are now editing it for more options. 1. From the Salesforce setup page, enter _External_ in the Quick Find box, and then select **External Client App Manager**. 2. For your existing ECA, in the dropdown menu, select **Edit Settings**. ![Edit the settings for your existing External Client App.](https://developer.salesforce.com/docs/media/sdk/sdk_eca_edit_settings.png '{"class": "image-lg"}') 3. Open the OAuth Setting section. ![Edit the OAuth settings for an existing external client app.](https://developer.salesforce.com/docs/media/sdk/sdk_eca_edit_oauth_settings.png '{"class": "image-lg"}') 4. For **OAuth Scopes**, select the scopes you need for your flow. - We recommend these OAuth scopes when using a **JWT Bearer Flow** for embedding, `Manage user data via Web browsers (web)` and `Perform requests at any time (refresh_token, offline_access)`. 5. In the Flow Enablement section, select the **JWT Bearer Flow**. - Upload the public certificate file, `sf_public_cert.crt`. 6. For Security, select **Require secret for Refresh Token** and any other options you need. Configure these options only if your security policy requires them. 7. Save your changes. Before leaving this page, on the Settings tab, click **Consumer Key and Secret** to copy and save the values. You need the consumer key value for the `client_id` and the consumer secret value for the `client_secret`. ## Create a Custom Permission Set The JWT bearer flow requires a pre-authorized JWT subject user, the user named in the JWT's sub claim, in the ECA settings. Pre-authorization is granted by adding a custom permission set to the allowlist in the ECA. Create a custom permission set with the access your JWT subject user needs. Creating a permission set scoped to the access for your JWT subject user only follows the principle of least privilege. 1. In Salesforce Setup, enter _Permission Sets_ in the Quick Find box, and then select **Permission Sets**. 2. Click **New**. 3. Enter a label and API name. For example, set the label to _Tableau Next Embedding JWT_ and the API name to _TableauNextEmbeddingJWT_. 4. Leave **License** set to **None** unless your org requires a specific user license for this permission set. 5. Save the customized permission set. On the customized permission set details page, configure the access required for Tableau Next embedding. At a minimum, the permission set needs: - System Permissions: grant any system-level permissions that your org requires for Tableau Next API access - Object Settings: grant Read on the Tableau Next objects that your app needs read access to - Custom Permissions: assign any Tableau Next custom permissions required by your app ## Assign the Custom Permission Set to the JWT Subject User 1. On the custom permission Details page, click **Manage Assignments**. 2. Click **Add Assignment**. 3. Select the JWT subject user, the user named in the sub claim of your JWT, or a profile whose users will act as JWT subjects. 4. Click **Assign** and then **Done**. ## Add the Custom Permission Set to the ECA Allowlist 1. In Salesforce Setup, enter _External_ in the Quick Find box, and then select **External Client App Manager**. 2. To edit your ECA, select it from the list of apps. 3. Click **Edit**. 4. On the OAuth Policies panel, update the _Permitted Users_ value to **Admin approved users are pre-authorized**. ![Editing the OAuth Policies plug-in policy.](https://developer.salesforce.com/docs/media/sdk/setup_admin_approved_plugin.png '{"class": "image-lg"}') 5. On the App Policies panel, add the custom permission set to the **Select Permission Sets** list. ![Add the custom permission set to the App Policies.](https://developer.salesforce.com/docs/media/sdk/setup_eca_app_policies.png '{"class": "image-lg"}') 6. Save and close. For your users that are viewing embedded Tableau Next assets in your web app, assign the custom permission set. This assignment adds users for pre-authorization. For more information on assigning permission sets to users, see [Assign Tableau Next User Permissions](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-setup-users.md). ## Securely Store the Private Key On the Settings tab for your ECA, click **Consumer Key and Secret** and copy the consumer key. The consumer key is used as the `iss` claim in the JWT. Store the private key securely on your app server. For Node.js, the recommended approach is to use an environment variable, with the key file kept out of source control: ```bash # .env (do not commit) SF_PRIVATE_KEY="-----BEGIN PRIVATE KEY----- -----END PRIVATE KEY-----" ``` For Heroku, use a config var: ```bash heroku config:set SF_PRIVATE_KEY="$(cat sf_private_key.pem)" ``` ## Exchange the JWT for an Access Token Your app builds a signed JWT and issues a POST to the Salesforce token endpoint with `grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer`. Salesforce verifies the signature against the uploaded certificate and returns an access token. ```javascript import express from "express"; import jwt from "jsonwebtoken"; import crypto from "crypto"; import dotenv from "dotenv"; dotenv.config(); const app = express(); app.post("/jwtBearerToken", async (req, res) => { try { const privateKey = process.env.SF_PRIVATE_KEY; if (!privateKey) { return res.status(500).json({ error: "Missing Salesforce private key" }); } // This must be the Salesforce login URL — login.salesforce.com, // test.salesforce.com, or your My Domain login URL. NOT the // Lightning URL or the Setup URL. const LOGIN_URL = "https://login.salesforce.com"; const now = Math.floor(Date.now() / 1000); const jwtClaimSet = { iss: "", sub: "", // full Salesforce username of the pre-authorized JWT subject user aud: LOGIN_URL, // Salesforce login URL exp: now + 3 * 60, // 3 minutes from now nbf: now, // not-before — recommended per RFC 7523 jti: crypto.randomUUID(), // unique JWT id — replay defense }; const assertion = jwt.sign(jwtClaimSet, privateKey, { algorithm: "RS256" }); const params = new URLSearchParams({ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer", assertion, }); const tokenResponse = await fetch(`${LOGIN_URL}/services/oauth2/token`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: params.toString(), }); if (!tokenResponse.ok) { return res.status(500).json({ error: "Failed to fetch token", details: await tokenResponse.text(), }); } const tokenData = await tokenResponse.json(); return res.json(tokenData); // { access_token, instance_url, id, token_type, issued_at } } catch (err) { return res.status(500).json({ error: "Internal server error" }); } }); ``` **note:** This example is JavaScript and runs on Node.js with Express. You can implement the same JWT bearer flow in any server-side language, substituting the equivalent JWT signing and HTTP primitives in your stack of choice. For example, Java with Spring Boot using `java.security` and a JWT library, Python with `pyjwt` and requests, Go with `golang-jwt/jwt`, Ruby on Rails with `ruby-jwt`, or .NET / C# with `System.IdentityModel.Tokens.Jwt`. The endpoint path, claim set, and request and response shapes are identical regardless of language. ## Generate the Frontdoor URL and Embed When your app has the access token, generate the Frontdoor URL with a POST to `${instance_url}/services/oauth2/singleaccess` and pass the resulting Frontdoor URL to the SDK as the `authCredential` value. This step is identical to the web server flow. See [Generate the Access Token and Frontdoor URL for Tableau Next Embedding](/docs/analytics/sdk/guide/sdk-access-token.html). # Configure Recipe Execution Data Prep recipes can be complex and add to app creation time if they sync and execute while the templated app is generating. Recipes can also change the shape of your existing data. The `executeCondition` attribute for recipe entries allows you to specify if a templated recipe syncs and executes during templated app creation or not. To specify the execution selection for a recipe entry in `template-info.json`, add the `executeCondition` attribute. The valid values for this attribute are: - `CreateOnly`—Create the recipe during templated app creation, but don’t sync or execute it. - `CreateExecute`—Create and execute the recipe during templated app creation, but don’t sync it. - `CreateSyncExecute`—(Default) Create, sync, and execute the recipe during templated app creation. The `executeCondition` attribute is optional. When not specified, the default behavior during templated app creation is to create, sync, and execute the recipe. After app creation, all recipes created are visible in the Data Manager. You can verify a recipe was created correctly for your data, then configure it for data sync, execution, and scheduling. Here are examples for recipe entries using `executeCondition` in `template-info.json`. ## Example Specify a recipe that is created at templated app runtime, but data sync and recipe execution aren’t run. ```nolang "recipes": [ { "label": "Sentiment Analysis Recipe", "name": "Sentiment_Analysis_Recipe", "file": "sentiment_analysis_recipe.json", "executeCondition": "CreateOnly" } ] ``` ## Example Specify a recipe where the `executeCondition` is determined by an EL expression, like a variable value. The EL expression used must evaluate to one of the valid values. ```nolang "recipes": [ { "label": "Contact Import Recipe", "name": "Contact_Import_Recipe", "file": "contact_import_recipe.json", "executeCondition": "${Variables.executionType}" } ] ``` # Configure the Upload Configure the external data upload by inserting a row into the InsightsExternalData object and setting configuration values. After establishing a connection with Salesforce, insert a row into the InsightsExternalData object to configure and control the upload. The InsightsExternalData object provides a “header” that contains information about the upload, such as the name of the dataset, the format of the data, and the operation to perform on the data. You can also provide the metadata file. If you are uploading a CSV file without a header row, you must set the `numberOfLinesToIgnore` value to `0` in the metadata file. If you don’t set this value, the first row of every data part upload may be lost. For more information on the metadata file, see [External Data Metadata Overview](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-schema-overview.md). The following example inserts a row into the InsightsExternalData object and sets configuration values. ```nolang SObject sobj = new SObject(); sobj.setType("InsightsExternalData"); sobj.setField("Format","Csv"); sobj.setField("EdgemartAlias", DatasetName); sobj.setField("MetadataJson",metadataJson); sobj.setField("Operation","Overwrite"); sobj.setField("Action","None"); SaveResult[] results = partnerConnection.create(new SObject[] { sobj }); for(SaveResult sv:results) if(sv.isSuccess()) parentID = sv.getId(); ``` **note:** The WSC converts the metadata .json file to a Base64-encoded string, but if you’re using REST API, you need to make this conversion yourself. For detailed information about the InsightsExternalData object, see [The InsightsExternalData Object](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/reference/bi-ext-data-object-externaldata.md). # Configure the XMD for a Dataset You can configure the XMD file to override the default appearance of dataset fields and field values and to add actions to dimensions in charts and tables. Each dataset has a separate XMD file. While you can edit the XMD, you can’t export it. ## Before You Begin You can also use the XMD API endpoints to edit an XMD file. For more information, see the _CRM Analytics REST API Developer Guide_. | Required Editions | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Available in Salesforce Classic and Lightning Experience. | | Available with CRM Analytics, which is available for an extra cost in **Enterprise**, **Performance**, and **Unlimited** Editions. Also available in **Developer** Edition. | | User Permissions Needed | | | ----------------------- | --------------------------------------------------------------------- | | To edit the XMD: | Edit CRM Analytics Dataflows OR Upload External Data to CRM Analytics | **note:** This procedure applies to CRM Analytics Datasets only. Data 360 objects (DMOs, DLOs, CIOs) don't support file-based XMD editing. Instead, you edit their presentation metadata directly in the UI through the Fields Panel. See [Access Data 360 XMD in the UI](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-access-data-360.md). 1. Edit the dataset. 2. Download the XMD file from the Edit page. If you download an old XMD version, CRM Analytics converts it to the current version. CRM Analytics ignores settings that it can’t convert. 3. Edit the file with a text editor. To ensure that the JSON format is correct, validate it with a JSON editor. 4. Save the file in UTF-8 format to ensure that CRM Analytics visualizations display international characters. 5. Upload the updated file to the Edit page. CRM Analytics validates the XMD file. If the XMD isn’t valid, an error occurs and the updated XMD settings aren’t applied. All formatting reverts to the defaults. Each time you upload the XMD file, CRM Analytics overwrites the current dataset customizations. Changes in the XMD aren’t appended to previous customizations. Ensure that your XMD file contains all required customizations. The validation rules and related errors are in the [Extended Metadata (XMD) 2.0 Validation Rules and Errors](https://help.salesforce.com/articleView?id=Extended-Metadata-XMD-2-0-Validation-Rules-and-Errors&type=1) knowledge article. ## Next Steps If the dataset metadata changes after you configure the XMD, such as a field is deleted or renamed as a result of changes to the dataflow, you must update the associated XMD. For example, if the XMD refers to the old field names, errors occur when you try to configure actions using the UI. The error also appears in the `errorMessage` field in the XMD file. **See Also** - [Extended Metadata (XMD) Reference](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference.md) # Connect to Salesforce After preparing your data files, the next step in loading external data into CRM Analytics is to connect to your Salesforce organization by using standard Salesforce APIs. **note:** The following examples use SOAP API, but you can use any of the Salesforce APIs, such as REST API or Apex. The examples assume that you’re using the Web Services Connector. To load external data into CRM Analytics, first connect to your Salesforce organization. Use the PartnerConnection object to log in to your organization, as shown in the following example. You need to supply a username, password, and endpoint. ```nolang ConnectorConfig config = new ConnectorConfig(); config.setUsername(username); config.setPassword(password); config.setAuthEndpoint(endpoint); PartnerConnection partnerConnection = new PartnerConnection(config); ``` For more information about the Web Services Connector (WSC), see [Introduction to the Web Services Connector](https://developer.salesforce.com/page/Introduction_to_the_Force.com_Web_Services_Connector). For more information about user authentication, see [Security and the API](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_concepts_security.htm) in the _SOAP API Developer Guide_. # Convert Dates to and from Strings You can convert dates to strings. - **[date_to_string(DateTime | DateOnly, format)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-date2string.md)** Converts a date to a string. - **[toDateTime(epoch)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-datetime-epoch.md)** Converts an epoch day to a `DateTime` type. - **[toDateTime(string, format)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-datetime-string.md)** Converts a date in string format to a `DateTime` type. _“format”_ specifies the date format and can be any valid date format. - **[toDateOnly(epoch)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-dateonly-epoch.md)** Converts an epoch to a `DateOnly` type. - **[toDateOnly(string, format)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-dateonly-string.md)** Converts a date in string format to a `DateOnly` type. _format_ specifies the date format and can be any valid date format. # Copy Component Code Snippet from Tableau Next Tableau Next provides a quick start for embedding code directly from your dashboard, visualization or metric. The embed feature creates component code for your selected asset, that you can copy and use in your web app. 1. Open your asset in Tableau Next, click **Share**, and select the **Embed** tab. ![Tableau Next insights embedded in a third-party web app](https://developer.salesforce.com/docs/media/sdk/embedded_tn_embed_modal_upd.png '{"class": "image-framed"}') 2. To copy the code snippet for use in your web app, click **Copy Embed Code**. This snippet has a placeholder for the `AUTH_CREDENTIAL` value. This placeholder must be 3. replaced with the generated Frontdoor URL value when you copy the code to your web app. If you have any filters applied to your dashboard, visualization, or metric, they aren't present in the code snippet. In Winter '26, these filters aren’t supported. Adding and using filters must be done programmatically in your web app code. --- [Next - Install the Tableau Next Embedding SDK](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-install-sdk.md) # cos({n}) Returns the cosine value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `cos()` returns `null`. `cos({n})` takes the following syntax. ```nolang SELECT COS(N) as ALIAS FROM DATASET; ``` ## Example This example takes the cosine of 90 degrees. ```nolang SELECT COS(RADIANS(90)) as cosValue FROM "Opportunity" LIMIT 1; ``` | cosValue | | ----------- | | 6.12323e-17 | # cos(n) Returns the cosine value of radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `cos()` returns `null`. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate cos(radians) as cosine; ``` # count() Returns the number of rows that match the query criteria. For example, to calculate the number of carriers: ```nolang q = foreach q generate 'carrier' as 'carrier', count() as 'count'; ``` `count()` operates on the stream that is input to the `group` or `cogroup` statement. It doesn’t operate on the newly grouped stream or on an ungrouped stream. ```nolang q = load "Carriers"; q = group q by (Year); q = foreach a1 generate count(q) as countYear, count() as count, Year as year; ``` # count() Returns the number of rows that match a specified condition in a column. `count()` follows this syntax. ```nolang SELECT count(COLUMN_NAME) FROM DATASET WHERE CONDITION; ``` # Create a Derived Dimension Perform string manipulations on existing dimensions to create a new, or derived, dimension. CRM Analytics creates derived dimensions at run time. **note:** You can also create a derived dimension in a dataflow rather than at runtime. ## Example - Create a Field with City and State Suppose that you have an Opportunities dataset with a City and a State field. You want to create a single field containing both city and state. Use SAQL to create a derived dimension. ```nolang q = load "Ops"; q = foreach q generate 'Account' as 'Account', 'Amount' as 'Amount', 'City' + "-" + 'State' as 'City - State'; ``` The resulting table contains city and state in the same field. ![Derived dimension shows time to win](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_derived_dimension.png) # Create a Derived Measure Perform calculations on existing measures and use the result to create a new, or derived, measure. CRM Analytics calculates the value of derived measures at run time using the values from other fields. **note:** You can also create a derived measure in a dataflow rather than at runtime using SAQL. Measures created during a dataflow are calculated when the data is imported and may result in better performance. ## Example - Calculate the Time to Win Suppose that you have an Opportunities dataset with the Close Date and Open Date fields. You want to see the number of days it took to win the opportunity. Use CloseDate_day_epoch and CreatedDate_day_epoch to create a derived measure called Time to Win: `('CloseDate_day_epoch'- 'CreatedDate_day_epoch') as 'Time to Win'`. The field Time to Win is calculated at run time: ```nolang q = load "Opportunities"; q = foreach q generate 'CloseDate_day_epoch' as 'CloseDate_day_epoch', 'CreatedDate_day_epoch' as 'CreatedDate_day_epoch', 'Opportunity_Name' as 'Opportunity_Name', ('CloseDate_day_epoch'- 'CreatedDate_day_epoch') as 'Time to Win'; ``` The resulting table contains the number of days to win each opportunity: ![Derived dimension shows time to win](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_derived_measure.png) # Create a New Report Create a new report using a POST request. ## Example Usage `/services/data/v39.0/analytics/reports` ## Example Request Body To create a report, you only have to specify `reportMetadata` with a `name` and a `reportType` to create a new report. Other properties are optional. ```nolang { "reportMetadata": { "name":"NewReport", "reportType": { "type" : "Opportunity" } } } ``` ## Example Response Body The response includes the new report’s `reportExtendedMetadata`, `reportMetadata`, and `reportTypeMetadata`. ```nolang { "reportExtendedMetadata" : { "aggregateColumnInfo" : { "RowCount" : { "dataType" : "int", "label" : "Record Count" } }, "detailColumnInfo" : { "ROLLUP_DESCRIPTION" : { "dataType" : "string", "label" : "Owner Role" }, "FULL_NAME" : { "dataType" : "string", "label" : "Opportunity Owner" }, "ACCOUNT_NAME" : { "dataType" : "string", "label" : "Account Name" }, "OPPORTUNITY_NAME" : { "dataType" : "string", "label" : "Opportunity Name" }, "STAGE_NAME" : { "dataType" : "picklist", "label" : "Stage" }, "FISCAL_QUARTER" : { "dataType" : "string", "label" : "Fiscal Period" }, "AMOUNT" : { "dataType" : "currency", "label" : "Amount" }, "PROBABILITY" : { "dataType" : "percent", "label" : "Probability (%)" }, "AGE" : { "dataType" : "int", "label" : "Age" }, "CLOSE_DATE" : { "dataType" : "date", "label" : "Close Date" }, "CREATED_DATE" : { "dataType" : "datetime", "label" : "Created Date" }, "NEXT_STEP" : { "dataType" : "string", "label" : "Next Step" }, "LEAD_SOURCE" : { "dataType" : "picklist", "label" : "Lead Source" }, "TYPE" : { "dataType" : "picklist", "label" : "Type" } }, "groupingColumnInfo" : { } }, "reportMetadata" : { "aggregates" : [ "RowCount" ], "chart" : null, "crossFilters" : [ ], "currency" : null, "description" : null, "detailColumns" : [ "ROLLUP_DESCRIPTION", "FULL_NAME", "ACCOUNT_NAME", "OPPORTUNITY_NAME", "STAGE_NAME", "FISCAL_QUARTER", "AMOUNT", "PROBABILITY", "AGE", "CLOSE_DATE", "CREATED_DATE", "NEXT_STEP", "LEAD_SOURCE", "TYPE" ], "developerName" : "DocTest2_mG", "division" : null, "folderId" : "005R0000000Kg8cIAC", "groupingsAcross" : [ ], "groupingsDown" : [ ], "hasDetailRows" : true, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OR0000000PYkiMAG", "name" : "DocTest2", "reportBooleanFilter" : null, "reportFilters" : [ ], "reportFormat" : "TABULAR", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "THIS_FISCAL_QUARTER", "endDate" : "2016-12-31", "startDate" : "2016-10-01" }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ], "supportsRoleHierarchy" : true, "userOrHierarchyFilterId" : null }, "reportTypeMetadata" : { "categories" : [ { "columns" : { "CREATED" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Created By" }, "CREATED_ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Created Alias" }, "LAST_UPDATE_BY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Last Modified By" }, "LAST_UPDATE_BY_ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Last Modified Alias" }, "OPPORTUNITY_NAME" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Name" }, "TYPE" : { "dataType" : "picklist", "filterValues" : [ { "label" : "Existing Business", "name" : "Existing Business" }, { "label" : "New Business", "name" : "New Business" } ], "filterable" : true, "label" : "Type" }, "LEAD_SOURCE" : { "dataType" : "picklist", "filterValues" : [ { "label" : "Advertisement", "name" : "Advertisement" }, { "label" : "Employee Referral", "name" : "Employee Referral" }, { "label" : "External Referral", "name" : "External Referral" }, { "label" : "Partner", "name" : "Partner" }, { "label" : "Public Relations", "name" : "Public Relations" }, { "label" : "Seminar - Internal", "name" : "Seminar - Internal" }, { "label" : "Seminar - Partner", "name" : "Seminar - Partner" }, { "label" : "Trade Show", "name" : "Trade Show" }, { "label" : "Web", "name" : "Web" }, { "label" : "Word of mouth", "name" : "Word of mouth" }, { "label" : "Other", "name" : "Other" } ], "filterable" : true, "label" : "Lead Source" }, "PARTNER_NAME" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Primary Partner" }, "AMOUNT" : { "dataType" : "currency", "filterValues" : [ ], "filterable" : true, "label" : "Amount" }, "CLOSED" : { "dataType" : "boolean", "filterValues" : [ { "label" : "True", "name" : "True" }, { "label" : "False", "name" : "False" } ], "filterable" : true, "label" : "Closed" }, "WON" : { "dataType" : "boolean", "filterValues" : [ { "label" : "True", "name" : "True" }, { "label" : "False", "name" : "False" } ], "filterable" : true, "label" : "Won" }, "CLOSE_DATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "label" : "Close Date" }, "CLOSE_DATE2" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "label" : "Close Date (2)" }, "CLOSE_MONTH" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "label" : "Close Month" }, "LAST_STAGE_CHANGE_DATE" : { "dataType" : "datetime", "filterValues" : [ ], "filterable" : true, "label" : "Last Stage Change Date" }, "NEXT_STEP" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Next Step" }, "STAGE_NAME" : { "dataType" : "picklist", "filterValues" : [ { "label" : "Prospecting", "name" : "Prospecting" }, { "label" : "Qualification", "name" : "Qualification" }, { "label" : "Needs Analysis", "name" : "Needs Analysis" }, { "label" : "Value Proposition", "name" : "Value Proposition" }, { "label" : "Id. Decision Makers", "name" : "Id. Decision Makers" }, { "label" : "Perception Analysis", "name" : "Perception Analysis" }, { "label" : "Proposal/Price Quote", "name" : "Proposal/Price Quote" }, { "label" : "Negotiation/Review", "name" : "Negotiation/Review" }, { "label" : "Closed Won", "name" : "Closed Won" }, { "label" : "Closed Lost", "name" : "Closed Lost" } ], "filterable" : true, "label" : "Stage" }, "PROBABILITY" : { "dataType" : "percent", "filterValues" : [ ], "filterable" : true, "label" : "Probability (%)" }, "FISCAL_QUARTER" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Fiscal Period" }, "FISCAL_YEAR" : { "dataType" : "int", "filterValues" : [ ], "filterable" : true, "label" : "Fiscal Year" }, "AGE" : { "dataType" : "int", "filterValues" : [ ], "filterable" : true, "label" : "Age" }, "STAGE_DURATION" : { "dataType" : "int", "filterValues" : [ ], "filterable" : true, "label" : "Stage Duration" }, "FORECAST_CATEGORY" : { "dataType" : "picklist", "filterValues" : [ { "label" : "Omitted", "name" : "Omitted" }, { "label" : "Pipeline", "name" : "Pipeline" }, { "label" : "Best Case", "name" : "Best Case" }, { "label" : "Commit", "name" : "Commit" }, { "label" : "Closed", "name" : "Closed" } ], "filterable" : true, "label" : "Forecast Category" }, "OPPORTUNITY_ID" : { "dataType" : "id", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity ID" }, "LAST_ACTIVITY" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "label" : "Last Activity" }, "DESCRIPTION" : { "dataType" : "textarea", "filterValues" : [ ], "filterable" : true, "label" : "Description" }, "HASOPPLINEITEM" : { "dataType" : "boolean", "filterValues" : [ { "label" : "True", "name" : "True" }, { "label" : "False", "name" : "False" } ], "filterable" : true, "label" : "Has Products" }, "CREATED_DATE" : { "dataType" : "datetime", "filterValues" : [ ], "filterable" : true, "label" : "Created Date" }, "LAST_UPDATE" : { "dataType" : "datetime", "filterValues" : [ ], "filterable" : true, "label" : "Last Modified Date" } }, "label" : "Opportunity Information" }, { "columns" : { "FULL_NAME" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner" }, "ROLLUP_DESCRIPTION" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Owner Role" }, "ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner Alias" }, "OWNER_EMAIL" : { "dataType" : "email", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner Email" }, "OWNER_PHONE" : { "dataType" : "phone", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner: Phone" }, "OWNER_MOBILE_PHONE" : { "dataType" : "phone", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner: Mobile Phone" }, "OWNER_MANAGER" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner: Manager" }, "OWNER_TITLE" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner: Title" }, "OWNER_COMPANY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner: Company" }, "OWNER_DEPARTMENT" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner: Department" }, "OWNER_DIVISION" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner: Division" }, "OWNER_PROFILE" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Opportunity Owner: Profile" }, "OWNER_ACTIVE" : { "dataType" : "boolean", "filterValues" : [ { "label" : "True", "name" : "True" }, { "label" : "False", "name" : "False" } ], "filterable" : true, "label" : "Opportunity Owner: Active" } }, "label" : "Opportunity Owner Information" }, { "columns" : { "ACCOUNT_NAME" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Account Name" }, "ACCOUNT_OWNER" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Account Owner" }, "ACCOUNT_OWNER_ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Account Owner Alias" }, "PARENT_NAME" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Parent Account" }, "PARENT_ID" : { "dataType" : "id", "filterValues" : [ ], "filterable" : true, "label" : "Parent Account ID" }, "SALES" : { "dataType" : "currency", "filterValues" : [ ], "filterable" : true, "label" : "Annual Revenue" }, "ACCOUNT_TYPE" : { "dataType" : "picklist", "filterValues" : [ { "label" : "Analyst", "name" : "Analyst" }, { "label" : "Competitor", "name" : "Competitor" }, { "label" : "Customer", "name" : "Customer" }, { "label" : "Integrator", "name" : "Integrator" }, { "label" : "Investor", "name" : "Investor" }, { "label" : "Partner", "name" : "Partner" }, { "label" : "Press", "name" : "Press" }, { "label" : "Prospect", "name" : "Prospect" }, { "label" : "Reseller", "name" : "Reseller" }, { "label" : "Other", "name" : "Other" } ], "filterable" : true, "label" : "Account Type" }, "INDUSTRY" : { "dataType" : "picklist", "filterValues" : [ { "label" : "Agriculture", "name" : "Agriculture" }, { "label" : "Apparel", "name" : "Apparel" }, { "label" : "Banking", "name" : "Banking" }, { "label" : "Biotechnology", "name" : "Biotechnology" }, { "label" : "Chemicals", "name" : "Chemicals" }, { "label" : "Communications", "name" : "Communications" }, { "label" : "Construction", "name" : "Construction" }, { "label" : "Consulting", "name" : "Consulting" }, { "label" : "Education", "name" : "Education" }, { "label" : "Electronics", "name" : "Electronics" }, { "label" : "Energy", "name" : "Energy" }, { "label" : "Engineering", "name" : "Engineering" }, { "label" : "Entertainment", "name" : "Entertainment" }, { "label" : "Environmental", "name" : "Environmental" }, { "label" : "Finance", "name" : "Finance" }, { "label" : "Food & Beverage", "name" : "Food & Beverage" }, { "label" : "Government", "name" : "Government" }, { "label" : "Healthcare", "name" : "Healthcare" }, { "label" : "Hospitality", "name" : "Hospitality" }, { "label" : "Insurance", "name" : "Insurance" }, { "label" : "Machinery", "name" : "Machinery" }, { "label" : "Manufacturing", "name" : "Manufacturing" }, { "label" : "Media", "name" : "Media" }, { "label" : "Not For Profit", "name" : "Not For Profit" }, { "label" : "Other", "name" : "Other" }, { "label" : "Recreation", "name" : "Recreation" }, { "label" : "Retail", "name" : "Retail" }, { "label" : "Shipping", "name" : "Shipping" }, { "label" : "Technology", "name" : "Technology" }, { "label" : "Telecommunications", "name" : "Telecommunications" }, { "label" : "Transportation", "name" : "Transportation" }, { "label" : "Utilities", "name" : "Utilities" } ], "filterable" : true, "label" : "Industry" }, "EMPLOYEES" : { "dataType" : "int", "filterValues" : [ ], "filterable" : true, "label" : "Employees" }, "ACCOUNT_ID" : { "dataType" : "id", "filterValues" : [ ], "filterable" : true, "label" : "Account ID" }, "ACCOUNT_LAST_ACTIVITY" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "label" : "Account: Last Activity" }, "ACCOUNT_CREATED_DATE" : { "dataType" : "datetime", "filterValues" : [ ], "filterable" : true, "label" : "Account: Created Date" }, "ACCOUNT_LAST_UPDATE" : { "dataType" : "datetime", "filterValues" : [ ], "filterable" : true, "label" : "Account: Last Modified Date" }, "ACCOUNT_DESCRIPTION" : { "dataType" : "textarea", "filterValues" : [ ], "filterable" : true, "label" : "Account Description" } }, "label" : "Account: General" }, { "columns" : { "ADDRESS1_STREET" : { "dataType" : "textarea", "filterValues" : [ ], "filterable" : true, "label" : "Billing Street" }, "ADDRESS1_LINE1" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Billing Address Line 1" }, "ADDRESS1_LINE2" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Billing Address Line 2" }, "ADDRESS1_LINE3" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Billing Address Line 3" }, "ADDRESS1_CITY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Billing City" }, "ADDRESS1_STATE" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Billing State/Province" }, "ADDRESS1_ZIP" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Billing Zip/Postal Code" }, "ADDRESS1_COUNTRY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Billing Country" }, "ADDRESS2_STREET" : { "dataType" : "textarea", "filterValues" : [ ], "filterable" : true, "label" : "Shipping Street" }, "ADDRESS2_LINE1" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Shipping Address Line 1" }, "ADDRESS2_LINE2" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Shipping Address Line 2" }, "ADDRESS2_LINE3" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Shipping Address Line 3" }, "ADDRESS2_CITY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Shipping City" }, "ADDRESS2_STATE" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Shipping State/Province" }, "ADDRESS2_ZIP" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Shipping Zip/Postal Code" }, "ADDRESS2_COUNTRY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Shipping Country" } }, "label" : "Account: Address" }, { "columns" : { "PHONE1" : { "dataType" : "phone", "filterValues" : [ ], "filterable" : true, "label" : "Phone" }, "PHONE2" : { "dataType" : "phone", "filterValues" : [ ], "filterable" : true, "label" : "Fax" }, "URL" : { "dataType" : "url", "filterValues" : [ ], "filterable" : true, "label" : "Website" } }, "label" : "Account: Ph/Fax" }, { "columns" : { "CONTACT" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Primary Contact" }, "CON.TITLE" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Contact: Title" }, "CON.PHONE" : { "dataType" : "phone", "filterValues" : [ ], "filterable" : true, "label" : "Contact: Phone" }, "CON.EMAIL" : { "dataType" : "email", "filterValues" : [ ], "filterable" : true, "label" : "Contact: Email" } }, "label" : "Primary Contact" }, { "columns" : { "CON.ADDRESS2_STREET" : { "dataType" : "textarea", "filterValues" : [ ], "filterable" : true, "label" : "Mailing Street" }, "CON.ADDRESS2_LINE1" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Mailing Address Line 1" }, "CON.ADDRESS2_LINE2" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Mailing Address Line 2" }, "CON.ADDRESS2_LINE3" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Mailing Address Line 3" }, "CON.ADDRESS2_CITY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Mailing City" }, "CON.ADDRESS2_STATE" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Mailing State/Province" }, "CON.ADDRESS2_ZIP" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Mailing Zip/Postal Code" }, "CON.ADDRESS2_COUNTRY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Mailing Country" }, "CON.ADDRESS1_STREET" : { "dataType" : "textarea", "filterValues" : [ ], "filterable" : true, "label" : "Other Street" }, "CON.ADDRESS1_LINE1" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Other Address Line 1" }, "CON.ADDRESS1_LINE2" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Other Address Line 2" }, "CON.ADDRESS1_LINE3" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Other Address Line 3" }, "CON.ADDRESS1_CITY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Other City" }, "CON.ADDRESS1_STATE" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Other State/Province" }, "CON.ADDRESS1_ZIP" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Other Zip/Postal Code" }, "CON.ADDRESS1_COUNTRY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "label" : "Other Country" } }, "label" : "Contact: Address" } ], "dataTypeFilterOperatorMap" : { "date" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "string" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "picklist" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "textarea" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "percent" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "int" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "url" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "datetime" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "boolean" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" } ], "phone" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "currency" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "id" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "starts with", "name" : "startsWith" } ], "email" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ] }, "divisionInfo" : null, "scopeInfo" : { "defaultValue" : "organization", "values" : [ { "allowsDivision" : false, "label" : "My opportunities", "value" : "user" }, { "allowsDivision" : false, "label" : "My team's opportunities", "value" : "team" }, { "allowsDivision" : true, "label" : "All opportunities", "value" : "organization" } ] }, "standardDateFilterDurationGroups" : [ { "label" : "", "standardDateFilterDurations" : [ { "endDate" : "2016-12-12", "label" : "Custom", "startDate" : "2016-12-13", "value" : "CUSTOM" } ] }, { "label" : "Fiscal Year", "standardDateFilterDurations" : [ { "endDate" : "2016-12-31", "label" : "Current FY", "startDate" : "2016-01-01", "value" : "THIS_FISCAL_YEAR" }, { "endDate" : "2015-12-31", "label" : "Previous FY", "startDate" : "2015-01-01", "value" : "LAST_FISCAL_YEAR" }, { "endDate" : "2015-12-31", "label" : "Previous 2 FY", "startDate" : "2014-01-01", "value" : "LAST_N_FISCAL_YEARS:2" }, { "endDate" : "2014-12-31", "label" : "2 FY Ago", "startDate" : "2014-01-01", "value" : "LAST_N_FISCAL_YEARS_AGO:2" }, { "endDate" : "2017-12-31", "label" : "Next FY", "startDate" : "2017-01-01", "value" : "NEXT_FISCAL_YEAR" }, { "endDate" : "2016-12-31", "label" : "Current and Previous FY", "startDate" : "2015-01-01", "value" : "THIS_AND_LAST_FISCAL_YEAR:2" }, { "endDate" : "2016-12-31", "label" : "Current and Previous 2 FY", "startDate" : "2014-01-01", "value" : "THIS_AND_LAST_N_FISCAL_YEARS:2" }, { "endDate" : "2017-12-31", "label" : "Current and Next FY", "startDate" : "2016-01-01", "value" : "THIS_AND_NEXT_FISCAL_YEAR" } ] }, { "label" : "Fiscal Quarter", "standardDateFilterDurations" : [ { "endDate" : "2016-12-31", "label" : "Current FQ", "startDate" : "2016-10-01", "value" : "THIS_FISCAL_QUARTER" }, { "endDate" : "2017-03-31", "label" : "Current and Next FQ", "startDate" : "2016-10-01", "value" : "THIS_AND_NEXT_FISCAL_QUARTER" }, { "endDate" : "2016-12-31", "label" : "Current and Previous FQ", "startDate" : "2016-07-01", "value" : "LAST_AND_THIS_FISCAL_QUARTER" }, { "endDate" : "2017-03-31", "label" : "Next FQ", "startDate" : "2017-01-01", "value" : "NEXT_FISCAL_QUARTER" }, { "endDate" : "2016-09-30", "label" : "Previous FQ", "startDate" : "2016-07-01", "value" : "LAST_FISCAL_QUARTER" }, { "endDate" : "2017-09-30", "label" : "Current and Next 3 FQ", "startDate" : "2016-10-01", "value" : "THIS_AND_NEXT_N_FISCAL_QUARTERS:3" } ] }, { "label" : "Calendar Year", "standardDateFilterDurations" : [ { "endDate" : "2016-12-31", "label" : "Current CY", "startDate" : "2016-01-01", "value" : "THIS_YEAR" }, { "endDate" : "2015-12-31", "label" : "Previous CY", "startDate" : "2015-01-01", "value" : "LAST_YEAR" }, { "endDate" : "2015-12-31", "label" : "Previous 2 CY", "startDate" : "2014-01-01", "value" : "LAST_N_YEARS:2" }, { "endDate" : "2014-12-31", "label" : "2 CY Ago", "startDate" : "2014-01-01", "value" : "LAST_N_YEARS_AGO:2" }, { "endDate" : "2017-12-31", "label" : "Next CY", "startDate" : "2017-01-01", "value" : "NEXT_YEAR" }, { "endDate" : "2016-12-31", "label" : "Current and Previous CY", "startDate" : "2015-01-01", "value" : "THIS_AND_LAST_YEAR:2" }, { "endDate" : "2016-12-31", "label" : "Current and Previous 2 CY", "startDate" : "2014-01-01", "value" : "THIS_AND_LAST_N_YEARS:2" }, { "endDate" : "2017-12-31", "label" : "Current and Next CY", "startDate" : "2016-01-01", "value" : "THIS_AND_NEXT_YEAR" } ] }, { "label" : "Calendar Quarter", "standardDateFilterDurations" : [ { "endDate" : "2016-12-31", "label" : "Current CQ", "startDate" : "2016-10-01", "value" : "THIS_QUARTER" }, { "endDate" : "2017-03-31", "label" : "Current and Next CQ", "startDate" : "2016-10-01", "value" : "THIS_AND_NEXT_QUARTER" }, { "endDate" : "2016-12-31", "label" : "Current and Previous CQ", "startDate" : "2016-07-01", "value" : "LAST_AND_THIS_QUARTER" }, { "endDate" : "2017-03-31", "label" : "Next CQ", "startDate" : "2017-01-01", "value" : "NEXT_QUARTER" }, { "endDate" : "2016-09-30", "label" : "Previous CQ", "startDate" : "2016-07-01", "value" : "LAST_QUARTER" }, { "endDate" : "2017-09-30", "label" : "Current and Next 3 CQ", "startDate" : "2016-10-01", "value" : "THIS_AND_NEXT_N_QUARTERS:3" } ] }, { "label" : "Calendar Month", "standardDateFilterDurations" : [ { "endDate" : "2016-11-30", "label" : "Last Month", "startDate" : "2016-11-01", "value" : "LAST_MONTH" }, { "endDate" : "2016-12-31", "label" : "This Month", "startDate" : "2016-12-01", "value" : "THIS_MONTH" }, { "endDate" : "2017-01-31", "label" : "Next Month", "startDate" : "2017-01-01", "value" : "NEXT_MONTH" }, { "endDate" : "2016-12-31", "label" : "Current and Previous Month", "startDate" : "2016-11-01", "value" : "LAST_AND_THIS_MONTH" }, { "endDate" : "2017-01-31", "label" : "Current and Next Month", "startDate" : "2016-12-01", "value" : "THIS_AND_NEXT_MONTH" } ] }, { "label" : "Calendar Week", "standardDateFilterDurations" : [ { "endDate" : "2016-12-10", "label" : "Last Week", "startDate" : "2016-12-04", "value" : "LAST_WEEK" }, { "endDate" : "2016-12-17", "label" : "This Week", "startDate" : "2016-12-11", "value" : "THIS_WEEK" }, { "endDate" : "2016-12-24", "label" : "Next Week", "startDate" : "2016-12-18", "value" : "NEXT_WEEK" } ] }, { "label" : "Day", "standardDateFilterDurations" : [ { "endDate" : "2016-12-12", "label" : "Yesterday", "startDate" : "2016-12-12", "value" : "YESTERDAY" }, { "endDate" : "2016-12-13", "label" : "Today", "startDate" : "2016-12-13", "value" : "TODAY" }, { "endDate" : "2016-12-14", "label" : "Tomorrow", "startDate" : "2016-12-14", "value" : "TOMORROW" }, { "endDate" : "2016-12-13", "label" : "Last 7 Days", "startDate" : "2016-12-07", "value" : "LAST_N_DAYS:7" }, { "endDate" : "2016-12-13", "label" : "Last 30 Days", "startDate" : "2016-11-14", "value" : "LAST_N_DAYS:30" }, { "endDate" : "2016-12-13", "label" : "Last 60 Days", "startDate" : "2016-10-15", "value" : "LAST_N_DAYS:60" }, { "endDate" : "2016-12-13", "label" : "Last 90 Days", "startDate" : "2016-09-15", "value" : "LAST_N_DAYS:90" }, { "endDate" : "2016-12-13", "label" : "Last 120 Days", "startDate" : "2016-08-16", "value" : "LAST_N_DAYS:120" }, { "endDate" : "2016-12-19", "label" : "Next 7 Days", "startDate" : "2016-12-13", "value" : "NEXT_N_DAYS:7" }, { "endDate" : "2017-01-11", "label" : "Next 30 Days", "startDate" : "2016-12-13", "value" : "NEXT_N_DAYS:30" }, { "endDate" : "2017-02-10", "label" : "Next 60 Days", "startDate" : "2016-12-13", "value" : "NEXT_N_DAYS:60" }, { "endDate" : "2017-03-12", "label" : "Next 90 Days", "startDate" : "2016-12-13", "value" : "NEXT_N_DAYS:90" }, { "endDate" : "2017-04-11", "label" : "Next 120 Days", "startDate" : "2016-12-13", "value" : "NEXT_N_DAYS:120" } ] } ], "standardFilterInfos" : { "probability" : { "type" : "PICKLIST", "filterValues" : [ { "label" : "All", "name" : ">0" }, { "label" : "> 90%", "name" : "gt90" }, { "label" : "> 80%", "name" : "gt80" }, { "label" : "> 70%", "name" : "gt70" }, { "label" : "> 60%", "name" : "gt60" }, { "label" : "> 50%", "name" : "gt50" }, { "label" : "> 40%", "name" : "gt40" }, { "label" : "> 30%", "name" : "gt30" }, { "label" : "> 20%", "name" : "gt20" }, { "label" : "> 10%", "name" : "gt10" }, { "label" : "< 90%", "name" : "lt90" }, { "label" : "< 80%", "name" : "lt80" }, { "label" : "< 70%", "name" : "lt70" }, { "label" : "< 60%", "name" : "lt60" }, { "label" : "< 50%", "name" : "lt50" }, { "label" : "< 40%", "name" : "lt40" }, { "label" : "< 30%", "name" : "lt30" }, { "label" : "< 20%", "name" : "lt20" }, { "label" : "< 10%", "name" : "lt10" } ], "label" : "Probability" }, "open" : { "type" : "PICKLIST", "filterValues" : [ { "label" : "Any", "name" : "all" }, { "label" : "Open", "name" : "open" }, { "label" : "Closed", "name" : "closed" }, { "label" : "Closed Won", "name" : "closedwon" } ], "label" : "Opportunity Status" } } } } ``` # Create a Template with the Command Line Interface Use `analytics template` commands to create templates with the Salesforce Analytics Command Line Interface (CLI). You can also use the CLI to manage existing templates. 1. Get a list of available apps. In the CLI, enter the command `sf analytics app list`. The command returns a list of all apps in your org. ```nolang >>sf analytics app list NAME LABEL FOLDERID STATUS TEMPLATESOURCEID ────────── ────────── ─────────── ────── MyNewApp MyNewTemplate 00l0S000000MmGQQA0 newstatus SharedApp1 Shared App 00l0S000000Mm9tQAC completedstatus 0Nk0S0000008OJDSA2 SharedApp Shared App 00l0S000000EEVUQA4 newstatus 0Nk0S0000008OJDSA2 ``` 2. Look for your source app. If you haven’t already identified its folderID, find it in the response to the `list` command. 3. Create the template. Enter the command `analytics template create`. Here’s syntax for the command. `analytics template create -f folderid [-u username --apiversion api_version --json --loglevel log_level]` | | | | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | _folderid_ | Required. The ID of the source app to use when creating the template. You can use `analytics:app:list`to see information about the apps on your org. | | _username_ | The user name or alias of the target org. If not specified, CRM Analytics uses the default org. | | _api_version_ | The API version to use for this command. | | `--json` | Use this flag to specify format the output as JSON. | | `--loglevel` | Specify the log level for this command. Allowed values are `trace`, `debug`, `info`, `warn`, `error`, and `fatal` | The command returns something like the following: `Successfully created analytics template [0Nk0S0000008OJNSA2]` The WaveTemplate object and all its files are on your scratch org. Next, retrieve the object by pulling the files to your local workstation for editing. **See Also** - [Salesforce Analytics Plugin CLI Command Reference: template Commands](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_cli_reference.meta/bi_dev_guide_cli_reference/bi_cli_reference_analytics_template_unified.htm) # Create an Analytics Notification Create an Analytics Notification using a POST request. Use a POST request on the [Analytics Notification List](https://developer.salesforce.com/docs/analytics/reference/notifications/analytics-api-notifications-reference-list.md) resource to create an analytics notification. ## Example Usage `/services/data/v38.0/analytics/notifications` ## Example Request Body ```nolang { "active" : true, "createdDate" : "", "deactivateOnTrigger" : false, "id" : "", "lastModifiedDate" : "", "name" : "New Notification", "recordId" : "00OR0000000PD55MAG", "schedule" : { "details" : { "time" : 3 }, "frequency" : "daily" }, "source" : "lightningReportSubscribe", "thresholds" : [ { "actions" : [ { "configuration" : { "recipients" : [ ] }, "type" : "sendEmail" } ], "conditions" : null, "type" : "always" } ] } ``` ## Example Response Body ```nolang { "active" : true, "createdDate" : "2016-08-12T05:57:19Z", "deactivateOnTrigger" : false, "id" : "0AuR00000004CZTKA2", "lastModifiedDate" : "2016-08-12T05:57:19Z", "name" : "New Notification", "recordId" : "00OR0000000PD55MAG", "schedule" : { "details" : { "time" : 3 }, "frequency" : "daily" }, "source" : "lightningReportSubscribe", "thresholds" : [ { "actions" : [ { "configuration" : { "recipients" : [ ] }, "type" : "sendEmail" } ], "conditions" : null, "type" : "always" } ] } ``` # Create and Update a Template with Visual Studio Code Use Microsoft Visual Studio (VS) code to create and update a template. 1. Create the template. In the Command Palette, enter **Create Analytics Template**. Select the Analytics app from the dropdown list. The command returns something like the following: `Successfully created Analytics template [0Nk0S0000008OJNSA2]` The `WaveTemplate` object and all its files are on your scratch org. Next, retrieve the object by pulling the files to your local workstation for editing. # Create Deeper Dependencies with Nested Interactions With nested interactions, you can create deeper dependencies among widgets. **Example** For example, this pie chart shows the number of opportunities for each segment. It filters the results based on the selected grouping in the toggle widget and selected value from that grouping in the horizontal bar chart. ![The dashboard shows a toggle with static values: Owner, Country, and Industry. It also contains a bar chart that shows sum of amount, grouped by industry, and a donut chart that shows count of rows, grouped by segment.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboards_charts_nested_bindings.png) The pie chart can filter results based on the value of the selected grouping because it contains a nested interaction. **note:** This example shows a nested interaction using column groupings. For an example of grouping with cells, see [Data Selection Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-functions-wave-designer-data-selection.md). ```sql q = load \"Opportunities1\"; q = filter q by {{column(RevenueDynamicGrouping.selection, column(StaticGroupingNames.selection, [\\"value"])).asEquality( cell(StaticGroupingNames.selection, 0, "value")) }}; q = group q by 'Segment'; q = foreach q generate 'Segment' as 'Segment', count() as 'count'; q = order q by 'Segment' asc;\nq = limit q 200; ``` **note:** If you bind a measure or grouping in a query used for a chart, you must also replace the `columnMap` section in the widget-level chart JSON with an empty `columns` array. For more information, see [Measure Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-measure.md) and [Group Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-group.md). # Create Dependent Templates Follow these steps to create templates with dependencies. 1. Create supporting app template. Supporting apps’ dashboards, lenses, and datasets can be reused by other apps. 2. Add a line to your dependent app templates’ `template-info.json` file that refers to templates to include in the dependency: ```nolang "templateDependencies" : [{ "name" : "", "namespace" : "", "templateVersion" : "1.0", // optional condition in which to include this dependency. "condition" : "${Variables.dependOnAnotherTemplate}" }] ``` 3. In your templatized asset JSON files (`dashboard.json` and so on) based on the dependent template, use the supporting app’s assets in context with the following: ```nolang ${Apps....}: ``` Examples: ```nolang "${Apps.namespacedone__SupportingDashboard.Dashboards.Comparision_tp.Name}" "${Apps.namespacedone__SupportingDashboard.Datasets.MyDataset.Alias}" ``` 4. Load all templates into the same org. 5. Create apps from the supporting templates. 6. Create the app from the dependent template. The requirements for creating a dependent app are: - The supporting app templates must exist in the org, and the user creating the dependent app must have access to them. - At least one app from the supporting template at the right version and namespace must exist and have a Completed status. # Creating a Template from a Dependent App Apps with dependencies on assets on other apps can be templatized using the same template creation process as standalone templates. To create a template with dependencies on other apps, the supporting apps must be templatized first. If they aren’t, the template creation process returns an error that reminds you to create a template for the supporting app. Aside from that consideration, use the same steps to templatize an app that has dependencies as a template that has no dependencies. # CRM Analytics Apex Lens Use the `Lenses` class to retrieve a collection of CRM Analytics lens assets and to describe a single lens asset. The CRM Analytics `Wave.Lenses` class provides access from Apex to the CRM Analytics lens assets. ## Wave.Lenses collection methods `Map getLenses()` Retrieves a collection of lenses. `Map getLenses(String searchOptions)` Retrieves a collection of lenses using search options. ### Apex Class Example ```nolang public with sharing class LensController { public LensController() { } @AuraEnabled(cachable=true) public static Map getLenses() { // This has all fields available, plus filterGroup; all fields are optional/nullable Wave.LensesSearchOptions options = new Wave.LensesSearchOptions(); options.q = 'widget'; options.filterGroup = 'supplemental'; options.scope = 'CreatedByMe'; options.page = null; options.sortParam = 'Name'; // Pass null to get the default search options or leave it off completely to return // a collection with no search options Map lensesJson = Wave.Lenses.getLenses(options); // lensesJson is the JSON response as an Apex Map (from JSON.deserializedUntyped), which // you can pull fields from return lensesJson; } } ``` ### LWC Example ```nolang import {LightningElement, wire} from "lwc"; import getLenses from "@salesforce/apex/Wave.Lenses.getLenses"; export default class Lenses extends LightningElement { results; @wire(getLenses, { options: { // All are optional filterGroup = "Supplemental", sortParam = "Name" } }) // can also use these // @wire(getLenses, { options: {} }) // @wire(getLenses, {}) // @wire(getLenses) // @wire(getLenses, { options: {'$options'} }) // with a binding onLenses({data, error}) { if (error) { this.results = "Error:\n" + JSON.stringify(error, undefined, 2); } else if (data) { // data is the LensCollectionRepresentation JSON object this.results = "Lenses: " + data.lenses.map(l => `${l.name} {$l.id}`).join(", "); } else { this.results = "No data"; } } } ``` ## Wave.Lenses describe methods `Map getLens(String lensIdOrApiName)` Retrieves a lens by ID or the API name. `Map getLens(String lensIdOrApiName, String filterGroup)` Retrieves a lens by ID or the API name and a filterGroup parameter. ### Apex Class Example ```nolang public with sharing class LensController { public LensController() { } @AuraEnabled(cacheable=true) public static Map getLens(String idOrName) { Map lens = Wave.Lenses.getLens(idOrName); return lens; } } ``` ### LWC Example ```nolang import {LightningElement, wire} from "lwc"; import getLenses from "@salesforce/apex/Wave.Lenses.getLens"; export default class Lens extends LightningElement { lensIdOrApiName; // set this to the ID or name you want to retrieve results; @wire(getLens, { lensIdOrApiName: '$lensIdOrApiName' }) onLens({data, error}) { if (error) { this.results = "Error:\n" + JSON.stringify(error, undefined, 2); } else if (data) { // data is the LensRepresentation JSON object this.results = `Lens: ${data.name} ${data.id})`; } else { this.results = "No data"; } } } ``` For information on request parameters and the Lens JSON responses, see the [Analytics REST API Developer Guide: Lenses List Resource](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_resources_lenses.htm). # CRM Analytics Apex Query Query your data in CRM Analytics from any Apex class. Construct well-formed queries using the query builder. The Apex SDK query features include the `executeQuery` method and the `Wave.QueryBuilder` class. `ConnectApi.Wave.executeQuery` At its simplest, use the `executeQuery` function (exposed through the ConnectApi namespace) to pass a SAQL query from an Apex page to CRM Analytics, and get a response in the form of JSON. For example, this sample sends ‘your SAQL query’ to CRM Analytics. ```nolang String query = '[your SAQL query]'; ConnectApi.LiteralJson result = ConnectApi.Wave.executeQuery(query); String response = result.json; ``` Sending queries like this is useful, but relies on the developer coding well-formed SAQL queries. Wouldn’t it be great if a class constructed the queries for you? `Wave.QueryBuilder` The `Wave.QueryBuilder` class is the most convenient, preferred, and safest way to construct a SAQL query string for execution. It’s not an exhaustive implementation of all possible SAQL queries—so sometimes you must write your own—but it does cover the vast majority of use cases, including: - load dataset statement - foreach statement - group statement - order statement - limit statement - filter statement - functions such as min, max, count, avg, unique, as, sum Use `Wave.QueryBuilder` and its associated classes, `Wave.ProjectionNode` and `Wave.QueryNode`, to incrementally build your SAQL statement. For example: ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{ Wave.QueryBuilder.get('State').alias('State'), Wave.QueryBuilder.get('City').alias('City'), Wave.QueryBuilder.get('Revenue').avg().alias('avg_Revenue'), Wave.QueryBuilder.get('Revenue').sum().alias('sum_Revenue'), Wave.QueryBuilder.count().alias('count')}; ConnectApi.LiteralJson result = Wave.QueryBuilder.load('0FbD00000004DSzKAM', '0FcD00000004FEZKA2') .group(new String[]{'State', 'City'}) .foreach(projs) .execute('q'); String response = result.json; ``` # CRM Analytics Apex QueryBuilder Examples Build simple or complex SAQL queries using QueryBuilder. QueryBuilder is the core of the CRM Analytics Apex feature set, so let’s take a closer look. 1. Here’s a simple count query: ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.count().alias('c')}; String query = Wave.QueryBuilder.load('datasetId', 'datasetVersionId').group().foreach(projs).build('q'); ``` Output: ```nolang q = load "datasetId/datasetVersionId"; q = group q by all; q = foreach q generate count as c; ``` 2. Query selecting specific attributes and using aliases. ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.get('Name'), Wave.QueryBuilder.get('AnnualRevenue').alias('Revenue')}; String query = Wave.QueryBuilder.load('datasetId','datasetVersionId').foreach(projs).build('q'); ``` Output: ```nolang q = load "datasetId/datasetVersionId"; q = foreach q generate Name,AnnualRevenue as Revenue; ``` 3. Query using a filter condition. ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.get('Name'), Wave.QueryBuilder.get('AnnualRevenue').alias('Revenue')}; String query = Wave.QueryBuilder.load('datasetId','datasetVersionId').foreach(projs).filter('Name != \'My Name\'').build('q'); ``` Output: ```nolang q = load "datasetId/datasetVersionId"; q = foreach q generate Name,AnnualRevenue as Revenue; q = filter q by Name != 'My Name'; ``` 4. Query with a limit statement. ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.get('Name'), Wave.QueryBuilder.get('AnnualRevenue').alias('Revenue')}; String query = Wave.QueryBuilder.load('datasetId','datasetVersionId').foreach(projs).cap(10).build('q'); ``` Output: ```nolang q = load "datasetId/datasetVersionId"; q = foreach q generate Name,AnnualRevenue as Revenue; q = limit q 10; ``` 5. Query with an order statement. ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.get('Name'), Wave.QueryBuilder.get('AnnualRevenue').alias('Revenue')}; List> orders = new List>{new List{'Name', 'asc'}, new List{'Revenue', 'desc'}}; String query = Wave.QueryBuilder.load('datasetId','datasetVersionId').foreach(projs).order(orders).cap(10).build('q'); ``` Output: ```nolang q = load "datasetId/datasetVersionId"; q = foreach q generate Name,AnnualRevenue as Revenue; q = order q by (Name asc, Revenue desc); q = limit q 10; ``` 6. Query with a union statement. ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.get('Name'), Wave.QueryBuilder.get('AnnualRevenue').alias('Revenue')}; Wave.QueryNode nodeOne = Wave.QueryBuilder.load('dataseOne','datasetVersionOne').foreach(projs); Wave.QueryNode nodeTwo = Wave.QueryBuilder.load('datasetTwo', 'datasetVersionTwo').foreach(projs); String query = Wave.QueryBuilder.union(new List{nodeOne, nodeTwo}).build('q'); ``` Output: ```nolang qa = load "datasetOne/datasetVersionOne"; qa = foreach q generate Name,AnnualRevenue as Revenue; qb = load "datasetTwo/datasetVersionTwo"; qb = foreach q generate Name,AnnualRevenue as Revenue; q = union qa, qb; ``` 7. Executing the query to get the result set via Query Builder. ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.count().alias('c')}; ConnectApi.LiteralJson result = Wave.QueryBuilder.load('datasetId', 'datasetVersionId').group().foreach(projs).execute('q'); ``` 8. Example of grouping by a specific dataset attribute. ```nolang Wave.ProjectionNode[] projs = new Wave.ProjectionNode[]{Wave.QueryBuilder.get('Name'), Wave.QueryBuilder.get('Revenue').sum().alias('REVENUE_SUM')}; ConnectApi.LiteralJson result = Wave.QueryBuilder.load('datasetId', 'datasetVersionId').group(new String[]{'Name'}).foreach(projs).build('q'); ``` Output: ```nolang q = load "datasetId/datasetVersionId"; q = group q by (Name); q = foreach q generate Name,sum(Revenue) as REVENUE_SUM; ``` # CRM Analytics Apex Templates Use the `Templates` class to retrieve a collection of CRM Analytics templates, describe a single template and template configuration. The CRM Analytics `Wave.Templates` class provides access from Apex to CRM Analytics templates. The methods are annotated with `@AuraEnabled` for use in Lightning Web Components (LWC). ## Wave.Templates collection methods `Map getTemplates()` Retrieves a collection of templates. `Map getTemplates(Wave.TemplatesSearchOptions searchOptions)` Retrieves a collection of templates using search options. ### Apex Class Example ```apex public with sharing class TemplatesController { public TemplatesController() { } @AuraEnabled(cachable=true) public static List getTemplateNames() { // This has filterGroup, type, and options; all fields are optional/nullable Wave.TemplatesSearchOptions options = new Wave.TemplatesSearchOptions(); options.type = 'app'; options.filterGroup = 'small'; options.options = 'ViewOnly'; // Pass null to get the default search options or leave it off completely to return // a collection with no search options Map templates = Wave.Templates.getTemplates(options); // templates is the JSON response as an Apex Map (from JSON.deserializedUntyped), which // you can pull fields from List templateList = (List) templates.get('templates'); List names = new List(); for (Object templateObj : templateList) { names.add((String) ((Map) templateObj).get('name')); } return names; } } ``` ### LWC Example ```nolang import {LightningElement, wire} from "lwc"; import getTemplates from "@salesforce/apex/Wave.Templates.getTemplates"; export default class Templates extends LightningElement { results; @wire(getTemplates, { options: { // All are optional type = 'app' } }) // can also use these // @wire(getTemplates, { options: {} }) // @wire(getTemplates, {}) // @wire(getTemplates) // @wire(getTemplates, { options: {'$options'} }) // with a binding onTemplates({ data, error }) { if (error) { this.results = "Error:\n" + JSON.stringify(error, undefined, 2); } else if (data) { // data is the TemplateCollectionRepresentation JSON object this.results = 'Template names: ' + data.templates.map(l => ${l.name}).join(', '); } else { this.results = "No data"; } } } ``` ## Wave.Templates describe methods `Map getTemplate(String templateIdOrApiName)` Retrieves a template by ID or the API name. `Map getTemplateConfig(String templateIdOrApiName)` Retrieves a template configuration by ID or the API name. ### Apex Class Example ```nolang public with sharing class TemplateController { public TemplateController() { } @AuraEnabled(cacheable=true) public static Map getTemplate(String idOrName) { Map template = Wave.Templates.getTemplate(idOrName); return template; } } ``` ### LWC Example ```nolang import {LightningElement, wire} from "lwc"; import getTemplate from "@salesforce/apex/Wave.Templates.getTemplate"; export default class Lens extends LightningElement { templateIdOrApiName; // set this to the ID or name you want to retrieve results; @wire(getTemplate, { templateIdOrApiName: '$templateIdOrApiName' }) onTemplate({data, error}) { if (error) { this.results = "Error:\n" + JSON.stringify(error, undefined, 2); } else if (data) { // data is the TemplateRepresentation JSON object this.results = 'Template: ${data.name} ${data.id}'; } else { this.results = "No data"; } } } ``` For information on request parameters and the Template JSON responses, see the [Analytics REST API Developer Guide: Templates List Resource](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_resources_templates.htm). To see the full reference for the Templates Apex class, see the [Apex Reference Guide: wave Namespace](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_wave.htm). # CRM Analytics Assets SDK Aura Component Discover CRM Analytics dashboards, lenses and datasets, get their details, and dig into dataset fields. Discover dashboard saved views and explore dashboard state. Create and execute queries directly on datasets ## Call the SDK To call the SDK, declare the `wave:sdk` component in your component or app. `` Use `sdk.invokeMethod` to specify the method and any parameters. `sdk.invokeMethod(context, methodName, methodParameters, callback)` For example, here’s a call that uses `listDashboards` as _methodName_. ```apex var context = {}; var methodName = 'listDashboards'; var methodParameters = { 'pageSize' : 200, 'sort' : 'Name' }; sdk.invokeMethod(context, methodName, methodParameters, $A.getCallback(function (err, data) { if (err !== null) { //DO THIS IF THE METHOD FAILS console.error("SDK error", err); } else { //DO THIS IF THE METHOD SUCCEEDS component.set('v.dashboards', data.dashboards); } })) ``` See the [wave:sdk Component Reference](https://developer.salesforce.com/docs/component-library/bundle/wave:sdk/example) for a full working example. Each method has its own set of parameters (_methodParameters_). ## Methods and Parameters ### listDashboards Retrieves a list of all dashboards. Can be filtered by specifying parameters | Parameter Name | Description | Required | Type | | ----------------- | ----------------------------------------------------------------------------------------------------- | -------- | -------------------------------------- | | `folderId` | Filters the results to include only the contents of a specific folder. | FALSE | String, base platform object ID format | | `page` | A generated token that indicates the view of the dashboards to be returned | FALSE | String | | `pageSize` | Number of items to be returned in a single page. Default is 25 and maximum is 200. | FALSE | Integer | | `q` | Search terms. Individual terms are separated by spaces. Wild cards aren’t supported. | FALSE | String | | `sort` | Sort order of the results. Enum values are `LastModified`, `MRU`, and `Name`. Default value is `MRU`. | FALSE | String | | `scope` | Type of scope to be applied to the returned items (`CreatedByMe` or `SharedWithMe`) | FALSE | String | | `type` | Asset type | FALSE | String | | `templateApiName` | Filter collection by `templateApiName`. | FALSE | String | | `mobileOnly` | For mobile dashboards only. | FALSE | String | ### listLenses Retrieves a list of all lenses. Can be filtered by specifying parameters | Parameter Name | Description | Required | Type | | -------------- | ----------------------------------------------------------------------------------------------------- | -------- | -------------------------------------- | | `folderId` | Filters the results to include only the contents of a specific folder. | FALSE | String, base platform object ID format | | `page` | A generated token that indicates the view of the lenses to be returned | FALSE | String | | `pageSize` | Number of items to be returned in a single page. Default is 25 and maximum is 200. | FALSE | Integer | | `q` | Search terms. Individual terms are separated by spaces. Wild cards aren’t supported. | FALSE | String | | `sort` | Sort order of the results. Enum values are `LastModified`, `MRU`, and `Name`. Default value is `MRU`. | FALSE | String | | `scope` | Type of scope to be applied to the returned items (`CreatedByMe` or `SharedWithMe`) | FALSE | String | ### listDatasets Retrieves a list of all datasets. Can be filtered by specifying parameters | Parameter Name | Description | Required | Type | | ---------------- | ---------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------- | | `folderId` | Filters the results to include only the contents of a specific folder. | FALSE | String, base platform object ID format | | `hasCurrentOnly` | Filters the list of datasets to include only those datasets that have a current version. The default is `false`. | FALSE | String, base platform object ID format | | `page` | A generated token that indicates the view of the dashboards to be returned | FALSE | String | | `pageSize` | Number of items to be returned in a single page. Default is 25 and maximum is 200. | FALSE | Integer | | `q` | Search terms. Individual terms are separated by spaces. Wild cards aren’t supported. | FALSE | String | | `sort` | Sort order of the results. Enum values are `LastModified`, `MRU`, and `Name`. Default value is `MRU`. | FALSE | String | | `scope` | Type of scope to be applied to the returned items (`CreatedByMe` or `SharedWithMe`) | FALSE | String | ### describeDashboard Retrieves the details of a single dashboard. | Parameter Name | Description | Required | Type | | -------------- | ----------------------------------- | -------- | -------------------------------------- | | `dashboardId` | 15 or 18-digit id of the dashboard. | TRUE | String, base platform object ID format | ### describeLens Retrieves the details of a single lens. | Parameter Name | Description | Required | Type | | -------------- | ------------------------------ | -------- | -------------------------------------- | | lensId | 15 or 18-digit id of the lens. | TRUE | String, base platform object ID format | ### describeDataset Retrieves the details of a single dataset. | Parameter Name | Description | Required | Type | | -------------- | --------------------------------- | -------- | -------------------------------------- | | datasetId | 15 or 18-digit id of the dataset. | TRUE | String, base platform object ID format | ### getDatasetFields Retrieves a list of all the fields for a single dataset. | Parameter Name | Description | Required | Type | | -------------- | ----------------------------------------- | -------- | -------------------------------------- | | `datasetId` | 15 or 18-digit id of the dataset. | TRUE | String, base platform object ID format | | `versionId` | 15 or 18-digit version id of the dataset. | TRUE | String, base platform object ID format | ### executeQuery Executes a CRM Analytics SAQL query. | Parameter Name | Description | Required | Type | | -------------- | ------------------------------------------ | -------- | -------------------------------------- | | `query` | The SAQL query to execute, in JSON format. | TRUE | String, base platform object ID format | ### listDashboardSavedViews Retrieves a list of all saved views for a dashboard. | Parameter Name | Description | Required | Type | | ---------------------- | ------------------------------------------------------------------- | -------- | -------------------------------------- | | `dashboardIdOrApiName` | The 15 or 18-digit id or the fully qualified name of the dashboard. | TRUE | String, base platform object ID format | ### getDashboardSavedView Retrieves the detail of one dashboard saved view. | Parameter Name | Description | Required | Type | | ---------------------- | ------------------------------------------------------------------- | -------- | -------------------------------------- | | `dashboardIdOrApiName` | The 15 or 18-digit id or the fully qualified name of the dashboard. | TRUE | String, base platform object ID format | | `viewId` | The 15 or 18-digit id of the saved view. | TRUE | String, base platform object ID format | ### getDashboardInitialSavedView Retrieves the initial view information for a dashboard saved view. | Parameter Name | Description | Required | Type | | ---------------------- | ------------------------------------------------------------------- | -------- | -------------------------------------- | | `dashboardIdOrApiName` | The 15 or 18-digit id or the fully qualified name of the dashboard. | TRUE | String, base platform object ID format | | `viewId` | The 15 or 18-digit id of the initial saved view. | TRUE | String, base platform object ID format | # CRM Analytics Aura Events Easily interact with the embedded CRM Analytics Dashboard component in custom applications. Use Aura Events for Lightning Apps, Visualforce, or your preferred development environment. ## CRM Analytics Aura Events `wave:assetLoaded` A CRM Analytics asset fires this event when the asset is finished loading. The payload contains the asset type and the asset id. For a CRM Analytics dashboard asset, the event is fired: on the initial load of a dashboard, when a user resets to dashboard to the initial view, and when the user selects a dashboard view. After this event is received, you can safely reapply mandatory filters or resync the dashboard state. `wave:update` Use this event to dynamically set the filter on a CRM Analytics dashboard or interact with the dashboard by dynamically changing the selection. It has four attributes: the unique ID of the CRM Analytics asset on which to apply the filter, the payload, the asset type (currently only dashboard), and the fully qualified developer name of the CRM Analytics dashboard. The payload is a JSON string that identifies the datasets and any dimensions and field values. `wave:selectionChanged` A CRM Analytics dashboard fires this event for consumption by custom Aura components. It provides the following attributes: the ID of the dashboard that fired the event and the payload. The payload object contains the selection information—the name of the step involved when changing the selection and an array of objects representing the current selection. Each object in the array contains one or more attributes based on the selection. `wave:discover` This event sends a global request to identify CRM Analytics dashboard assets. The response is a `wave:discoverResponse` event. You can include your own parameter in this event that is included in the response payload. `wave:discoverResponse` This event is fired by listening to CRM Analytics dashboard assets in response to the `wave:discover` event. The payload includes the dashboard identifier, the type of component, the dashboard title, whether the dashboard is still loading, and any optional parameter sent with the request. `wave:pageChange` Use this event to update the CRM Analytics dashboard page that is displayed. It has two attributes: the unique ID of the page to display and the fully qualified developer name of the CRM Analytics dashboard - **[CRM Analytics Aura Events - Update Event](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-web-example1.md)** Create a custom component to dynamically set filters in a CRM Analytics dashboard embedded in a Lightning page. - **[CRM Analytics Aura Events - SelectionChanged Event](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-web-example2.md)** React to selections in your dashboard and get the row data for the selection. - **[CRM Analytics Aura Events - Discover Event](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-web-example-discoverdashboard.md)** This event sends a request to CRM Analytics dashboards to identify their assets. - **[CRM Analytics Aura Events - Discover Response Event](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-web-example-discoverresponse.md)** This event provides the response following a request for CRM Analytics dashboards to identify their assets. - **[CRM Analytics Aura Events - Page Change Event](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-web-example-pagechange.md)** This event sends a request to CRM Analytics dashboards to change the displayed page. - **[CRM Analytics Aura Events - Asset Loaded Event](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-web-example-assetloaded.md)** React to the CRM Analytics asset rendering completion event. # CRM Analytics Aura Events - Asset Loaded Event React to the CRM Analytics asset rendering completion event. ## Example - Reacting to Dashboard Rendering Completion with the Asset Loaded Event For this example, the CRM Analytics asset used is a dashboard. The dashboard component generates a Lightning event when it has fully loaded and rendered its state (widgets, steps, and queries). This event is sent: on the initial load of a dashboard, when a user resets to dashboard to the initial view, and when the user selects a dashboard view. The payload for this completion event is the asset type and asset id. This example shows how to receive the payload and display the results. This event works with embedded dashboard components. Embed your CRM Analytics dashboard in a Lightning page (see the [Embed CRM Analytics Dashboards in Lightning Pages](https://help.salesforce.com/articleView?id=bi_embed_lightning.htm) help topic for more information). Be sure to save and activate your page. Using the Developer Console, create an Aura component named assetLoaded. Copy the following markup into the component. ```nolang
``` Add a Controller (assetLoaded.js) to the bundle and copy the following JavaScript into it: ```nolang ({ handleAssetLoaded: function(component, event, helper){ component.set("v.dashboardStatus", "Dashboard is loaded"); component.set("v.assetType", event.getParam("type")); component.set("v.assetId", event.getParam("id")); } }) ``` This example listens for any asset to be loaded and then displays the type and id of the asset. For greater functionality, combine this code with the `wave:selectionChanged` event example code to build a component that listens for asset loaded events and informs the user of the dashboard status so the user knows when to safely make updates to the dashboard. You can now use your custom component to interact with a CRM Analytics dashboard component. In the Lightning App Builder, add your custom component to the Lightning Page with your embedded dashboard. That's it. Save and view the page to see the `wave:assetLoaded` event in action. ## Resources For more information about Aura events and other Lightning development features, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_framework.htm). # CRM Analytics Aura Events - Discover Event This event sends a request to CRM Analytics dashboards to identify their assets. ## Example - Setting Up Your Request and Receiving a Response The _wave:discover_ event sends a global request to listening CRM Analytics dashboard assets to respond with their identifying information (via the _wave:discoverResponse_ event). You can include your own parameter in the response. The _wave:discover_ and _wave:discoverResponse_ events work hand-in-hand. They’re particularly useful for discovering when a dashboard is being added dynamically to the page, or whether the page has multiple dashboards. Using the Developer Console, create an Aura component and copy the following markup into the component. The markup sets up the handlers for the events, and adds buttons for adding a dashboard and for discovering dashboards. ```nolang {!v.body} ``` Add a controller to the bundle, then copy the following JavaScript into it. This code shows how to fire the _discover_ event, and how to use the result when the _discoverResponse_ event is fired. The code also shows how to create dashboard components. ```nolang ({ addDashboard: function(component, event, helper) { var selectCmp = component.find("idTextBox"); var config = { "developerName": selectCmp.get("v.value"), "showHeader": false, "height": 400 }; $A.createComponent("wave:waveDashboard", config, function(dashboard, status, err) { if (status === "SUCCESS") { dashboard.set("v.rendered", true); dashboard.set("v.showHeader", false); component.set("v.body", dashboard); } else if (status === "INCOMPLETE") { console.log("No response from server or client is offline.") } else if (status === "ERROR") { console.log("Error: " + err); } } ); }, discoverDashboard: function(component, event, helper) { $A.get("e.wave:discover").fire(); }, handleDiscoverResponse: function(cmp, event, helper) { var myText = cmp.find("outName"); myText.set("v.value", event.getParam("developerName")); }, }) ``` That's it! You can use these events to get some context about available dashboard components, and then interact with them via the _Update_ and _selectionChanged_ events. ## Resources For more information about Aura events and other Lightning development features, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_framework.htm). # CRM Analytics Aura Events - Discover Response Event This event provides the response following a request for CRM Analytics dashboards to identify their assets. ## Example - Setting Up Your Request and Receiving a Response Refer to the [_wave:discover_](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-web-example-discoverdashboard.md#wave-discover) event for details and an example using _wave:discoverResponse_. ## Resources For more information about Aura events and other Lightning development features, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_framework.htm). # CRM Analytics Aura Events - Page Change Event This event sends a request to CRM Analytics dashboards to change the displayed page. ## Example - Updating the Displayed Dashboard Page The _wave:pageChange_ event sends a global request to a listening CRM Analytics dashboard to update the page that is displayed. This event works with embedded dashboard components. Embed your CRM Analytics dashboard in a Lightning page (see the [Embed CRM Analytics Dashboards in Lightning Pages](https://help.salesforce.com/articleView?id=bi_embed_lightning.htm) help topic for more information). Be sure to save and activate your page. The CRM Analytics Aura events allow CRM Analytics to interact with the UI container. In this example, we create a custom component to interact with the embedded CRM Analytics dashboard, so you need some familiarity with the Developer Console. See the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_create_devconsole.htm) for more information. Using the Developer Console, create an Aura component and copy the following markup into the component. The markup sets up the handler for the event, input fields for the event parameters, and adds a button for firing the _pageChange_ event. ```nolang
``` Replace the `XXXXXXXXXXX` with the fully qualified developer name of your dashboard. To find the name, use cURL or Postman to execute the REST API call `/services/data/v47.0/wave/dashboards`. The developer name is required and it must be the fully qualified name - `__`. Add a controller to the bundle, then copy the following JavaScript into it. This code shows how to fire the _pageChange_ event. ```nolang ({ handleSendPageChange : function(component, event, helper) { var pageId = component.get(’v.pageId’); var developerName = component.get(’v.developerName’); var evt = $A.get(’e.wave:pageChange’)’ var params = { devName: developerName, pageid: pageId }; evt.setParams(params); evt.fire(); } }) ``` That's it. You can use your custom component to interact with a CRM Analytics dashboard. Add your custom component to the Lightning Page with your embedded dashboard. Make sure that the _pageId_ matches that of a _pageId_ in the dashboard you embedded. Change the dashboard pages by clicking the “Fire” button and watch the dashboard update. ## Resources For more information about Aura events and other Lightning development features, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_framework.htm). # CRM Analytics Aura Events - SelectionChanged Event React to selections in your dashboard and get the row data for the selection. ## Example - Reacting to a Selection with the selectionChanged Event The dashboard component also generates Lightning events when the user changes a selection. The payload for these events is effectively the row data for the current selection. Datasets can be from many sources, so the actual payload may only be meaningful when the user has knowledge of the datasets being used. This example shows how to receive and iterate through the payload, which is an array of objects representing the current selection. This example uses the same dashboard used for the update event example, so be sure to follow those steps first. Using the Developer Console, create an Aura component named recordView. Copy the following markup into the component. ```nolang
{!v.msg}
``` Add a Controller (recordViewController.js) to the bundle and copy the following JavaScript into it: ```nolang ({ handleSelectionChanged: function(component, event, helper) { var params = event.getParams(); var payload = params.payload; if (payload) { var step = payload.step; var data = payload.data; data.forEach(function(obj) { for (var k in obj) { if (k === 'Id') { component.set("v.recordId", obj[k]); } } }); } } }) ``` This example references recordId, an Opportunity record identifier. If you don’t use this in your dashboard, substitute a different field. Payload data can contain other objects, each in turn containing key-value pairs. For example, aside from the Id, you can also get the noun (for example, "dashboard") and the verb (for example, "selection"). Add a Style (recordView.css) to the bundle and copy the following CSS into it: ```nolang .THIS.container { min-height: 650px; min-width: 200px; height: 100%; width: 100%; border: 1px solid #A0A0A0; margin: 5px auto; } .THIS .msg { vertical-align: middle; text-align: center; margin: 2em auto; } ``` For a better experience in Lightning App Builder, add a Design (recordView.design) to the bundle and paste in the following: ```nolang ``` The page you created using Lightning App Builder should now show the Record View component in the palette. Drag this component onto the page, then save the page. Go back to Lightning Experience, and make a selection in your CRM Analytics Dashboard component. The corresponding Salesforce Opportunity record (or the record type you specified in recordViewController.js) will be displayed in the newly added component. ## Resources For more information about Aura events and other Lightning development features, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_framework.htm). # CRM Analytics Aura Events - Update Event Create a custom component to dynamically set filters in a CRM Analytics dashboard embedded in a Lightning page. ## Example - Setting a Filter with the Update Event This event works with embedded dashboard components. Embed your CRM Analytics dashboard in a Lightning page (see the [Embed CRM Analytics Dashboards in Lightning Pages](https://help.salesforce.com/articleView?id=bi_embed_lightning.htm) help topic for more information). Be sure to save and activate your page. The CRM Analytics Aura events allow CRM Analytics to interact with the UI container. In this example, we create a custom component to interact with the embedded CRM Analytics dashboard, so you need some familiarity with the Developer Console. See the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_create_devconsole.htm) for more information. In the Developer Console, create an Aura Component named filterTest, and copy the following into the component markup definition (`filterTest.cmp`): ```nolang
``` Replace the `XXXXXXXXXXX` with the fully qualified developer name of your dashboard. To find the name, use uCRL or Postman to execute the API call `/services/data/v47.0/wave/dashboards`. The developer name is required and it must be the fully qualified name - `__`. For most filters, you need the fully qualified name of the dataset the dashboard is using. To find the name, log in to [Workbench](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/quickstart_using_workbench.htm), click **Utilities** | **REST Explorer**. In the text box, type `/services/data/v47.0/wave/datasets` and then click **Execute**. Add a controller (`filterTestController.js`) to the bundle, then copy the following JavaScript into it. This example JavaScript shows how to construct the payload for the update event—in this case, setting StageName to Closed Won for the dataset used by the dashboard. Replace these names with valid names from your dashboard and dataset, for the filter you wish to set. For more information about creating the filter, see [Filter and Selection Syntax for Embedded Dashboards](https://help.salesforce.com/articleView?id=bi_embed_filters.htm). ```nolang ({ doInit: function(component, event, helper) { component.set('v.filter', '{"datasets" : "__": [{"fields": ["StageName"], "selection": ["Closed Won"]}]}}'); }, handleSendFilter: function(component, event, helper) { var filter = component.get('v.filter'); var developerName = component.get('v.developerName'); var evt = $A.get('e.wave:update'); evt.setParams({ value: filter, devName: developerName, type: "dashboard" }); evt.fire(); } }) ``` Add a Style (`filterTest.css`) to the bundle and copy the following CSS into it. ```nolang .THIS.container { border: 1px solid #A0A0A0; padding: 5px; width: 100%; margin: 5px auto; background: white; } .THIS .uiInputText { display: inline-block; margin-right: 5px; } ``` Finally, add a design (`filterTest.design`) to the bundle and copy the following into it. ```nolang ``` That's it. You can use your custom component to interact with CRM Analytics. Add your custom component to the Lightning Page with your embedded dashboard. Make sure that the developer name in the filter matches that of the dataset in the dashboard you embedded. Applying your filter by clicking the “Fire” button causes the dashboard to be updated. ## Resources For more information about Aura events and other Lightning development features, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_framework.htm). # CRM Analytics Configuration Now that the Lightning Web Component code is ready to go, it’s time to bring the component into a CRM Analytics dashboard. ## Basic Configuration After pushing your code into a Salesforce org, go to the CRM Analytics dashboard designer and create a blank dashboard. 1. To create a dashboard component, drop a component widget (![Component widget icon](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_dashboard_component_widget.png)) onto a dashboard. 2. Select the **Lightning Components** tab. **note:** If you don’t see this tab, you must enable this feature. For enablement information, see the [Setup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-setup.md) page. 3. Choose the Hello World Lightning Web Component that you created from the list. 4. To see the _title_ attribute, expand the Component Attributes on the right-hand side. Type your name in the box, and then watch your code in action. ![The Component Attributes in the Component properties menu](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_hw_example_title.png) **note:** You can use **Preview** to run the dashboard, but many attributes update during design time, for faster testing. ## Advanced Configuration - SOQL Query Let’s make your component dynamic by adding some user attributes. You can use SOQL with a filter by the current user token to grab any field from your user object. For this example, use the `First.Name` field. 1. On your dashboard, click **Edit**. 2. In the dashboard editor, click a blank space. 3. At the top-right, click the **Create Query** button. 4. Select the **Salesforce Object** tab. 5. Select the **User** object. 6. To edit the SOQL, click ![SAQL Mode button](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_saql_mode_button.png). 7. Paste this SOQL into the editor: ```soql SELECT FirstName, COUNT(Id) FROM User WHERE Id= '!{User.Id}' GROUP BY FirstName ORDER BY FirstName ASC LIMIT 1 ``` 8. Name the query and click **Done**.import chartjsPluginSubtitle from '@salesforce/resourceUrl/chartJsPluginSubtitle'; Now you have a query that returns one row containing the current user’s first name. Use the interactions UI to wire it into your step. 1. To bring up the query panel to the right, click a blank space on the dashboard. 2. Find your new SOQL query, and then from its dropdown menu, select **Properties**. 3. Click **Advanced Editor**. 4. Under **Source Query**, select your query. 5. For **Source Data**, choose `cell`, `0`, and `FirstName`. 6. For **Interaction Type**, keep `Result`. 7. Optionally, add a default value in case no results are found. This example uses `You`. 8. Copy the interaction. 9. Save your work. 10. Click on your component and then click **Advanced Editor** in the Widget menu. 11. In the editor, paste the interaction as the _title_ value and click **Save**. ![Using the Advanced Editor to create an interactive SOQL query for your LWC.](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_hw_example_soql.png) Next. Try it out. You have a dynamic value automatically set by the current user viewing your content. If it’s not working, preview your results from the query panel to verify the data is coming back correct. To debug for typos, use the Advanced Editor, or `cmd+e/CTRL+e` to view the dashboard JSON. ## Advanced End-User Configuration - Static Step UI Using bindings, you can create any dynamic value from existing queries and selections. Let’s make a set of discrete values that an end user can select that drives an attribute in your LWC code. 1. Drag a toggle widget onto the dashboard page. 2. To configure the widget, click the **Toggle** button. 3. At the bottom of the configuration menu, choose **Create Custom Query**. 4. Under the **Display** column, add a few options. This example uses the many names of Salesforce Analytics: ![Creating a custom static query for your LWC.](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_hw_example_static_names.png) 5. Click **Done**. 6. To show the **Properties** panel on the right, click your LWC Component. 7. Click **Advanced Editor**. 8. To create an interaction, choose the static query you created. 9. For **Source Data**, select `cell`, `0`, and `Display`. 10. Choose a selection binding. 11. Optionally, add a default value in case no results are found. This example uses whoever the user is. 12. Copy and paste the interaction as the _title_ value. 13. Save your changes. ![Using the Advanced Editor to create an interactive static query for your LWC.](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_hw_example_static.png) **note:** Instead of setting a default value, you can go into the query properties and set the selection mode to `SingleRequired`. This setting ensures there’s always a selection for the query. And there you have it. Preview your dashboard to try it out. Select a name from the toggle and then watch your Lightning Web Component say “Hello” to that name. ![Your LWC with a static query in a CRM Analytics dashboard.](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_hw_example_full.png) Now that you have an understanding of attributes and configuration, feel free to add more to your widget. You can add style and CSS options to your component and expose them as attributes, such as _Text Size_, _Text Color_, or _Background Color_. **See Also** - [Component Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-attributes.md) - [Lightning Dashboards Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-lightning-dashboard-config.md) - [Query Data](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-query-data.md) - [Other Widgets](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-other.md) # CRM Analytics Dashboard JSON Example The JSON for each CRM Analytics dashboard contains multiple levels of properties. Review the sample JSON provided in this section to learn about the basic JSON structure of a dashboard. The sample JSON defines this dashboard. ![Sample dashboard created in dashboard designer.](https://developer.salesforce.com/docs/media/bi_dev_guide_json/bi_dashboard_wave_designer_dashboard_sample.png) The Account Analysis dashboard consists of the following objects. - Layouts: - Default, which has pages: - Page 1 - Page 2 - Mobile - Widgets: - Values table `table_1` based on step `lens_1` (Not shown in the screenshot because it exists only on Page 2.) - Global filter panel `filterpanel_1` - Link `link_1` - Horizontal Bar Chart `chart_1` based on step `Amount_by_Acct_Owner_1` - Steps: - `Amount_by_Acct_Owner_1` - `Account_Owner_Name_1` - `lens_1` - Dataset `0FbB000000017QxKAI` ```nolang { "label": "Account Analysis", "mobileDisabled": false, "state": { "dataSourceLinks": [], "filters": [ { "dataset": { "id": "0FbB000000017QxKAI", "name": "opportunity", "url": "/services/data/v41.0/wave/datasets/0FbB000000017QxKAI" }, "fields": [ "Account.Owner.Name" ], "label": "Account.Owner.Name", "locked": false, "operator": "in", "value": [ "Annie Kelly", "Bill Johnson", "Chan Lao", "Ellen Bruxton", "Erin Baker", "Frank Tom", "Jason Hunt", "Jennifer McCarthy", "Leslie Pham", "Michelle Nguyen", "Nathan Sinha", "Norman Truman", "Priya Anand", "Rob Wilkens", "Sam Gunderson", "Valerie Thom", "Walker Chan", "Wang Lee" ] }, { "dataset": { "id": "0FbB000000017QxKAI", "name": "opportunity", "url": "/services/data/v41.0/wave/datasets/0FbB000000017QxKAI" }, "fields": [ "Close Date" ], "label": "Close Date", "locked": false, "operator": ">=<=", "value": [ [ 1451635200000, 1564642800000 ] ] } ], "gridLayouts": [ { "name": "Default", "numColumns": 9, "pages": [ { "label": "Page 1", "name": "41f040d6-48a6-4dc7-9166-eb985df7e9d8", "widgets": [ { "colspan": 9, "column": 0, "name": "filterpanel_1", "row": 0, "rowspan": 3, "widgetStyle": { "borderEdges": [] } }, { "colspan": 9, "column": 0, "name": "chart_1", "row": 3, "rowspan": 5, "widgetStyle": { "borderEdges": [] } }, { "colspan": 2, "column": 0, "name": "link_1", "row": 8, "rowspan": 1, "widgetStyle": { "borderEdges": [] } } ] }, { "label": "Page 2", "name": "ac750443-1729-47fb-8d60-a35703076bf7", "widgets": [ { "colspan": 9, "column": 0, "name": "filterpanel_1", "row": 0, "rowspan": 3, "widgetStyle": { "borderEdges": [] } }, { "colspan": 9, "column": 0, "name": "table_1", "row": 3, "rowspan": 7, "widgetStyle": { "borderEdges": [] } } ] } ], "rowHeight": "normal", "selectors": [], "style": { "alignmentX": "left", "alignmentY": "top", "backgroundColor": "#44A2F5", "cellSpacingX": 4, "cellSpacingY": 4, "fit": "original", "gutterColor": "#A3B8CC" }, "version": 1 }, { "name": "Mobile", "numColumns": 2, "pages": [ { "label": "Page 1", "name": "41f040d6-48a6-4dc7-9166-eb985df7e9d8", "widgets": [ { "colspan": 2, "column": 0, "name": "filterpanel_1", "row": 0, "rowspan": 2, "widgetStyle": { "borderEdges": [] } }, { "colspan": 2, "column": 0, "name": "chart_1", "row": 2, "rowspan": 10, "widgetStyle": { "borderEdges": [] } } ] } ], "rowHeight": "normal", "selectors": [ "maxWidth(599)" ], "style": { "alignmentX": "left", "alignmentY": "top", "backgroundColor": "#2EC2BA", "cellSpacingX": 4, "cellSpacingY": 4, "fit": "original", "gutterColor": "#091A3E" }, "version": 1 } ], "layouts": [], "steps": { "Amount_by_Acct_Owner_1": { "broadcastFacet": true, "datasets": [ { "id": "0FbB000000017QxKAI", "label": "Opportunities", "name": "opportunity", "url": "/services/data/v41.0/wave/datasets/0FbB000000017QxKAI" } ], "isGlobal": false, "label": "Amount by Acct Owner", "query": { "measures": [ [ "count", "*" ] ], "groups": [ "Account.Owner.Name" ], "order": [ [ "count", { "ascending": false } ] ] }, "receiveFacet": true, "selectMode": "multi", "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "options": {}, "parameters": { "autoFitMode": "none", "showValues": true, "bins": { "breakpoints": { "high": 100, "low": 0 }, "bands": { "high": { "color": "#008000", "label": "" }, "low": { "color": "#B22222", "label": "" }, "medium": { "color": "#ffa500", "label": "" } } }, "legend": { "showHeader": true, "show": true, "customSize": "auto", "position": "right-top", "inside": false }, "axisMode": "multi", "tooltip": { "showBinLabel": true, "measures": "", "showPercentage": false, "showDimensions": true, "showMeasures": true, "customizeTooltip": false, "dimensions": "" }, "visualizationType": "hbar", "title": { "fontSize": 14, "subtitleFontSize": 11, "label": "", "align": "center", "subtitleLabel": "" }, "binValues": false, "trellis": { "flipLabels": false, "showGridLines": true, "size": [ 100, 100 ], "enable": false, "type": "x", "chartsPerLine": 4 }, "measureAxis2": { "sqrtScale": false, "showTitle": true, "showAxis": true, "title": "", "customDomain": { "showDomain": false } }, "measureAxis1": { "sqrtScale": false, "showTitle": true, "showAxis": true, "title": "", "customDomain": { "showDomain": false } }, "theme": "wave", "dimensionAxis": { "showTitle": true, "customSize": "auto", "showAxis": true, "title": "", "icons": { "useIcons": false, "iconProps": { "fit": "cover", "column": "", "type": "round" } } } }, "type": "chart", "visualizationType": "hbar" } }, "Account_Owner_Name_1": { "broadcastFacet": true, "datasets": [ { "id": "0FbB000000017QxKAI", "label": "Opportunities", "name": "opportunity", "url": "/services/data/v41.0/wave/datasets/0FbB000000017QxKAI" } ], "isGlobal": false, "query": { "measures": [ [ "count", "*" ], [ "avg", "Amount" ] ], "groups": [ "Account.Owner.Name" ], "order": [ [ "count", { "ascending": false } ] ] }, "receiveFacet": true, "selectMode": "single", "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "parameters": { "autoFitMode": "none", "showPoints": false, "legend": { "showHeader": true, "show": true, "customSize": "auto", "position": "right-top", "inside": false }, "axisMode": "multi", "tooltip": { "showBinLabel": true, "measures": "", "showPercentage": false, "showDimensions": true, "showMeasures": true, "customizeTooltip": false, "dimensions": "" }, "visualizationType": "line", "dashLine": { "measures": "", "showDashLine": false }, "title": { "fontSize": 14, "subtitleFontSize": 11, "label": "", "align": "center", "subtitleLabel": "" }, "trellis": { "flipLabels": false, "showGridLines": true, "size": [ 100, 100 ], "enable": false, "type": "x", "chartsPerLine": 4 }, "fillArea": true, "showZero": true, "measureAxis2": { "sqrtScale": false, "showTitle": true, "showAxis": true, "title": "", "customDomain": { "showDomain": false } }, "measureAxis1": { "sqrtScale": false, "showTitle": true, "showAxis": true, "title": "", "customDomain": { "showDomain": false } }, "theme": "wave", "dimensionAxis": { "showTitle": true, "customSize": "auto", "showAxis": true, "title": "", "icons": { "useIcons": false, "iconProps": { "fit": "cover", "column": "", "type": "round" } } }, "drawArea": { "measure": "", "showDrawArea": false, "bounding1": "", "bounding2": "" } }, "type": "chart", "options": {} } }, "lens_1": { "datasets": [ { "id": "0FbB000000017QxKAI", "label": "Opportunities", "name": "opportunity", "url": "/services/data/v41.0/wave/datasets/0FbB000000017QxKAI" } ], "isFacet": true, "isGlobal": false, "label": "lens_1", "query": { "values": [ "Name", "Owner.Name", "StageName", "Amount", "CloseDate", "ForecastCategoryName", "Account.Owner.Name" ] }, "selectMode": "none", "type": "grain", "useGlobal": true, "visualizationParameters": { "options": {}, "parameters": { "borderColor": "#e0e5ee", "borderWidth": 1, "cell": { "backgroundColor": "#ffffff", "fontColor": "#16325c", "fontSize": 12 }, "columns": [], "customBulkActions": [], "header": { "backgroundColor": "#f4f6f9", "fontColor": "#16325c", "fontSize": 12 }, "innerMajorBorderColor": "#a8b7c7", "innerMinorBorderColor": "#e0e5ee", "maxColumnWidth": 300, "minColumnWidth": 40, "mode": "variable", "numberOfLines": 1, "totals": true, "verticalPadding": 8 }, "type": "table", "visualizationType": "valuestable" } } }, "widgetStyle": { "backgroundColor": "#FFFFFF", "borderColor": "#E6ECF2", "borderEdges": [], "borderRadius": 0, "borderWidth": 1 }, "widgets": { "table_1": { "parameters": { "columnProperties": { "Amount": { "type": "bar", "parameters": {} } } "borderColor": "#e0e5ee", "borderWidth": 1, "cell": { "backgroundColor": "#ffffff", "fontColor": "#16325c", "fontSize": 12 }, "columns": [], "customBulkActions": [], "exploreLink": true, "header": { "backgroundColor": "#f4f6f9", "fontColor": "#16325c", "fontSize": 12 }, "innerMajorBorderColor": "#a8b7c7", "innerMinorBorderColor": "#e0e5ee", "maxColumnWidth": 300, "minColumnWidth": 40, "mode": "variable", "numberOfLines": 1, "showRowIndexColumn": true, "step": "lens_1", "totals": true, "verticalPadding": 8, "evenRowColor": null, "oddRowColor": null }, "type": "table" }, "filterpanel_1": { "parameters": { "filterItemOptions": { "backgroundColor": "#FFFFFF", "borderColor": "#E6ECF2", "borderRadius": 4, "propertyColor": "#54698D", "valueColor": "#16325C", "borderWidth": 1 }, "itemsPerRow": 2, "title": { "separatorColor": "#E6ECF2", "text": { "align": "left", "color": "#091A3E", "fontSize": 16, "label": "Filters" }, "visible": true } }, "type": "filterpanel" }, "link_1": { "parameters": { "destinationLink": { "name": "ac750443-1729-47fb-8d60-a35703076bf7" }, "destinationType": "page", "fontSize": 12, "includeState": false, "text": "Opp Details", "textAlignment": "center", "textColor": "#44A2F5" }, "type": "link" }, "chart_1": { "parameters": { "autoFitMode": "none", "showValues": true, "bins": { "breakpoints": { "high": 100, "low": 0 }, "bands": { "high": { "color": "#008000", "label": "" }, "low": { "color": "#B22222", "label": "" }, "medium": { "color": "#ffa500", "label": "" } } }, "legend": { "showHeader": true, "show": true, "customSize": "auto", "position": "right-top", "inside": false }, "axisMode": "multi", "tooltip": { "showBinLabel": true, "measures": "", "showPercentage": false, "showDimensions": true, "showMeasures": true, "customizeTooltip": false, "dimensions": "" }, "visualizationType": "hbar", "exploreLink": true, "title": { "fontSize": 14, "subtitleFontSize": 11, "label": "", "align": "center", "subtitleLabel": "" }, "binValues": false, "trellis": { "flipLabels": false, "showGridLines": true, "size": [ 100, 100 ], "enable": false, "type": "x", "chartsPerLine": 4 }, "measureAxis2": { "sqrtScale": false, "showTitle": true, "showAxis": true, "title": "", "customDomain": { "showDomain": false } }, "measureAxis1": { "sqrtScale": false, "showTitle": true, "showAxis": true, "title": "", "customDomain": { "showDomain": false } }, "theme": "wave", "step": "Amount_by_Acct_Owner_1", "dimensionAxis": { "showTitle": true, "customSize": "auto", "showAxis": true, "title": "", "icons": { "useIcons": false, "iconProps": { "fit": "cover", "column": "", "type": "round" } } } }, "type": "chart" } } }, "datasets": [ { "id": "0FbB000000017QxKAI", "label": "Opportunities", "name": "opportunity", "url": "/services/data/v41.0/wave/datasets/0FbB000000017QxKAI" } ] } ``` # CRM Analytics Dashboard JSON Overview The easiest way to build a dashboard in CRM Analytics is to use the dashboard designer. However, if needed, you can further customize dashboards by editing their JSON files. The JSON defines the components of the dashboard and how they interact. Modify a dashboard's JSON file to perform advanced customization tasks that can’t be accomplished in the designer’s user interface, like: - Manually set up bindings to override the default faceting behavior and specify the relationships between the steps that aren’t bound by default. - Set query limits. - Specify columns for a values table. # CRM Analytics in Apex Build and execute queries and retrieve lens and template data using CRM Analytics Apex classes and methods. CRM Analytics in Apex currently consists of the `executeQuery` method, the `Wave.QueryBuilder` class, and the `Wave.Lenses` class. `ConnectApi.Wave.executeQuery` Use the `executeQuery` function (exposed through the ConnectApi namespace) to pass a SAQL query from an Apex page to CRM Analytics, and get a response in the form of JSON. `Wave.QueryBuilder` The `QueryBuilder` class is the most convenient, preferred, and safest way to construct a SAQL query string for execution. `Wave.Lenses` Retrieve a collection of CRM Analytics lens assets and describe a single lens asset. `Wave.Templates` Retrieve a collection of CRM Analytics templates, describe a single template and template configuration. ## Resources For more information on using Apex, see the [Apex Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_reference.htm). - **[CRM Analytics Apex Lens](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-apex-lens.md)** Use the `Lenses` class to retrieve a collection of CRM Analytics lens assets and to describe a single lens asset. - **[CRM Analytics Apex Query](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-apex-query.md)** Query your data in CRM Analytics from any Apex class. Construct well-formed queries using the query builder. - **[CRM Analytics Apex QueryBuilder Examples](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-apex-examples.md)** Build simple or complex SAQL queries using QueryBuilder. - **[CRM Analytics Apex Templates](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sdk/guide/bi-sdk-apex-templates.md)** Use the `Templates` class to retrieve a collection of CRM Analytics templates, describe a single template and template configuration. # CRM Analytics Lightning Web Components Use CRM Analytics Lightning Web Components to retrieve data and metadata for CRM Analytics assets, execute queries, and schedule data syncs for recipes, dataflows, and data connectors. The `lightning/analyticsWaveApi` module provides wire adapters and JavaScript functions built on top of the CRM Analytics REST API. Use these wire adapters and functions to work with CRM Analytics data and metadata. ## Wire Adapters `getActions` Retrieves a collection of Salesforce actions available for the specified Analytics user. For more information on syntax and usage, see the [getActions](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-actions.html) reference in the Lightning Web Components Developer Guide. `getAnalyticsLimits` Retrieves the Analytics limits for CRM Analytics. For more information on syntax and usage, see the [getAnalyticsLimits](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-analytics-limits.html) reference in the Lightning Web Components Developer Guide. `getDataConnector` Retrieves a specific CRM Analytics data connector by ID or developer name. For more information on syntax and usage, see the [getDataConnector](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-data-connector.html) reference in the Lightning Web Components Developer Guide. `getDataConnectors` Retrieves a collection of CRM Analytics data connectors. For more information on syntax and usage, see the [getDataConnectors](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-data-connectors.html) reference in the Lightning Web Components Developer Guide. `getDataConnectorSourceFields` Retrieves a collection of source fields for a source object used by a CRM Analytics data connector. For more information on syntax and usage, see the [getDataConnectorSourceFields](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-data-connectorsource-fields.html) reference in the Lightning Web Components Developer Guide. `getDataConnectorSourceObject` Retrieves a source object used by a CRM Analytics data connector. For more information on syntax and usage, see the [getDataConnectorSourceObject](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-data-connector-source-object.html) reference in the Lightning Web Components Developer Guide. `getDataConnectorSourceObjectDataPreviewWithFields` Retrieves the fields for a data preview for a source object used by a CRM Analytics data connector. For more information on syntax and usage, see the [getDataConnectorSourceObjectDataPreviewWithFields](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-data-connector-source-object-data-previewwithfields.html) reference in the Lightning Web Components Developer Guide. `getDataConnectorStatus` Retrieves the status for a specific CRM Analytics data connector by ID or developer name. For more information on syntax and usage, see the [getDataConnectorStatus](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-data-connector-status.html) reference in the Lightning Web Components Developer Guide. `getDataConnectorTypes` Retrieves the collection of CRM Analytics data connector types. For more information on syntax and usage, see the [getDataConnectorTypes](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-data-connector-types.html) reference in the Lightning Web Components Developer Guide. `getDataflowJob` Retrieves a specific CRM Analytics dataflow job. For more information on syntax and usage, see the [getDataflowJob](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dataflow-job.html) reference in the Lightning Web Components Developer Guide. `getDataflowJobs` Retrieves a collection of CRM Analytics dataflow jobs. For more information on syntax and usage, see the [getDataflowJobs](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dataflow-jobs.html) reference in the Lightning Web Components Developer Guide. `getDataflowJobNode` Retrieves a specific CRM Analytics dataflow job node for a recipe or dataflow. For more information on syntax and usage, see the [getDataflowJobNode](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dataflow-job-node.html) reference in the Lightning Web Components Developer Guide. `getDataflowJobNodes` Retrieves a collection of CRM Analytics dataflow job nodes for a recipe or dataflow. For more information on syntax and usage, see the [getDataflowJobNodes](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dataflow-job-nodes.html) reference in the Lightning Web Components Developer Guide. `getDataflows` Retrieves a collection of CRM Analytics dataflows. For more information on syntax and usage, see the [getDataflows](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dataflows.html) reference in the Lightning Web Components Developer Guide. `getDataset` Retrieves a specific CRM Analytics dataset by ID or developer name. For more information on syntax and usage, see the [getDataset](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dataset.html) reference in the Lightning Web Components Developer Guide. `getDatasets` Retrieves a collection of CRM Analytics datasets. For more information on syntax and usage, see the [getDatasets](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-datasets.html) reference in the Lightning Web Components Developer Guide. `getDatasetVersion` Retrieves a specific CRM Analytics dataset version by ID or developer name. For more information on syntax and usage, see the [getDatasetVersion](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dataset-version.html) reference in the Lightning Web Components Developer Guide. `getDatasetVersions` Retrieves a collection of versions for a CRM Analytics dataset. For more information on syntax and usage, see the [getDatasetVersions](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dataset-versions.html) reference in the Lightning Web Components Developer Guide. `getDependencies` Retrieves a collection of dependencies for a CRM Analytics asset. For more information on syntax and usage, see the [getDependencies](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-dependencies.html) reference in the Lightning Web Components Developer Guide. `getRecipe` Retrieves a specific CRM Analytics recipe by ID. For more information on syntax and usage, see the [getRecipe](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-recipe.html) reference in the Lightning Web Components Developer Guide. `getRecipes` Retrieves a collection of CRM Analytics recipes. For more information on syntax and usage, see the [getRecipes](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-recipes.html) reference in the Lightning Web Components Developer Guide. `getReplicatedDataset` Retrieves a specific CRM Analytics replicated dataset by ID, also known as a connected object. For more information on syntax and usage, see the [getReplicatedDataset](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-replicated-dataset.html) reference in the Lightning Web Components Developer Guide. `getReplicatedDatasets` Retrieves a collection of CRM Analytics replicated datasets, also known as connected objects. For more information on syntax and usage, see the [getReplicatedDatasets](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-replicated-datasets.html) reference in the Lightning Web Components Developer Guide. `getReplicatedFields` Retrieves a collection of fields belonging to a CRM Analytics replicated dataset, also known as connected object. For more information on syntax and usage, see the [getReplicatedFields](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-replicated-fields.html) reference in the Lightning Web Components Developer Guide. `getSchedule` Retrieves a schedule for a CRM Analytics recipe, dataflow, or data sync. For more information on syntax and usage, see the [getSchedule](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-schedule.html) reference in the Lightning Web Components Developer Guide. `getSecurityCoverageDatasetVersion` Retrieves the security coverage for a specific CRM Analytics dataset version by ID or developer name. For more information on syntax and usage, see the [getSecurityCoverageDatasetVersion](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-security-coverage-dataset-version.html) reference in the Lightning Web Components Developer Guide. `getStories` Retrieves a collection of Einstein Discovery stories. For more information on syntax and usage, see the [getStories](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-stories.html) reference in the Lightning Web Components Developer Guide. `getWaveFolder` Retrieves a specific CRM Analytics app or folder. For more information on syntax and usage, see the [getWaveFolder](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-wave-folder.html) reference in the Lightning Web Components Developer Guide. `getWaveFolders` Retrieves a collection of CRM Analytics apps or folders. For more information on syntax and usage, see the [getWaveFolders](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-wave-folders.html) reference in the Lightning Web Components Developer Guide. `getWaveTemplate` Retrieves a CRM Analytics template by ID or API name. For more information on syntax and usage, see the [getWaveTemplate](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-wave-template.html) reference in the Lightning Web Components Developer Guide. `getWaveTemplateConfig` Retrieves the configuration for a CRM Analytics template by ID or API name. For more information on syntax and usage, see the [getWaveTemplateConfig](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-wave-template-config.html) reference in the Lightning Web Components Developer Guide. `getWaveTemplateReleaseNotes` Retrieves the release notes for a CRM Analytics template by ID or API name. For more information on syntax and usage, see the [getWaveTemplateReleaseNotes](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-wave-template-release-notes.html) reference in the Lightning Web Components Developer Guide. `getWaveTemplates` Retrieves a collection of CRM Analytics templates. For more information on syntax and usage, see the [getWaveTemplates](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-wave-templates.html) reference in the Lightning Web Components Developer Guide. `getXmd` Retrieves a specific CRM Analytics extended metadata type (Xmd) for a version of a dataset. For more information on syntax and usage, see the [getXmd](https://developer.salesforce.com/docs/platform/lwc/guide/reference-wire-adapters-get-xmd.html) reference in the Lightning Web Components Developer Guide. ## Functions `createDataConnector` Creates an instance of a CRM Analytics connector to connect to data in your Salesforce orgs, apps, data warehouses, and database services. For more information on syntax and usage, see the [createDataConnector](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-create-data-connector.html) reference in the Lightning Web Components Developer Guide. `createDataflowJob` Creates a CRM Analytics dataflow job, which is the equivalent of clicking **Run Now** for a data prep recipe, a data sync, or a dataflow in the CRM Analytics Data Manager UI. For more information on syntax and usage, see the [createDataflowJob](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-create-dataflow-job.html) reference in the Lightning Web Components Developer Guide. `createDataset` Creates a dataset. For more information on syntax and usage, see the [createDataset](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-create-dataset.html) reference in the Lightning Web Components Developer Guide. `createDatasetVersion` Creates a version for a specific CRM Analytics dataset by ID or developer name. For more information on syntax and usage, see the [createDatasetVersion](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-create-dataset-version.html) reference in the Lightning Web Components Developer Guide. `createReplicatedDataset` Creates a CRM Analytics replicated dataset, also known as a connected object. For more information on syntax and usage, see the [createReplicatedDataset](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-create-replicated-dataset.html) reference in the Lightning Web Components Developer Guide. `deleteDataConnector` Deletes a specific CRM Analytics connector by ID or developer name. For more information on syntax and usage, see the [deleteDataConnector](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-delete-data-connector.html) reference in the Lightning Web Components Developer Guide. `deleteDataset` Deletes a specific CRM Analytics dataset by ID or developer name. For more information on syntax and usage, see the [deleteDataset](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-delete-dataset.html) reference in the Lightning Web Components Developer Guide. `deleteRecipe` Deletes a specific CRM Analytics recipe by ID. For more information on syntax and usage, see the [deleteRecipe](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-delete-recipe.html) reference in the Lightning Web Components Developer Guide. `deleteReplicatedDataset` Deletes a specific CRM Analytics replicated dataset by ID. For more information on syntax and usage, see the [deleteReplicatedDataset](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-delete-replicated-dataset.html) reference in the Lightning Web Components Developer Guide. `deleteWaveFolder` Deletes a specific CRM Analytics app or folder by ID. For more information on syntax and usage, see the [deleteWaveFolder](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-delete-wave-folder.html) reference in the Lightning Web Components Developer Guide. `executeQuery` Executes a CRM Analytics query written in Salesforce Analytics Query Language (SAQL) or standard SQL. For more information on syntax and usage, see the [executeQuery](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-execute-query.html) reference in the Lightning Web Components Developer Guide. `ingestDataConnector` Triggers the CRM Analytics to run a data sync. For more information on syntax and usage, see the [ingestDataConnector](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-ingest-data-connector.html) reference in the Lightning Web Components Developer Guide. `postWaveFolders` Creates a CRM Analytics app or folder by ID. For more information on syntax and usage, see the [postWaveFolders](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-post-wave-folders.html) reference in the Lightning Web Components Developer Guide. `updateDataConnector` Updates a CRM Analytics data connector. For more information on syntax and usage, see the [updateDataConnector](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-data-connector.html) reference in the Lightning Web Components Developer Guide. `updateDataflowJob` Updates a CRM Analytics dataflow job, which is the equivalent of clicking **Stop** for a data prep recipe, a data sync, or a dataflow in the CRM Analytics Data Manager UI. For more information on syntax and usage, see the [updateDataflowJob](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-dataflow-job.html) reference in the Lightning Web Components Developer Guide. `updateDataset` Updates a specific CRM Analytics dataset by ID or developer name. For more information on syntax and usage, see the [updateDataset](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-dataset.html) reference in the Lightning Web Components Developer Guide. `updateDatasetVersion` Updates a specific CRM Analytics dataset version by ID or developer name. For more information on syntax and usage, see the [updateDatasetVersion](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-dataset-version.html) reference in the Lightning Web Components Developer Guide. `updatePartialWaveFolder` Performs a partial update for a CRM Analytics app or folder by ID. For more information on syntax and usage, see the [updatePartialWaveFolder](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-partial-wave-folder.html) reference in the Lightning Web Components Developer Guide. `updateRecipe` Updates a CRM Analytics recipe. For more information on syntax and usage, see the [updateRecipe](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-recipe.html) reference in the Lightning Web Components Developer Guide. `updateReplicatedDataset` Updates a CRM Analytics replicated dataset by ID. For more information on syntax and usage, see the [updateReplicatedDataset](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-replicated-dataset.html) reference in the Lightning Web Components Developer Guide. `updateReplicatedFields` Updates the collection of fields for a CRM Analytics replicated dataset by ID. For more information on syntax and usage, see the [updateReplicatedFields](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-replicated-dataset-fields.html) reference in the Lightning Web Components Developer Guide. `updateSchedule` Updates the schedule for a CRM Analytics data prep recipe, data sync, or dataflow. For more information on syntax and usage, see the [updateSchedule](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-schedule.html) reference in the Lightning Web Components Developer Guide. `updateXmd` Updates the user Xmd for a CRM Analytics dataset. For more information on syntax and usage, see the [updateXmd](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-xmd.html) reference in the Lightning Web Components Developer Guide. `updateWaveFolder` Updates a CRM Analytics app or folder by ID. For more information on syntax and usage, see the [updateWaveFolder](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-update-wave-folder.html) reference in the Lightning Web Components Developer Guide. `validateWaveTemplate` Validates a CRM Analytics template for org readiness. For more information on syntax and usage, see the [valildateWaveTemplate](https://developer.salesforce.com/docs/platform/lwc/guide/reference-analytics-validate-wave-template.xmd.html) reference in the Lightning Web Components Developer Guide. # CRM Analytics Template SDK Aura Component Discover CRM Analytics templates and apps created from them. Create, update, and delete CRM Analytics apps created from templates. ## Call the SDK To call the SDK, declare the `wave:sdk` component in your component or app. `` Use `sdk.invokeMethod` to specify the method and any parameters. `sdk.invokeMethod(context, methodName, methodParameters, callback)` For example, here’s a call that uses `listFolders` as _methodName_. ```apex var context = {}; var methodName = 'listFolders'; var methodParameters = { 'templateSourceId' : templateSourceId, 'pageSize' : pageSize, 'q' : q, 'sort' : sort, 'scope' : scope, 'page' : page, 'isPinned' : isPinned, 'mobileOnly' : false }; sdk.invokeMethod(context, methodName, methodParameters, $A.getCallback(function (err, data) { if (err !== null) { //DO THIS IF THE METHOD FAILS console.error("SDK error", err); } else { //DO THIS IF THE METHOD SUCCEEDS component.set('v.folders', data.folders); } })) ``` Each method has its own set of parameters (_methodParameters_)—except listTemplates, which doesn’t need any. ## Methods and Parameters ### listTemplates Retrieves a list of all templates that the user has access to. Has no parameters. ### getTemplate Retrieves information for the specified template. | Parameter Name | Description | Required | Type | | -------------- | ------------------- | -------- | ------------------------------------------------------------------------------------ | | `templateId` | ID of the template. | TRUE | String, in either the internal `'sfdc_internal__'` or base platform object ID format | ### getTemplateConfig Retrieves variable and UI information for the template. | Parameter Name | Description | Required | Type | | -------------- | ------------------- | -------- | ------------------------------------------------------------------------------------ | | `templateId` | ID of the template. | TRUE | String, in either the internal `'sfdc_internal__'` or base platform object ID format | ### validateWaveTemplate Runs validation on a CRM Analytics template to check for org readiness. | Parameter Name | Description | Required | Type | | ----------------- | --------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------- | | `templateId` | ID of the template. | TRUE | String, in either the internal `'sfdc_internal__'` or base platform object ID format | | `validationInput` | The input to use during the validation. | TRUE | A map of template variable values to validate the template with. These values override any template defaults. | ### createFolder Creates a folder from the specified template. Not used for apps that aren’t created from templates. | Parameter Name | Description | Required | Type | | ------------------ | ------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | Developer name of the folder. | TRUE | String | | `label` | Display label of the folder. | TRUE | String | | `description` | Description of the folder. | FALSE | String | | `dynamicOptions` | Map of configuration options for folder creation. | FALSE | Object; map of name-value pairs, such as `{'runtimeLogEntryLevel' : 'Warning'}`. For supported names and values, see [Template Options Input](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_requests_template_options_input.htm). | | `templateSourceId` | ID of the template used to create the folder. | TRUE | String, in either the internal `'sfdc_internal__'` or base platform object ID format | | `templateValues` | Variable values for the template. | FALSE | Object; map of name-value pairs, such as `{'Can_Continue' : true}` | ### listFolders Retrieves a list of folders that the user has access to. Can be filtered by specifying parameters. | Parameter Name | Description | Required | Type | | ------------------ | ----------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------ | | `templateSourceId` | Limit the results to folders created from the specified template. | FALSE | String, in either the internal `'sfdc_internal__'` or base platform object ID format | | `pageSize` | Limit the results by page. | FALSE | Number | | `q` | Limit the results by query string. | FALSE | String | | `sort` | Sort the results alphabetically or by most recently used. | FALSE | Enum: `'alpha'` or `'mru'` | | `scope` | Return only folders within the specified scope. | FALSE | Enum: `'createdByMe'` or `'sharedWithMe'` | | `page` | Return the specified page of results. | FALSE | Number | | `isPinned` | Limit the results to pinned or unpinned folders. | FALSE | Boolean | | `mobileOnly` | Limit the results to mobileOnly folders. | FALSE | Boolean | ### updateFolder Updates a folder’s metadata. Can cancel an in-progress app. | Parameter Name | Description | Required | Type | | ------------------- | --------------------------------------------------- | -------- | ------------------------------------- | | `folderId` | ID of the folder. | TRUE | String | | `label` | New display label for the folder. | FALSE | String | | `description` | New description for the folder. | FALSE | String | | `applicationStatus` | When specified, cancels an app that is in progress. | FALSE | `'cancelledstatus'` is the only value | ### upgradeFolder Resets or upgrades the specified folder. If the version of the template matches the version used to create the app, resets the app using the template. If the versions don’t match, upgrades the app using the new template version. Can specify dynamic options or template values that differ from the values used when the app was originally created. | Parameter Name | Description | Required | Type | | ---------------- | ------------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `dynamicOptions` | Map of configuration options for folder upgrade. | FALSE | Object; map of name-value pairs, such as `{'runtimeLogEntryLevel' : 'Warning'}`. For supported names and values, see [Template Options Input](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_requests_template_options_input.htm). | | `folderId` | ID of the folder. | TRUE | String | | `templateValues` | Variable values for the template. | FALSE | Object; map of name-value pairs, such as `{'Can_Continue' : true}` | ### deleteFolder Deletes the specified folder. | Parameter Name | Description | Required | Type | | -------------- | ----------------- | -------- | ------ | | `folderId` | ID of the folder. | TRUE | String | # Dashboard and Component Error Codes Errors can occur at the dashboard level and at the component level. Dashboard-level error messages are returned in the response header, and component-level error messages are returned as part of the component status object. To view a complete list of error messages, see [Status Codes and Error Responses](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/errorcodes.htm). ## Dashboard-level errors When a dashboard-level error occurs, the response header contains an HTTP response code and one of the following error messages: |HTTP Response Code|Error Message| |------------------|-------------| |400|The running user for this dashboard doesn't have permission to run reports. Your system administrator should select a different running user for this dashboard.| |400|The running user for this dashboard is inactive. Your system administrator should select an active user for this dashboard.| |400|You don't have permission to view data as this user.| |400|Your organization has reached the limit for dynamic dashboards, or doesn't have access. Ask your administrator to enable dynamic dashboards or convert them to dashboards with a specific running user.| |400|The selected filter item isn't valid.| |400|You can't refresh this dashboard. A refresh is already in progress.| ## Component-level errors If an error occurs at the component level, the errorCode, errorMessage, and errorSeverity properties of the component status field are populated. The errorSeverity property distinguishes between errors and warnings. Errors are blocking issues that prevent the query from returning any data. Warnings are non-blocking issues; queries will finish, but they might return incomplete data. The following table shows the possible values for the error fields. |errorCode|errorMessage|errorSeverity| |---------|------------|-------------| |201|This component must have a type and a data source.|Error| |202|The source report isn't available; it's been deleted or isn't in a folder accessible to the dashboard's running user.|Error| |203|This report can no longer be edited or run. Your administrator has disabled all reports for the custom or external object, or its relationships have changed.|Error| |205|The source report is based on a report type that is inaccessible to the dashboard's running user.|Error| |208|Unable to run source report because its definition is invalid.|Error| |209|This report cannot be used as the source for this component. If it is a summary or matrix report, add one or more groupings in the report. If it is a tabular report with a row limit, specify the Dashboard Settings in the report.|Error| |210|This row-limited tabular report cannot be used as the source for this component. Use the dashboard component editor to specify the data you want to display, or specify the Dashboard Settings in the report.|Error| |211|To use this row-limited tabular report as the source, edit the report and specify the Name and Value under Dashboard Settings. When updating the report, make sure you are the running user of the dashboard.|Error| |212|Groupings and combination charts are not available for a row-limited tabular report. Set “Group By” to None and deselect “Plot Additional Values.”|Error| |300|The results below may be incomplete because the underlying report produced too many summary rows, and the sort order of the component is different from the sort order in the underlying report. Try adding filters to the report to reduce the number of rows returned.|Error| |301|Results may be incomplete because the source report had too many summary rows. Try filtering the report to reduce the number of rows returned.|Warning| |302|The component can't be displayed because the source report exceeded the time limit.|Warning| |303|The component can't be displayed because the source report failed to run.|Error| |304|The component can't be displayed because the dashboard filter raises the number of source report filters above the limit. Reduce the number of report filters and try again.|Error| |305|The component can't be displayed because the field(s) you chose for the filter are unavailable.|Error| |308|You can’t filter this component because data is in the joined report format. To filter the component, change its report format.|Error| |309|The underlying report uses a snapshot date that is out of range.|Error| |403|The request has been refused. Verify that the logged-in user has appropriate permissions. If the error code is REQUEST_LIMIT_EXCEEDED, you’ve exceeded API request limits in your org.|Error| |409|The request couldn’t be completed due to a conflict with the current state of the resource. Check that the API version is compatible with the resource you’re requesting.|Error| # Dashboard Describe Returns metadata for the specified dashboard, including dashboard components, filters, layout, and the running user. ## Syntax **URI:** `/services/data/vXX.X/analytics/dashboards/dashboardID/describe` **Formats:** JSON **HTTP methods:** GET **Parameters** |Parameter|Description| |---------|-----------| |`loadComponentProperties`|Optional. Specifies whether or not to return properties for each dashboard component. The default value is `true`. Has no effect on filtered dashboards. Valid values are `true` (return component properties) or `false` (don’t return component properties; the properties value instead returns `null`).| **Authentication:** `Authorization: Bearer token` ## Example See this example, [Get Dashboard Metadata](https://developer.salesforce.com/docs/analytics/examples/dashboards/analytics-api-dashboard-example-get-dashboard-metadata.md). ## Response body |Property|Type|Description| |--------|----|-----------| |attributes|[Attributes](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|Attributes for the dashboard resource, such as name, identifier, and references to other related resources.| |canChangeRunningUser|Boolean|Indicates whether the user is allowed to select a specific running user. Always `true` for team dashboards.| |canUseStickyFilter|Boolean|Indicates whether dashboard filters persist after closing the dashboard (`true`) or not (`false`). Filters that persist keep the dashboard filtered the next time you open it. Filters persist for users on a per-user basis, so if you apply a filter then it doesn’t persist for other people.| |chartTheme|String|Specifies the dashboard theme. Possible values are `light` (default; dashboards have a light background that resembles a glass of milk) or `dark` (dashboards have a dark background that is reminiscent of the night sky).| |colorPalette|String|Specifies a color palette for use in charts. Possible values are `wildflowers` (default), `aurora`, `nightfall`, `sunrise`, `bluegrass`, `ocean`, `heat`, `dusk`, `pond`, `watermelon`, `fire`, `water`, `lake`, or `mineral` (accessible).| |components|[Components](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)[]|Ordered array of components in this dashboard.| |description|String|Dashboard description.| |dashboardType|String|Indicates whether a dashboard is a dynamic dashboard, a dashboard with running users, or a standard dashboard. Possible values are `SpecifiedUser` (dashboard readers view data as though they are the person specified by `runningUser`), `LoggedInUser` (dashboard readers view data as themselves; the dashboard is a dynamic dashboard), or `MyTeamUser` (dashboard readers view data as the person specified by `runningUser` by default; with the “View All Data” user permission they can change `runningUser` to anyone; with the “View My Team’s Dashboards” user permission they can change `runningUser` to people subordinate to them in the role hierarchy).| |developerName|String|Unique API name of the dashboard.| |filters|[Filters](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)[]|Ordered array of filters for this dashboard. The dashboard can have 0-3 filters.| |folderId|String|ID of the folder that contains the dashboard.| |id|String|Unique identifier of dashboard.| |layout|[Layout](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|Component layout for this dashboard.| |maxFilterOptions|Integer|The maximum number of values allowed in a dashboard filter.| |name|String|Dashboard name.| |runningUser|[Running user](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|The running user, which is either specified at dashboard design time, or is overridden by the runningUser parameter specified in the GET request. For dynamic dashboards, this is always the current user.| **Components** |Property|Type|Description| |--------|----|-----------| |componentData|Integer|Index into the component data array in the response body.| |footer|String|Footer of the component.| |header|String|Header of the component.| |id|String|Unique identifier of the component.| |properties|[Properties (for Report component type)](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md) or [Properties (for Visualforce page component type)](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|Component properties, including type-specific visualization properties.| |reportId|String|Unique identifier of the underlying report.| |title|String|Title of the component| |type|String|Type of the component. Value can be `Report` or `VisualforcePage`. If the component is an SControl, the value is not set.| **Properties (for Report component type)** |Property|Type|Description| |--------|----|-----------| |aggregates|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |autoSelectColumns|Boolean|Indicates whether groupings and aggregates are automatically selected. Valid values are `true` and `false`.| |drillUrl|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |groupings|[Groupings](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|Report groupings included in the dashboard.| |maxRows|Number|Maximum number of rows to be rendered, based on the sort value.| |reportFormat|String|The format of a dashboard’s source report.| |sort|[Sort](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|Used in previous releases. In this release (v46.0) and later assign the value `null`, except for tabular Lightning table format or Top N source report for any chart type. In these two cases, the value matches the following object.| |useReportChart|Boolean|Indicates whether the dashboard component uses the chart as defined in the report. Valid values are `true` and `false`.| |useReportTableSetting|Boolean|Indicates whether the widget uses report settings when a Lightning table is added to a dashboard. Valid values are `true` and `false`.| |visualizationProperties|[Visualization properties (Chart)](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md), [Visualization properties (Table)](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md), [Visualization properties (FlexTable)](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md), [Visualization properties (Metric)](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md), or [Visualization properties (Gauge)](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|Type-specific visualization properties.| |visualizationType|String|Type of the component. Value can be `Bar`, `Column`, `Donut`, `Funnel`, `Gauge`, `Line`, `Metric`, `Pie`, `Scatter`, `Table`, or `FlexTable` (as of API version 41.0).| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!_\_ represents a unique count of values for the specified _\_. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example sort object for tabular Lightning table format or Top N source report: ```nolang { "sort" : { "column" : "TYPE", "sortOrder" : "asc", "type" : "label" }, } ``` **Sort** |Property|Type|Description| |--------|----|-----------| |inheritedReportSort|String|For this release (v46.0) and later, keep the default value of `null` for this property and use sortOrder instead.| |sortAggregate|String|Name of the aggregate by which the dashboard component sorts. If `null`, the dashboard component sorts by label or matches/inverts the report's sort order.| |sortOrder|String|Specifies whether the dashboard component sorts in ascending (`Asc`) or descending (`Desc`) order.| **Visualization properties (Chart)** |Property|Type|Description| |--------|----|-----------| |axisRange|String|Range of values specified for the axis.| |decimalPrecision|Integer|The number of decimal places included in a dashboard metric, chart, or table, 0–5. If -1 or null, Salesforce automatically sets the number of decimal places.| |displayUnits|String|Specify how to display numbers. Possible values are `whole` (display the true value without rounding), `auto` (round to the nearest thousand, million, and so on as a shortened value—for example, 1,876 displays as 1.9k; summaries still use the true value), `hundreds`, `thousands`, `millions`, `billions`, `trillions` (display as multiples of that unit), or `null` (customizing how numbers display isn’t applicable).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |groupByType|String|Type of second-level grouping.| |legendPosition|String|Position of legend on the grid. Valid values are `bottom`, `right`, and `none`.| |showValues|Boolean|Indicates whether to include values in the chart. Valid values are `true` and `false`.| **Visualization properties (Table)** |Property|Type|Description| |--------|----|-----------| |breakPoints|[Break point](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)[]|Break points for the table component.| |displayUnits|String|Specify how to display numbers. Possible values are `whole` (display the true value without rounding), `auto` (round to the nearest thousand, million, and so on as a shortened value—for example, 1,876 displays as 1.9k; summaries still use the true value), `hundreds`, `thousands`, `millions`, `billions`, `trillions` (display as multiples of that unit), or `null` (customizing how numbers display isn’t applicable).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |tableColumns|[Table columns](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)[]|Columns of the table component.| **Visualization properties (Metric)** |Property|Type|Description| |--------|----|-----------| |breakPoints|[Break point](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)[]|Break points for the metric component.| |displayUnits|String|Specify how to display numbers. Possible values are `whole` (display the true value without rounding), `auto` (round to the nearest thousand, million, and so on as a shortened value—for example, 1,876 displays as 1.9k; summaries still use the true value), `hundreds`, `thousands`, `millions`, `billions`, `trillions` (display as multiples of that unit), or `null` (customizing how numbers display isn’t applicable).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |metricLabel|String|Label for the metric component.| **Visualization properties (Gauge)** |Property|Type|Description| |--------|----|-----------| |breakPoints|[Break point](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)[]|Break points for the gauge component.| |displayUnits|String|Specify how to display numbers. Possible values are `whole` (display the true value without rounding), `auto` (round to the nearest thousand, million, and so on as a shortened value—for example, 1,876 displays as 1.9k; summaries still use the true value), `hundreds`, `thousands`, `millions`, `billions`, `trillions` (display as multiples of that unit), or `null` (customizing how numbers display isn’t applicable).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |showPercentages|Boolean|Specify whether percentages are displayed (`true`) or not (`false`)| |showTotal|Boolean|Indicates whether the total is displayed (`true`) or not (`false`).| **Properties (for Visualforce page component type)** |Property|Type|Description| |--------|----|-----------| |pageName|String|Developer name of the Visualforce page.| |height|String|Height of the Visualforce page, in pixels.| **Filters** |Property|Type|Description| |--------|----|-----------| |errorMessage|String|If there is no error with a dashboard filter, then `null`. Otherwise, the error message is returned.| |name|String|Localized display name of filter.| |options|[Filter option](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|Ordered array of possible filter options.| |selectedOption|Integer|Index of the selected option from the options array. This matches the selection that was made based on the filter1, filter2, or filter3 parameter. Value is `null` if no option is selected.| **Filter option** |Property|Type|Description| |--------|----|-----------| |alias|String|Optional alias of the filter option.| |id|String|Unique identifier of the filter option. Used as a value for the filter1, filter2, and filter3 parameters.| |operation|String|Unique API name for the filter operation. Valid filter operations depend on the data type of the filter field. Value can be `equals`, `notEqual`, `lessThan`, `greaterThan`, `lessOrEqual`, `greaterOrEqual`, `contains`, `notContain`, `startsWith`, `includes`, `excludes`, `within`, or `between`.| |value|String|Value to filter on. Used for all operations except `between`.| |startValue|String|Start value when using a `between` operation. Not set for all other operations.| |endValue|String|End value when using a `between` operation. Not set for all other operations.| **Layout** |Property|Type|Description| |--------|----|-----------| |columns|[Columns](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)[]|Dashboard layout columns. Can have 2 or 3 columns, including empty columns. This property is available only if the dashboard was created using Salesforce Classic.| |components|[Components](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md)|Layout for dashboards. This property is available only if the dashboard was created using Lightning Experience.| **Columns** |Property|Type|Description| |--------|----|-----------| |components|Integer[]|Ordered list of components in a column (top to bottom). Components are represented by indices into the array of components in the dashboard metadata object.| **Components** |Property|Type|Description| |--------|----|-----------| |colspan|Integer|Width of component in columns. For example, if `colspan=3`, then the component spans 3 columns.| |rowspan|Integer|Height of component in rows. For example, if `rowspan=4`, then the component spans 4 rows.| |column|String|Column position on the grid.| |row|String|Row position on the grid.| **Running user** |Property|Type|Description| |--------|----|-----------| |displayName|String|Display name of running user.| |id|String|Returns the ID of the running user specified for the dashboard. If the dashboard is configured to run as the viewing user, returns the user ID of the dashboard creator.| # Dashboard Filter Options Analysis Verifies that dashboard filter options are compatible with source report fields. Use this resource to testAvailable in API version 40.0 and later. ## Syntax **URI:** `/services/data/vXX.X/analytics/dashboards/dashboardID/filteroptionsanalysis` **Formats:** JSON **HTTP methods:** POST **Authentication:** `Authorization: Bearer token` ## POST Request Body
Property Type Description
filterColumns filterColumns[] An array of fields from the source report which you check filter values against. Each object in the array has these properties:

reportId: The the source report’s unique ID.

name: The report field’s API name.

options options[] An array of objects describing a dashboard filter. Each object has these properties:

alias: The display name of the filter value.

operation: The filter’s operator.

value: The value applied by the filter.

startValue: If the filter includes a range (such as a date range), the start of the range. Otherwise, null.

endValue: If the filter includes a range (such as a date range), the end of the range. Otherwise, null.

## POST Response Body If successful, returns an empty response. ## Example POST Request ```nolang { "filterColumns" : [{ "reportId": "00OR0000000P76tMAC", "name": "ACCOUNT_TYPE" }], "options": [{ "alias": "New", "operation": "contains", "value": "New", "startValue": null, "endValue": null }] } ``` # Dashboard JSON Properties The dashboard JSON consists of properties that define layouts, pages, widgets, and steps. Some properties are exposed and editable in the Dashboard Designer user interface. Others are only editable via JSON. Each dashboard JSON contains the following high-level properties. | Property Name | Type | Details | | ---------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `label` | String | Name of the dashboard. Included in the Dashboard Designer's user interface. | | `mobileDisabled` | Boolean | Specifies whether the dashboard can be accessed in the mobile app. Use this parameter to hide dashboards that don't perform well on mobile devices. Default is `false`. Included in the Dashboard Designer's user interface. | | `description` | String | Description of the dashboard. Included in the Dashboard Designer's user interface. | | `state` | Array | Specifies properties for all layouts, widgets, and steps defined in the dashboard. When you save a dashboard using the Dashboard Designer, the state of the dashboard is persisted in the JSON. Not included in the Dashboard Designer's user interface. | | `datasets` | Array | Specifies all datasets used by steps in the dashboard. Not included in the Dashboard Designer's user interface. | The following sections describe the different properties nested under `state`. - **[dataSourceLinks JSON](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-datasourcelinks.md)** The `dataSourceLinks` section defines all data sources configured for the dashboard. - **[gridLayouts JSON](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-gridlayouts.md)** The `gridLayouts` section defines all layouts built for the dashboard. - **[widgetStyle JSON and Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-widgetstyle.md)** The `widgetStyle` key contains the default widget properties that can be applied to each widget. - **[steps JSON](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-properties.md)** The `steps` key defines all steps available in a CRM Analytics dashboard. It contains a separate node for each step. Each step node has properties that define the query or list of static values. It also contains properties that control the behavior of the step, like whether to facet the step. The properties and JSON syntax vary based on the step type and whether the step is in compact form or SAQL form. - **[widgets JSON](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-widgets.md)** The `widgets` section defines the widgets that appear in the dashboard. Each widget has a name. - **[filters JSON](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-filters.md)** The `filters` section defines the global filters added to a global filter panel widget, which is available in the dashboard designer. # Dashboard List Returns a list of recently used dashboards or clones a dashboard. ## Syntax **URI:** `/services/data/vXX.X/analytics/dashboards` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |GET|Returns a list of dashboards that were recently viewed by the API user. See this [example](https://developer.salesforce.com/docs/analytics/examples/dashboards/analytics-api-dashboard-get-list.md).| |POST|Makes a copy of a dashboard. See this [example](https://developer.salesforce.com/docs/analytics/examples/dashboards/sforce-analytics-rest-api-clone-dashboard.md).| **Authentication:** `Authorization: Bearer token` ## GET Response body An array of recent dashboard objects. Each object contains the following fields: |Property|Type|Description| |--------|----|-----------| |id|String|Unique identifier of the dashboard.| |name|String|Localized display name of the dashboard.| |statusUrl|String|Dashboard status URL.| |url|String|Dashboard result URL.| ## POST Response Body Uses the same format as the [GET and PUT responses](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-results-resource.md) for the resource. # Dashboard Results Can return metadata, data, and status for the specified dashboard. Can also refresh, save, or delete a dashboard. ## Syntax **URI:** `/services/data/vXX.X/analytics/dashboards/dashboardID` Or, with optional parameters: `/services/data/vXX.X/analytics/dashboards/dashboardID?runningUser=runningUserID&filter1=filter1ID&filter2=filter2ID&filter3=filter3ID` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |GET|Returns metadata, data, and status for the specified dashboard. See this [example](https://developer.salesforce.com/docs/analytics/examples/dashboards/analytics-api-dashboard-get-results.md).| |POST|Returns details about one or more dashboard components from a specified dashboard. See this [example](https://developer.salesforce.com/docs/analytics/examples/dashboards/analytics-api-dashboard-example-return-details-about-dashboard-components.md).| |PUT|Triggers a dashboard refresh. See this [example](https://developer.salesforce.com/docs/analytics/examples/dashboards/analytics-api-dashboard-refresh.md).| |PATCH|Saves a dashboard. See this [example](https://developer.salesforce.com/docs/analytics/examples/dashboards/analytics-api-dashboard-save-dashboard.md).| |DELETE|Deletes a dashboard. See this [example](https://developer.salesforce.com/docs/analytics/examples/dashboards/analytics-api-dashboard-delete.md).| **Authentication:** `Authorization: Bearer token` **Parameters** The following optional parameters can be used with the GET and PUT methods: |Parameter Name|Description| |--------------|-----------| |runningUser|Identifier of the running user. Gives an error if the user is not allowed to change the running user, or if the selected running user is invalid.| |filter1|Identifier of the selected filter option for the first filter. Gives an error if the filter option is invalid.| |filter2|Identifier of the selected filter option for the second filter. Gives an error if the filter option is invalid.| |filter3|Identifier of the selected filter option for the third filter. Gives an error if the filter option is invalid.| |isStickyFilterSave|Append to a PATCH request. When `true`, saves any dashboard filters set in the request so that they’re also set the next time you open the dashboard. You can only set dashboard filters for yourself, not for other users.| ## GET, POST, and PUT Response body |Property|Type|Description| |--------|----|-----------| |componentData|[Component data](#dashboard-results)[]|Ordered array containing data and status for each component of the dashboard.| |dashboardMetadata|[Dashboard metadata](#dashboard-results)|Metadata for the entire dashboard.| **Attributes** |Property|Type|Description| |--------|----|-----------| |dashboardId|String|Unique identifier of dashboard.| |dashboardName|String|Dashboard name.| |statusUrl|Url|The URL of the status resource for the dashboard.| |type|String|This property is always set to `Dashboard`.| **Component data** |Property|Type|Description| |--------|----|-----------| |componentId|String|Unique identifier of the component.| |reportResult|[Report results](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getreportrundata.md)|Report metadata and summary data for the dashboard component. Uses the same data format as the Report API.| |status|[Component status](#dashboard-results)|Queue and data status of the component.| **Component status** |Property|Type|Description| |--------|----|-----------| |dataStatus|String|Status of the data set of the component. Value can be `NODATA` (the data set was never generated or is invalid due to a change in the report), `DATA` (the data set is available and was last refreshed at the refreshDate), or `ERROR` (a component error has occurred; details can be found in errorCode, errorMessage, and errorSeverity).| |errorCode|String|Unique identifier of error message. This property is only populated in case of error.| |errorMessage|String|Localized error message. This property is only populated in case of error.| |errorSeverity|String|Severity of error code and message. Value can be `Error` or `Warning`. This property is only populated in case of error.| |refreshDate|Date and time string|Date and time of last refresh in ISO-8601 format.| |refreshStatus|String|Refresh status of the component. Value can be `IDLE` (the component is not currently being refreshed) or `RUNNING` (the component is currently being refreshed).| **Dashboard metadata** |Property|Type|Description| |--------|----|-----------| |attributes|[Attributes](#dashboard-results)|Attributes for the dashboard resource, such as name, identifier, and references to other related resources.| |canChangeRunningUser|Boolean|Indicates whether the user is allowed to select a specific running user. Always `true` for team dashboards.| |canUseStickyFilter|Boolean|Indicates whether dashboard filters persist after closing the dashboard (`true`) or not (`false`). Filters that persist keep the dashboard filtered the next time you open it. Filters persist for users on a per-user basis, so if you apply a filter then it doesn’t persist for other people.| |chartTheme|String|Specifies the dashboard theme. Possible values are `light` (default; dashboards have a light background that resembles a glass of milk) or `dark` (dashboards have a dark background that is reminiscent of the night sky).| |colorPalette|String|Specifies a color palette for use in charts. Possible values are `wildflowers` (default), `aurora`, `nightfall`, `sunrise`, `bluegrass`, `ocean`, `heat`, `dusk`, `pond`, `watermelon`, `fire`, `water`, `lake`, or `mineral` (accessible).| |components|[Components](#dashboard-results)[]|Ordered array of components in this dashboard.| |description|String|Dashboard description.| |dashboardType|String|Indicates whether a dashboard is a dynamic dashboard, a dashboard with running users, or a standard dashboard. Possible values are `SpecifiedUser` (dashboard readers view data as though they are the person specified by `runningUser`), `LoggedInUser` (dashboard readers view data as themselves; the dashboard is a dynamic dashboard), or `MyTeamUser` (dashboard readers view data as the person specified by `runningUser` by default; with the “View All Data” user permission they can change `runningUser` to anyone; with the “View My Team’s Dashboards” user permission they can change `runningUser` to people subordinate to them in the role hierarchy).| |developerName|String|Unique API name of the dashboard.| |filters|[Filters](#dashboard-results)[]|Ordered array of filters for this dashboard. The dashboard can have 0-3 filters.| |folderId|String|ID of the folder that contains the dashboard.| |id|String|Unique identifier of dashboard.| |layout|[Layout](#dashboard-results)|Component layout for this dashboard.| |maxFilterOptions|Integer|The maximum number of values allowed in a dashboard filter.| |name|String|Dashboard name.| |runningUser|[Running user](#dashboard-results)|The running user, which is either specified at dashboard design time, or is overridden by the runningUser parameter specified in the GET request. For dynamic dashboards, this is always the current user.| **Components** |Property|Type|Description| |--------|----|-----------| |componentData|Integer|Index into the component data array in the response body.| |footer|String|Footer of the component.| |header|String|Header of the component.| |id|String|Unique identifier of the component.| |properties|[Properties (for Report component type)](#dashboard-results) or [Properties (for Visualforce page component type)](#dashboard-results)|Component properties, including type-specific visualization properties.| |reportId|String|Unique identifier of the underlying report.| |title|String|Title of the component| |type|String|Type of the component. Value can be `Report` or `VisualforcePage`. If the component is an SControl, the value is not set.| **Filters** |Property|Type|Description| |--------|----|-----------| |errorMessage|String|If there is no error with a dashboard filter, then `null`. Otherwise, the error message is returned.| |name|String|Localized display name of filter.| |options|[Filter option](#dashboard-results)|Ordered array of possible filter options.| |selectedOption|Integer|Index of the selected option from the options array. This matches the selection that was made based on the filter1, filter2, or filter3 parameter. Value is `null` if no option is selected.| **Filter option** |Property|Type|Description| |--------|----|-----------| |alias|String|Optional alias of the filter option.| |id|String|Unique identifier of the filter option. Used as a value for the filter1, filter2, and filter3 parameters.| |operation|String|Unique API name for the filter operation. Valid filter operations depend on the data type of the filter field. Value can be `equals`, `notEqual`, `lessThan`, `greaterThan`, `lessOrEqual`, `greaterOrEqual`, `contains`, `notContain`, `startsWith`, `includes`, `excludes`, `within`, or `between`.| |value|String|Value to filter on. Used for all operations except `between`.| |startValue|String|Start value when using a `between` operation. Not set for all other operations.| |endValue|String|End value when using a `between` operation. Not set for all other operations.| **Layout** |Property|Type|Description| |--------|----|-----------| |columns|[Columns](#dashboard-results)[]|Dashboard layout columns. Can have 2 or 3 columns, including empty columns. This property is available only if the dashboard was created using Salesforce Classic.| |components|[Components](#dashboard-results)|Layout for dashboards. This property is available only if the dashboard was created using Lightning Experience.| **Columns** |Property|Type|Description| |--------|----|-----------| |components|Integer[]|Ordered list of components in a column (top to bottom). Components are represented by indices into the array of components in the dashboard metadata object.| **Components** |Property|Type|Description| |--------|----|-----------| |colspan|Integer|Width of component in columns. For example, if `colspan=3`, then the component spans 3 columns.| |rowspan|Integer|Height of component in rows. For example, if `rowspan=4`, then the component spans 4 rows.| |column|String|Column position on the grid.| |row|String|Row position on the grid.| **Running user** |Property|Type|Description| |--------|----|-----------| |displayName|String|Display name of running user.| |id|String|Returns the ID of the running user specified for the dashboard. If the dashboard is configured to run as the viewing user, returns the user ID of the dashboard creator.| **picklistColors** |Property|Type|Description| |--------|----|-----------| |color|String|The color in hexadecimal format used to represent a picklist value.| **Properties (for Report component type)** |Property|Type|Description| |--------|----|-----------| |aggregates|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |autoSelectColumns|Boolean|Indicates whether groupings and aggregates are automatically selected. Valid values are `true` and `false`.| |drillUrl|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |groupings|[Groupings](#dashboard-results)|Report groupings included in the dashboard.| |maxRows|Number|Maximum number of rows to be rendered, based on the sort value.| |reportFormat|String|The format of a dashboard’s source report.| |sort|[Sort](#dashboard-results)|Used in previous releases. In this release (v46.0) and later assign the value `null`, except for tabular Lightning table format or Top N source report for any chart type. In these two cases, the value matches the following object.| |useReportChart|Boolean|Indicates whether the dashboard component uses the chart as defined in the report. Valid values are `true` and `false`.| |useReportTableSetting|Boolean|Indicates whether the widget uses report settings when a Lightning table is added to a dashboard. Valid values are `true` and `false`.| |visualizationProperties|[Visualization properties (Chart)](#dashboard-results), [Visualization properties (Table)](#dashboard-results), [Visualization properties (FlexTable)](#dashboard-results), [Visualization properties (Metric)](#dashboard-results), or [Visualization properties (Gauge)](#dashboard-results)|Type-specific visualization properties.| |visualizationType|String|Type of the component. Value can be `Bar`, `Column`, `Donut`, `Funnel`, `Gauge`, `Line`, `Metric`, `Pie`, `Scatter`, `Table`, or `FlexTable` (as of API version 41.0).| Example sort object for tabular Lightning table format or Top N source report: ```nolang { "sort" : { "column" : "TYPE", "sortOrder" : "asc", "type" : "label" }, } ``` **Groupings** |Property|Type|Description| |--------|----|-----------| |inheritedReportSort|String|For this release (v46.0) and later, keep the default value of `null` for this property and use sortOrder instead.| |name|String|Developer name of the grouping.| |sortAggregate|String|Name of the aggregate by which the dashboard component sorts. If `null`, the dashboard component sorts by label or matches/inverts the report's sort order.| |sortOrder|String|Specifies whether the dashboard component sorts in ascending (`Asc`) or descending (`Desc`) order.| **Sort** |Property|Type|Description| |--------|----|-----------| |inheritedReportSort|String|For this release (v46.0) and later, keep the default value of `null` for this property and use sortOrder instead.| |sortAggregate|String|Name of the aggregate by which the dashboard component sorts. If `null`, the dashboard component sorts by label or matches/inverts the report's sort order.| |sortOrder|String|Specifies whether the dashboard component sorts in ascending (`Asc`) or descending (`Desc`) order.| **Visualization properties (Chart)** |Property|Type|Description| |--------|----|-----------| |axisRange|String|Range of values specified for the axis.| |decimalPrecision|Integer|The number of decimal places included in a dashboard metric, chart, or table, 0–5. If -1 or null, Salesforce automatically sets the number of decimal places.| |displayUnits|String|Specify how to display numbers. Possible values are `whole` (display the true value without rounding), `auto` (round to the nearest thousand, million, and so on as a shortened value—for example, 1,876 displays as 1.9k; summaries still use the true value), `hundreds`, `thousands`, `millions`, `billions`, `trillions` (display as multiples of that unit), or `null` (customizing how numbers display isn’t applicable).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |groupByType|String|Type of second-level grouping.| |legendPosition|String|Position of legend on the grid. Valid values are `bottom`, `right`, and `none`.| |showValues|Boolean|Indicates whether to include values in the chart. Valid values are `true` and `false`.| **Visualization properties (Table)** |Property|Type|Description| |--------|----|-----------| |breakPoints|[Break point](#dashboard-results)[]|Break points for the table component.| |displayUnits|String|Specify how to display numbers. Possible values are `whole` (display the true value without rounding), `auto` (round to the nearest thousand, million, and so on as a shortened value—for example, 1,876 displays as 1.9k; summaries still use the true value), `hundreds`, `thousands`, `millions`, `billions`, `trillions` (display as multiples of that unit), or `null` (customizing how numbers display isn’t applicable).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |tableColumns|[Table columns](#dashboard-results)[]|Columns of the table component.| **Visualization properties (FlexTable)** FlexTable is the API name of the Lightning dashboard table. |Property|Type|Description| |--------|----|-----------| |displayUnits|String|Specifies how to display numbers in dashboard components. Each value displays numbers as a multiple of a hundred (`hundreds`), thousand (`thousands`), million (`millions`), billion (`billions`), or trillion (`trillions`).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |flexTableType|String|Specifies whether the table shows detail columns or groups and measures. Possible values are `tabular` (the table displays detail rows) or `summary` (the table displays groups and measures).| |showChatterPhotos|Boolean|Indicates whether Chatter photos are shown (`true`) or not (`false`).| |tableColumns|[Table columns](#dashboard-results)[]|Columns of the table component.| **Visualization properties (Metric)** |Property|Type|Description| |--------|----|-----------| |breakPoints|[Break point](#dashboard-results)[]|Break points for the metric component.| |displayUnits|String|Specify how to display numbers. Possible values are `whole` (display the true value without rounding), `auto` (round to the nearest thousand, million, and so on as a shortened value—for example, 1,876 displays as 1.9k; summaries still use the true value), `hundreds`, `thousands`, `millions`, `billions`, `trillions` (display as multiples of that unit), or `null` (customizing how numbers display isn’t applicable).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |metricLabel|String|Label for the metric component.| **Visualization properties (Gauge)** |Property|Type|Description| |--------|----|-----------| |breakPoints|[Break point](#dashboard-results)[]|Break points for the gauge component.| |displayUnits|String|Specify how to display numbers. Possible values are `whole` (display the true value without rounding), `auto` (round to the nearest thousand, million, and so on as a shortened value—for example, 1,876 displays as 1.9k; summaries still use the true value), `hundreds`, `thousands`, `millions`, `billions`, `trillions` (display as multiples of that unit), or `null` (customizing how numbers display isn’t applicable).| |drillURL|String|Specifies a custom link destination from a dashboard component. If `drillURL` begins with `https://` or `http://` or `www.`, then the link directs to a website outside of Salesforce. Otherwise, the destination is a site inside Salesforce. Null if no link is set.| |showPercentages|Boolean|Specify whether percentages are displayed (`true`) or not (`false`)| |showTotal|Boolean|Indicates whether the total is displayed (`true`) or not (`false`).| **Break point** |Property|Type|Description| |--------|----|-----------| |aggregateName|String|Aggregate column developer name that the break points have been applied to.| |breaks|[Break](#dashboard-results)[]|Break values for a break point.| **Break** |Property|Type|Description| |--------|----|-----------| |color|String|A hex value representing the color for the break point. A color value of black displays only 1 character (0) instead of 6 characters (000000).| |lowerBound|Number|Lower bound for the break point.| |upperBound|Number|Upper bound for the break point.| **Table columns** |Property|Type|Description| |--------|----|-----------| |column|String|Developer name for the aggregate or grouping column.| |isPercent|Boolean|Indicates whether the column value is shown as a percent (`true`) or not (`false`). Not supported for `FlexTables`.| |scale|Number|The number of decimal places for the column value. Not supported for `FlexTables`.| |showTotal|Boolean|Indicates whether the column shows the total (`true`) or not (`false`).| |type|String|Type of the column. Valid values are `detail`, `aggregate`, or `grouping`.| **Properties (for Visualforce page component type)** |Property|Type|Description| |--------|----|-----------| |pageName|String|Developer name of the Visualforce page.| |height|String|Height of the Visualforce page, in pixels.| **tableChatterPhotoUrls** |Property|Type|Description| |--------|----|-----------| |chatterPhotoUrl|String|URL pointing to a user's Chatter photo.| ## PUT Response body |Property|Type|Description| |--------|----|-----------| |statusUrl|String|URL of the status resource for the dashboard.| ## POST Request body |Property|Type|Description| |--------|----|-----------| |componentIds|Array of Strings|Dashboard component ids.| # Dashboard Status Returns the status for the specified dashboard. ## Syntax **URI:** `/services/data/vXX.X/analytics/dashboards/dashboardID/status` Or, with optional parameters: `/services/data/vXX.X/analytics/dashboards/dashboardID/status?runningUser=runningUserID&filter1=filter1ID&filter2=filter2ID&filter3=filter3ID` **Formats:** JSON **HTTP methods:** GET **Authentication:** `Authorization: Bearer token` **Parameters** The following optional parameters can be used with the GET method: |Parameter Name|Description| |--------------|-----------| |runningUser|ID of the running user. Gives an error if the user is not allowed to change the running user, or if the selected running user is invalid.| |filter1|ID of the selected filter option for the first filter. Gives an error if the filter option is invalid.| |filter2|ID of the selected filter option for the second filter. Gives an error if the filter option is invalid.| |filter3|ID of the selected filter option for the third filter. Gives an error if the filter option is invalid.| ## Response body |Property|Type|Description| |--------|----|-----------| |componentStatus|[Component status with id](#dashboard-status)[]|Status for each component of the dashboard. The order of the array is the same as in previous calls, unless the dashboard has changed in the meantime.| **Component status with id** |Property|Type|Description| |--------|----|-----------| |componentId|String|Unique ID of the dashboard component.| |refreshDate|Date and time string|Date and time of last refresh in ISO-8601 format.| |refreshStatus|String|Refresh status of the component. Value can be:
  • `IDLE`: The component is not currently being refreshed.
  • `RUNNING`: The component is currently being refreshed.
| # Dashboards The Dashboards API provides several resources for accessing and refreshing dashboards. Resources for the Dashboards API are available at `/services/data//analytics/dashboards`. You can query each resource with an HTTP method (such as GET). Use these resources to integrate dashboard data directly into your applications.
Resource Supported HTTP Method Description
Dashboard List

GET

POST

Returns a list of recently used dashboards.

Makes a copy of a dashboard.

Dashboard Results

GET

POST

PUT

PATCH

DELETE

Returns the metadata, data, and status for the specified dashboard.

Returns details about specified dashboard components.

Triggers a dashboard refresh.

Saves a dashboard.

Deletes a dashboard.

Dashboard Status GET Returns the status for the specified dashboard.
Dashboard Describe GET Returns metadata for the specified dashboard, including dashboard components, filters, layout, and the running user.
Dashboard Filter Options Analysis POST Verifies that dashboard filter options are compatible with report fields. Specify the reportId of a dashboard’s components’ source report.
# Dashboards Examples Learn how to refresh, create, edit, copy, and delete dashboards. - **[Get List of Recently Used Dashboards](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-get-list.md)** You can get a list of recently used dashboards by using the Dashboard resource. - **[Get Dashboard Results](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-get-results.md)** You can get dashboard metadata, data, and status by sending a GET request to the Dashboard Results resource. - **[Filter Dashboard Results](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-filter-results.md)** You can filter dashboard results, status, or refresh requests, by using filter parameters. - **[Get Dashboard Status](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-get-status.md)** You can get the dashboard status by sending a GET request to the Dashboard Status resource. - **[Refresh a Dashboard](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-refresh.md)** You can refresh a dashboard by using a PUT Dashboard Results request. Dynamic dashboards can also be refreshed via the REST API. - **[Save a Dashboard](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-save-dashboard.md)** You can save changes to a dashboard by sending a PATCH request to the Dashboard Results resource. - **[Save a Dashboard with a Custom Lightning Web Component (Beta)](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-save-lwc-in-dashboard.md)** You can save a dashboard with a custom Lightning web component by sending a PATCH request to the Dashboard Results resource. - **[Set a Sticky Dashboard Filter](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-set-filter.md)** Set a default filter value which gets applied to a dashboard when you open it. The default filter value you specify only applies to you (other people won’t see it when they open the dashboard). If you change the filter value while viewing the dashboard, then the filter value you set in the user interface overwrites the value you set via the API. To set sticky filters for a dashboard, `canUseStickyFilter` must equal `true`. - **[Return Details About Dashboard Components](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-example-return-details-about-dashboard-components.md)** Get details about one or more dashboard components using a POST request. - **[Get Dashboard Metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-example-get-dashboard-metadata.md)** Get details about dashboard metadata using a GET request. - **[Clone a Dashboard](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/sforce-analytics-rest-api-clone-dashboard.md)** Creates a copy of a dashboard by sending a POST request to the Dashboard List resource. - **[Delete a Dashboard](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/dashboards/analytics-api-dashboard-delete.md)** # Data Manipulation Functions A data manipulation function changes the data into the format required by the data serialization function (see the next section). You can apply a manipulation function on the results from a data selection or other data manipulation function. If the input data is `null`, the manipulation function returns `null`, unless otherwise specified. **note:** If data manipulation isn’t required, add a data serialization function to the results of the data selection functions. ## coalesce Function Returns the first non-null source from a list of sources. Useful for providing a default value in case a function returns a null value. ### Syntax ```javascript coalesce(source1, source2,...) ``` ### Arguments | Argument | Description | | -------- | ----------- | | source | (Required) Source can be the results of a data selection or other data manipulation function. The source can have any shape. | ### Example Function: ```javascript coalesce(cell(step1.selection, 0, "column1"), "green") ``` Output: The output is the result returned by `cell(step1.selection, 0, "column1")`. However, if `cell(step1.selection, 0, "column1")` returns `null`, then the output is ```nolang "green" ``` See Also - [Change the Map Type Based on a Toggle Widget](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-changing-map-type.md) ## concat Function Joins streams from multiple sources into a one- or two-dimensional array. Null sources are skipped. ### Syntax ```javascript concat(source1, source2,...) ``` ### Arguments | Argument | Description | | -------- | ----------- | | source | (Required) Each source can be the results of a data selection or other data manipulation function. Each source must be either a one- or two-dimensional array. An error occurs if you try to concatenate data from sources of different shapes. For example, the following function produces an error: `concat(["a", "b"], ["c", "d", "e"])`. | ### Examples Function: ```javascript concat(["a", "b"], ["c", "d"]) ``` Output: ```sql ["a", "b", "c", "d"] ``` --- Function: ```javascript concat([["a", "b"]], [["c", "d"]]) ``` Output: ```sql [["a", "b"], ["c", "d"]] ``` ## flatten Function Flattens a two-dimensional array into a one-dimensional array. ### Syntax ```javascript flatten(source) ``` ### Arguments | Argument | Description | | -------- | ----------- | | source | (Required) Source can be the results of a data selection or other data manipulation function. The source must be a two-dimensional array. Otherwise, an error occurs because there’s no reason to flatten a one-dimensional array or scalar. | ### Example Function: ```javascript flatten([["CDG", "SAN"], ["BLR", "HND"], ["SMF", "JFK"]]) ``` Output: ```sql ["CDG", "SAN", "BLR", "HND", "SMF", "JFK"] ``` ## join Function Converts a one- or two-dimensional array into a string by joining the elements using the specified token. An error occurs if the data has any other shape. ### Syntax ```javascript join(source, token) ``` ### Arguments | Argument | Description | | -------- | ----------- | | source | (Required) Source can be the results of a data selection or other data manipulation function. The source must be a two-dimensional array. Otherwise, an error occurs. | | token | (Required) Any string value, like `+` or `,`. | ### Examples Function: ```javascript join(["a", "b", "c"], "+") ``` Output: ```sql ["a+b+c"] ``` --- Function: ```javascript join([["a", "b", "c"], [1, 2]], "~") ``` Output: ```sql ["a~b~c~1~2"] ``` ## slice Function Selects one or more values from a one-dimensional array given a start and, optionally, an end position, and returns a one-dimensional array. An error occurs if the start value is greater than the end value. Negative indices are supported. ### Syntax ```javascript slice(source, start, end) ``` ### Arguments | Argument | Description | | -------- | ----------- | | source | (Required) Source can be the results of a data selection or other data manipulation function. The source can have any shape. | | start | (Required) Index that identifies the start value in the array. For example, `0` represents the first element in the array. | | end | (Optional) Index that identifies the end value in the array. | ### Example ```javascript slice(step.selection, -1, 0) ``` Returns the last selected row. ## toArray Function Converts scalars to a one-dimensional array, and one-dimensional arrays to a two-dimensional array. For example, use this function to convert the scalar result of a cell function to an array, which is required by compact-form measures, groups, and order clauses. The function returns an error if the input is a series of static one-dimensional arrays, a two-dimensional array, or a mix of scalars and one-dimensional arrays. ### Syntax ```javascript toArray (source1, source2,...) ``` ### Arguments | Argument | Description | | -------- | ----------- | | source | (Required) The input must be scalars, including static values, or one-dimensional arrays. | ### Examples Consider these Opportunities query result. | Oppty_Name | Owner | Region | Amount | Created_Date | | ---------- | ----- | -------- | ------ | ------------ | | Alpha | Danny | Americas | 1000 | 2/20/2017 | | Bravo | Danny | Americas | 500 | 4/15/2017 | | Charlie | Jeff | EMEA | 2000 | 5/1/2017 | These interactions use the Opportunities query as a source. | Interaction | Result | | ----------- | ------ | | `toArray( cell(Opportunities.selection, 0, "Region") )` | `["Americas"]` | | `toArray( "EMEA" )` | `["EMEA"]` | | `toArray( cell(Opportunities.selection, 0, "Region"), "EMEA" )` | `["Americas", "EMEA"]` | | `toArray( column(Opportunities.selection, ["Oppty_Name"]), column(Opportunities.selection, ["Region] )` | `[["Alpha", "Bravo", "Charlie"], ["Americas", "Americas", "EMEA"]]` | | `toArray( column(Opportunities.selection, ["Oppty_Name", "Region"]) )` | Error. The column interaction function returns a two-dimensional array, which is an invalid input. | | `toArray( [1, 2, 3], [4, 5, 6] )` | Error. The input can't be a series of static one-dimensional arrays. | ## valueAt Function Returns the single scalar value at the given index. ### Syntax ```javascript valueAt(source, index) ``` ### Arguments | Argument | Description | | -------- | ----------- | | source | (Required) Source can be the results of a data selection or other data manipulation function. The source can have any shape. | | index | (Required) Negative indexes are supported. If you specify an index that doesn't exist, the function returns null. | ### Example ```javascript valueAt(cell(step.selection, 0, "column"), -1) ``` Returns the last selected value. # Data Selection Functions A data selection function selects data from a source. The source can be either a selection or results of a query. The function returns a table of data, where each column has a name, and each row has an index, starting with 0. From the table, you can select one or more rows, one or more columns, or a cell to include in your interaction. In cases where multiple rows or columns of data are selected, the function returns a two-dimensional array. When a single row or single column is selected, the function returns a one-dimensional array. When a cell is selected, the function returns a scalar value. The function returns null if the source is empty. If the function tries to select data that doesn’t exist, an interaction error occurs. For example, the table only has two rows, but you try to select data from the third row. ## cell Function Returns a single cell of data as a scalar, like `"This salesperson rocks"`, `2`, or `null`. An error occurs if the `rowIndex` isn’t an integer, the `columnName` isn’t a string, or the cell doesn’t exist in the table. ### Syntax ```nolang cell(source, rowIndex, columnName) ``` ### Arguments | Argument | Description | | ---------- | --------------------------------------------------------------------- | | source | (Required) Specify the name of the query and `selection` or `result`. | | rowIndex | (Required) Specify the row using its index. Row index starts at 0. | | columnName | (Required) Specify the column name. | This example is based on the `myStep` source query. Assume that `myStep.selection` retrieves these rows from the query. ```json [ {stateName: ‘CA’, Amount:100}, {stateName: ‘TX’, Amount:200}, {stateName: ‘OR’’, Amount:300}, {stateName: ‘AL’, Amount:400}, ] ``` Although CRM Analytics doesn’t store this data as a table, let’s show the data in this format to make it easier to understand the example. | (row index) | stateName | Amount | | ----------- | --------- | ------ | | 0 | CA | 100 | | 1 | TX | 200 | | 2 | OR | 300 | | 3 | AL | 400 | ### Example Function: ```javascript cell(myStep.selection, 1, "stateName") ``` Output: ```nolang "TX" ``` ## column Function Returns one column of data as a one-dimensional array or multiple columns of data as a two-dimensional array. ### Syntax ```javascript column(source, [columnNames...]) ``` ### Arguments | Argument | Description | | ----------- | --------------- | | source | (Required) Specify the name of the query and `selection` or `result`. | | columnNames | (Required) Specify an array of column names. The order of the listed columns affects the order that the columns appear in the output. The order is important for serialization functions. For example, the `asOrder` function requires the first element to be a field name and the second to be the direction. | These examples are based on the `myStep` source query. Assume that `myQuery.selection` retrieves these rows from the query. ```json [ {stateName: ‘CA’, Amount:100}, {stateName: ‘TX’, Amount:200}, {stateName: ‘OR’’, Amount:300}, {stateName: ‘AL’, Amount:400}, ] ``` ### Examples Although CRM Analytics doesn’t store this data as a table, let’s show the data in this format to make it easier to understand the examples that follow. | (row index) | stateName | Amount | | ----------- | --------- | ------ | | 0 | CA | 100 | | 1 | TX | 200 | | 2 | OR | 300 | | 3 | AL | 400 | Function: ```javascript column(myStep.selection, ["stateName"]) ``` Output: ```sql ["CA", "TX", "OR", "AL"] ``` --- Function: ```javascript column(myStep.selection, []) ``` Output: ```sql [ ["CA", "TX", "OR", "AL"], ["100", "200”," "300", "400"] ] ``` ## row Function Returns one row of data as a one-dimensional array or multiple rows as a two-dimensional array. For selection interactions, you typically use this function to return the first row or all rows. For results interactions, you might want specific rows. To determine the row index, display the query results in a values table. ### Syntax ```javascript row(source), [rowIndices...], [columnNames...]) ``` ### Arguments | Argument | Description | | -------- | ----------- | | source | (Required) Specify the name of the query and `selection` or `result`. | | rowIndices | (Required) Specify an array of row indices, where each element of the array identifies a row. Row index `0` identifies the first row. To include all rows, specify an empty array.| | columnNames | (Optional) Specify an array of column names to select and order them. If not specified, all columns are selected and every row has the same order of columns. However, that order isn't guaranteed to be the same across different queries. | These examples are based on the `myStep` source query. Assume that `myStep.selection` retrieves these rows from the query. ```json [ {stateName: ‘CA’, Amount:100}, {stateName: ‘TX’, Amount:200}, {stateName: ‘OR’’, Amount:300}, {stateName: ‘AL’, Amount:400}, ] ``` ### Examples Although CRM Analytics doesn’t store this data as a table, let’s show the data in this format to make it easier to understand the examples that follow. | (row index) | stateName | Amount | | ----------- | --------- | ------ | | 0 | CA | 100 | | 1 | TX | 200 | | 2 | OR | 300 | | 3 | AL | 400 | Function: ```javascript row(myStep.selection, [0], ["Amount"]) ``` Output: ```sql ["100"] ``` --- Function: ```javascript row(myStep.selection, [0,2], []) ``` Output: ```sql [ ["CA", "100"], ["OR", "300"] ] ``` --- Function: ```javascript row(myStep.selection, [], ["stateName"]) ``` Output: ```sql [ ["CA"], ["TX"], ["OR"], ["AL"] ] ``` --- Function: ```javascript row(myStep.selection, [0,2], ["stateName", "Amount"]) ``` Output: ```sql [ ["CA", "100"], ["OR", "300"] ] ``` # Data Serialization Functions Serialization functions convert the data into the form expected by the query in which the interaction is inserted. For example, if the interaction is used in a compact-form query, use the `asObject` function to format the data into a one-dimensional object. ## asDateRange Function Returns the date range filter condition as a string for a SAQL query. The date range is inclusive. Use the string as part of a filter based on dates. The input data must be a one- or two-dimensional array. If the input data is a one-dimensional array with two elements, the function uses the first element as the minimum and the second element as the maximum. Null results in `fieldName in all`, which applies no filter. To view an example of this function, see [Date Range Filter Interaction](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-filter-interactions.md#date-range-filter-interaction). ### Syntax ```javascript .asDateRange(fieldName) ``` ### Arguments | Argument | Description | | --------- | -------------------------------------- | | fieldName | (Required) The name of the date field. | This example is based on the `stepFoo` source query. Assume that `stepFoo.selection` retrieves this row from the query. ```json [{ "min": 1016504910000, "max": 1281655993000 }] ``` ### Example Function: ```javascript row(stepFoo.selection, [0], ["min", "max"]).asDateRange("date(year, month, day)"); ``` Output: ```sql date(year, month, day) in [dateRange([2002,3,19], [2010,8,12])] ``` See Also - [Date Range Filters](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-filter-date-range.md) ## asEquality Function Returns an equality or "in" filter condition as a string for a SAQL query. The input data must be a scalar, one-dimensional array, or a two-dimensional array. If a single field name is provided, the returned string contains the `in` operator for a one-dimensional array, `fieldName in ["foo", "bar"]`, or the equality operator for a scalar, `fieldName == "foo"`. If multiple field names are provided, the returned string contains a composite filter. For this case, a two-dimensional array is expected. The number of values in each array must match the number of specified fields. **note:** If the input to this function is `null`, the function returns ` is null`, where `` is the first field. For example, if `cell(step1.selection, 0, "column1")` evaluates to `null`, `cell(step1.selection, 0, "column1").asEquality("field1")` evaluates to `'field1' is null`. If there are no selected rows, `cell(step1.selection, "column1")`, the function evaluates to ` in all`. ### Syntax ```javascript .asEquality(fieldName) ``` ### Arguments | Argument | Description | | --------- | --------------------------------- | | fieldName | (Required) The name of the field. | These examples are based on the `myStep` source query. Assume that `myStep.selection` is: ```json [ {grouping: "first", measure: 19} {grouping: "second", measure: 32} ] ``` ### Examples Function: ```javascript cell(myStep.selection, 1, "measure").asEquality("bar"); ``` Output: ```sql bar == 32 ``` --- Function: ```javascript column(myStep.selection, ["grouping"]).asEquality("bar"); ``` Output: ```sql bar in ['first','second'] ``` --- This example illustrates how a lack of input data is handled. Imagine that `myStep.selection` resolves as ```nolang [] ``` Function: ```javascript cell(myStep.selection, 0, "value").asEquality("bar"); ``` Output: ```sql 'bar' in all ``` --- The next examples illustrate how null values and empty arrays are evaluated when present in the `myStep.selection`. ```json [ { "grouping": "first", "measure": null }, { "grouping": "second", "measure": 32 } ] ``` Function: ```javascript cell(myStep.selection, 0, "measure").asEquality("bar"); ``` Output: ```sql 'bar' is null ``` ```sql [ {label: "Bananas", value: []} ] ``` Function: ```javascript cell(myStep.selection, 0, "value").asEquality("bar"); ``` Output ```sql 'bar' in all ``` See Also - [Filters](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-filter-equality.md) ## asGrouping Function Returns a grouping as a string. Can also return multiple groupings The input data must be a scalar or one-dimensional array of groupings. Null results in a `group by all`. To view an example of this function, see [Group and Project Interaction](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-filter-interactions.md#group-and-projection-interaction). ### Syntax ```javascript .asGrouping() ``` Let's look at some examples where the selection determines the groupings in a SAQL-form query. These examples are based on the `stepFoo` source query. Assume that `stepFoo.selection` retrieves these rows from the query. ```json [ {grouping: "first", alias: "foo"} {grouping: "second", alias: "bar"} ] ``` ### Examples Function: ```javascript cell(stepFoo.selection, 1, "grouping").asGrouping(); ``` Output: ```sql 'second' ``` --- Function: To make the interaction return multiple fields for the grouping, replace the `cell` interaction function with a `column` function and update the arguments. ```javascript column(stepFoo.selection, ["grouping"]).asGrouping(); ``` Output: ```sql ('first', 'second') ``` See Also - [Group Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-group.md) ## asObject Function Passes data through with no serialization. Returns data as an object that is an array of strings. ### Syntax ```javascript .asObject() ``` ### Examples Function: ```javascript column(StaticMeasureNamesStep.selection, [\"value\"]).asObject() ``` --- Function: ```javascript cell(static_1.selection, 0, \"value\").asObject() ``` See Also - [Bind Parts of a Query](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-query-parts.md) ## asProjection Function Returns the query expression and alias as a string that you can use to project a field in a query. The query expression determines the value of the field. The alias is the field label. Use this function to write a `foreach` statement for a field projection. The function concatenates the query expression `as` and the field label in this format. ```nolang <`query_expression`> as <`field_label`> ``` Here's a sample projection that rounds the price to two decimals and stores the result in the `SalesPrice` field. ```javascript q = foreach q generate round(Price, 2) as SalesPrice; ``` In this sample, `round(Price, 2)` is the expression and `SalesPrice` is the field label. ### Syntax ```javascript .asProjection() ``` This example is based on the `stepFoo` source query. Assume that `stepFoo.selection` retrieves these rows from the query. ```json [ {expression: "first", alias: "foo"} {expression: "second", alias: "bar"} ] ``` ### Examples Function: ```javascript stepFoo.selection, [0], ["expression", "alias"]).asProjection() ``` Output: ```sql first as 'foo' ``` --- Function: ```javascript stepFoo.selection, [], ["expression", "alias"]).asProjection() ``` Output: ```sql first as 'foo', second as 'bar' ``` See Also - [Projection Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-projection.md) ## asRange Function Returns a range filter condition as a string for a SAQL query. The range is inclusive. The input data must be a one-dimensional array with at least two elements. The function uses the first as the minimum and the second as the maximum. Null results in `fieldName in all`, which applies no filter. To view an example of this function, see [Range Filter Interaction](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-filter-interactions.md#range-filter-interaction). ### Syntax ```javascript .asRange(fieldName) ``` ### Arguments | Argument | Description | | --------- | --------------------------------- | | fieldName | (Required) The name of the field. | This example is based on the `myStep` source query. Assume that `myStep.selection` retrieves these rows from the query. ```json [ {grouping: "first", measure: 19} {grouping: "second", measure: 32} ] ``` ### Example Function: ```javascript row(myStep.selection, [0], ["min", "max"]).asRange("bar"); ``` Output: ```sql bar >= 19 && bar <= 32 ``` See Also - [Range Filters](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-filter-range.md) ## asString Function Serializes a scalar, one-dimensional array, or a two-dimensional array as a string. Escapes double quotes in strings. ### Syntax ```javascript .asString() ``` ### Examples Function: ```javascript cell(stepOpportunity.selection, 1, "measure").asString(); ``` --- Function: ```javascript cell(color_1.result, 0, "color").asString(); ``` See Also - [Highlight Values with Color Coding](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-color-code-values.md) # Data Serialization Functions for SQL and SOQL SQL and SOQL serialization functions convert the data into the form expected by the query in which the interaction is inserted. ## asSQLGrouping Function Returns a grouping as a string in a SQL or SOQL query. Can also return multiple groupings. The input data must be a scalar or a one-dimensional array of groupings. Null or no results returns an ungrouped query. ### Syntax ```javascript .asSQLGrouping(SQLType, includeKeywords) ``` ### Arguments | Argument | Description | | --------- | -------------------------------------- | | `SQLType` | (Required) Specify SQL or SOQL variant. Valid values are `dataset`, `snowflake`, and `sobject`. | | `includeKeywords` | (Optional) The default value is `false`. | **note:** For SOQL, use `sobject`. Let's look at some examples where the selection detemines the groupings in a SQL or SOQL-form query. These examples are based on the `stepFoo` source query. Assume that `stepFoo.selection` retrieves these rows from the query. ```json [ {grouping: "first", alias: "foo"} {grouping: "second", alias: "bar"} ] ``` ### Examples Function: ```javascript (cell(stepFoo.selection, 0, "grouping").asSQLGrouping("snowflake", true)) ``` Output in standard or Snowflake live dataset: ```sql GROUP BY "first" ``` Function: ```javascript (cell(stepFoo.selection, 0, "grouping").asSQLGrouping("sboject", true)) ``` Output in SOQL: ```sql GROUP BY first ``` --- Function: ```javascript (cell(stepFoo.selection, 0, "grouping").asSQLGrouping("snowflake", false)) ``` Output in standard or Snowflake live dataset: ```sql "first" ``` Function: ```javascript (cell(stepFoo.selection, 0, "grouping").asSQLGrouping("sboject", false)) ``` Output in SOQL: ```sql first ``` --- To make the interaction return multiple fields for the grouping, replace the `cell` interaction function with a `column` function and update the arguments. Function: ```javascript (column(stepFoo.selection, ["alias"]).asSQLGrouping("snowflake", true)) ``` Output in standard or Snowflake live dataset: ```sql GROUP BY "foo", "bar" ``` Function: ```javascript (column(stepFoo.selection, ["alias"]).asSQLGrouping("sobject", true)) ``` Output in SOQL: ```sql GROUP BY foo, bar ``` --- Function: ```javascript (column(stepFoo.selection, ["alias"]).asSQLGrouping("snowflake", false)) ``` Output in standard or Snowflake live dataset: ```sql "foo", "bar" ``` Function: ```javascript (column(stepFoo.selection, ["alias"]).asSQLGrouping("sobject", false)) ``` Output in SOQL: ```sql foo, bar ``` ## asSQLHaving Function Returns the grouped results for a SQL or SOQL query restricted by a conditional filter logic applied on aggregate functions. This function is similar to the `asSQLWHERE` function. ### Syntax ```javascript .asSQLHaving(SQLType, includeKeywords) ``` ### Arguments | Argument | Description | | --------- | -------------------------------------- | | `SQLType` | (Required) Specify SQL or SOQL variant. Valid values are `dataset`, `snowflake`, and `sobject`. | | `includeKeywords` | (Optional) The default value is `false`. | **note:** For SOQL, use `sobject`. These examples are based on the `stepFoo` source query. **note:** The `<` and `>=<=` operators aren't supported. ### Examples Function: ```javascript (toArray("SUM(Revenue)", ">",column(stepFoo.selection, ["Revenue"]).asSQLHaving("snowflake", true)) ``` Output in standard or Snowflake live dataset: ```sql HAVING "SUM(Revenue)" > 10 ``` Function: ```javascript (toArray("SUM(Revenue)", ">",column(stepFoo.selection, ["Revenue"]).asSQLHaving("sobject", true)) ``` Output in SOQL: ```sql HAVING SUM(Revenue) > 10 ``` --- Function: ```javascript (toArray("SUM(Revenue)", ">",column(stepFoo.selection, ["Revenue"]).asSQLHaving("dataset")) ``` Output in standard or Snowflake live dataset: ```sql "SUM(Revenue)" > 10 ``` Output in SOQL: ```sql SUM(Revenue) > 10 ``` --- Function: ```javascript ([].asSQLHaving('dataset')) or ([].asSQLHaving('dataset', 'false')) ``` Output in standard, Snowflake live dataset, or SOQL: ```sql "" ``` ## asSQLOrder Function Returns the sort order as a string for a SQL or SOQL query. The input data must be scalar, one-dimensional, or a two-dimensional array. A two-dimensional array is treated as a tuple of interactions. ### Syntax ```javascript .asSQLOrder(SQLType, includeKeywords) ``` ### Arguments | Argument | Description | | --------- | -------------------------------------- | | `SQLType` | (Required) Specify SQL or SOQL variant. Valid values are `dataset`, `snowflake`, and `sobject`. | | `includeKeywords` | (Optional) The default value is `false`. | **note:** For SOQL, use `sobject`. These examples are based on the `stepFoo` source query. Assume that `stepFoo.selection` retrieves these rows from the query. ```json values: [ {order: "first", direction: "desc"} {order: "second", direction: "asc"} ] ``` ### Examples Function: ```javascript (cell(stepFoo.selection, 0, "order").asSQLOrder("snowflake", true)) ``` Output in standard or Snowflake live dataset: ```sql ORDER BY "first" ``` Function: ```javascript (cell(stepFoo.selection, 0, "order").asSQLOrder("sboject", true)) ``` Output in SOQL: ```sql ORDER BY first ``` --- Function: ```javascript (cell(stepFoo.selection,["order")].asSQLOrder("snowflake")) ``` Output in standard or Snowflake live dataset: ```sql "first", "second" ``` Function: ```javascript (cell(stepFoo.selection, ["order"]).asSQLOrder("sboject")) ``` Output in SOQL: ```sql first, second ``` --- Function: ```javascript (row(stepFoo.selection, [], ["order", "direction"]).asSQLOrder("snowflake", true)) ``` Output in standard or Snowflake live dataset: ```sql ORDER BY "first" DESC, "second", ASC ``` Function: ```javascript (row(stepFoo.selection, [], ["order", "direction"]).asSQLOrder("sobject", true)) ``` Output in SOQL: ```sql ORDER BY first DESC, second ASC ``` ## asSQLSelect Function Returns the SQL or SOQL expression and alias as a string that you can use to project a field in the query. The query expression determines the value of the field. The alias is the field label. ### Syntax ```javascript .asSQLSelect(SQLType) ``` ### Arguments | Argument | Description | | --------- | -------------------------------------- | | `SQLType` | (Required) Specify SQL or SOQL variant. Valid values are `dataset`, `snowflake`, and `sobject`. | **note:** For SOQL, use `sobject`. These examples are based on the `stepFoo` source query. Assume that `stepFoo.selection` retrieves these rows from the query. ```json values: [ {expression: "SUM("first")", alias: "foo"} {expression: "second", alias: "bar"} ] ``` ### Examples Function: ```javascript (row(stepFoo.selection, [0], ["expression", "alias"]).asSQLSelect("snowflake")) ``` Output in standard or Snowflake live dataset: ```sql SUM("first") AS "foo" ``` Function: ```javascript (row(stepFoo.selection, [0], ["expression", "alias"]).asSQLSelect("sobject")) ``` Output in SOQL: ```sql SUM("first") foo ``` --- Function: ```javascript (row(stepFoo.selection, [0], ["expression"]).asSQLSelect("snowflake")) ``` Output in standard or Snowflake live dataset: ```sql SUM("first") ``` Function: ```javascript (row(stepFoo.selection, [0], ["expression"]).asSQLSelect("sobject")) ``` Output in SOQL: ```sql SUM("first") ``` --- Function: ```javascript (row(stepFoo.selection, [], ["expression", "alias"]).asSQLSelect("snowflake")) ``` Output in standard or Snowflake live dataset: ```sql SUM("first") AS "foo", "second" AS "bar" ``` Function: ```javascript (row(stepFoo.selection, [], ["expression", "alias"]).asSQLSelect("sobject")) ``` Output in SOQL: ```sql SUM("first") foo, second bar ``` ## asSQLWhere Function Returns the SQL or SOQL query results restricted by a conditional filter logic applied on a measure, dimension, or date. ### Syntax ```javascript .asSQLWhere(SQLType, includeKeywords) ``` ### Arguments | Argument | Description | | --------- | -------------------------------------- | | `SQLType` | (Required) Specify SQL or SOQL variant. Valid values are `dataset`, `snowflake`, and `sobject`. | | `includeKeywords` | (Optional) The default is false. | **note:** For SOQL, use `sobject`. These examples are based on the `stepFoo` source query. ### Examples Function: ```javascript ([].asSQLWhere('dataset')) or ([].asSQLWhere('dataset', 'false')) ``` Output in standard dataset, Snowflake live dataset, or SOQL: ```sql "" ``` --- Function: ```javascript ((toArray("foo", "IN", column(stepFoo.selection, ["foo"])).asSQLWhere("snowflake", true)) toArray("foo", "IN", column(stepFoo.selection, ["foo"]) => ["foo", "IN", ["a", "b"]] ``` Output in standard or Snowflake live dataset: ```sql WHERE "foo" in ('a', 'b') ``` Function: ```javascript ((toArray("foo", "IN", column(stepFoo.selection, ["foo"])).asSQLWhere("sobject", true)) toArray("foo", "IN", column(stepFoo.selection, ["foo"]) => ["foo", "IN", ["a", "b"]] ``` Output in SOQL: ```sql WHERE foo in ('a', 'b') ``` --- Function: ```javascript ((toArray("bar", "><", column(stepFoo.selection, ["bar"])).asSQLWhere("snowflake", true)) toArray("bar", "><", column(stepFoo.selection, ["bar"]) => ["bar", "><", [10, 100]] ``` Output in standard or Snowflake live dataset: ```sql "bar" > 10 AND "bar" < 100 ``` Function: ```javascript ((toArray("bar", "><", column(stepFoo.selection, ["bar"])).asSQLWhere("sobject", true)) toArray("bar", "><", column(stepFoo.selection, ["bar"]) => ["bar", "><", [10, 100]] ``` Output in SOQL: ```sql bar > 10 ad bar < 100 ``` --- *Multiple Filters* Function: ```javascript (toArray(toArray("foo", "IN", column(stepFoo.selection, ["foo"]), toArray("bar", "><;", column(stepFoo.selection, ["bar"]))).asSQLWhere("snowflake", true)) ``` Output in standard or Snowflake live dataset: ```sql WHERE "foo" IN ('a', 'b') AND ("bar" > 10 AND "bar" < 100) ``` Function: ```javascript (toArray(toArray("foo", "IN", column(stepFoo.selection, ["foo"]), toArray("bar", "><;", column(stepFoo.selection, ["bar"]))).asSQLWhere("sobject", true)) ``` Output in SOQL: ```sql WHERE foo IN ('a', 'b') AND (bar > 10 AND bar < 100) ``` --- Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("dataset", true)) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [1016504910000, 1281655993000]] ``` Output in standard dataset: ```sql WHERE ("CreatedDate" >= DATE '2002-3-19' AND "CreatedDate" <= '2010-8-12')) ``` Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("snowflake", true)) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [1016504910000, 1281655993000]] ``` Output in Snowflake live dataset: ```sql WHERE ("CreatedDate" BETWEEN to_date('2002-3-19') AND to_date('2010-8-12')) ``` Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("sobject", true)) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [1016504910000, 1281655993000]] ``` Output in SOQL: ```sql WHERE (CreatedDate >= DATE 2002-3-19 AND CreatedDate <= 2010-8-12)) ``` --- Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("dataset")) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [null, 1281655993000]] ``` Output in standard dataset: ```sql "CreatedDate" <= DATE '2010-8-12' ``` Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("snowflake")) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [null, 1281655993000]] ``` Output in Snowflake live dataset: ```sql "CreatedDate" <= to_date('2010-8-12') ``` Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("sobject")) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [null, 1281655993000]] ``` Output in SOQL: ```sql CreatedDate <= 2010-8-12 ``` --- Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("dataset", true)) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [2015, 8, 1], [2021, 3, 1]] ``` Output in standard dataset: ```sql WHERE ("CreatedDate" >= DATE '2015-8-1' AND CreatedDate <= '2021-3-1')) ``` Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("snowflake", true)) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [2015, 8, 1], [2021, 3, 1]] ``` Output in Snowflake live dataset: ```sql WHERE ("CreatedDate" BETWEEN to_date('2015-8-1') AND to_date('2021-3-1')) ``` Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("sobject", true)) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", [2015, 8, 1], [2021, 3, 1]] ``` Output in SOQL: ```sql WHERE (CreatedDate >= 2015-8-1 AND CreatedDate <= 2021-3-1)) ``` --- Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("snowflake", true)) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", ["quarter", -2], ["quarter", 3] ``` Output in Snowflake live dataset: ```sql WHERE ("CreatedDate" >= date_trunc(quarter, dateadd(quarter, -2, current_date()))AND "CreatedDate" <>= date_trunc(quarter, dateadd(quarter, 3, current_date()))) ``` Function: ```javascript (toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])).asSQLWhere("sobject", true)) toArray("CreatedDate", "BETWEEN", column(stepFoo.selection, ["CreatedDate"])) => ["CreatedDate", "BETWEEN", ["quarter", -2], ["quarter", 3] ``` Output in SOQL: ```sql WHERE (CreatedDate >= LAST_N_QUARTERS:2 AND CreatedDate <>= NEXT_N_QUARTERS:3) ``` # dataSourceLinks JSON The `dataSourceLinks` section defines all data sources configured for the dashboard. For more information about connected data sources, see [Configure Cross-Dataset Faceting with Connected Data Sources](https://help.salesforce.com/articleView?id=bi_dashboard_data_source_connections.htm). ## Example ```nolang "dataSourceLinks": [ { "fields": [ { "dataSourceName": "ServiceOpportunity3", "dataSourceType": "saql", "fieldName": "AccountId" }, { "dataSourceName": "account", "dataSourceType": "saql", "fieldName": "Id" } ], "label": "ServiceOpportunities Dataset to Account Dataset: Account ID", "name": "Link_970" }, { "fields": [ { "dataSourceName": "ServiceOpportunity3", "dataSourceType": "saql", "fieldName": "StageName" }, { "dataSourceName": "Static_Opp_Stage_1", "dataSourceType": "static", "fieldName": "value" } ], "label": "Static Opp Stage to ServiceOpportunities Dataset", "name": "Link_953" } ] ``` - **[dataSourceLinks Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-datasourcelinksproperties.md)** The `dataSourceLinks` key defines all data source connections for the dashboard. It contains a separate node for each connection. Each connection has properties about each data source. # dataSourceLinks Properties The `dataSourceLinks` key defines all data source connections for the dashboard. It contains a separate node for each connection. Each connection has properties about each data source. | Property Name | Type | Details | | ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `fields` | Array | List of data sources included in the connection. Each data source contains the following properties.
  • dataSourceName: API name of the dataset or ID of the static step.
  • dataSourceType: The type of data source: "`dataset`" for a dataset or "`static`" for a static step.
  • fieldName: Name of the field used to match records between the data sources.
Included in the Dashboard Designer's user interface. | | `label` | String | Display label for the data source connection. Included in the Dashboard Designer's user interface. | | `name` | String | API name of the data source connection. Not included in the Dashboard Designer's user interface. | # Date Formats For Date fields, specify the format of the date by using one of the following supported formats. Dates must match the format exactly and can't have any extra text. **note:** The date formats listed here are the two-digit versions for date fields that use leading zeros; for example, **03/06/14 09:01:06 AM**. If a date field doesn't have leading zeros, use the one-digit version of the format. For example, use the format `M/d/yy h:m:s a` for date values such as **3/6/14 9:1:26 AM**. If you use a two-digit format for a field, rows containing values with one-digit date parts will fail. The timestamp part of each date format is optional. The Quarter date format isn’t supported. | Format | Sample Value | | ---------------------------- | ------------------------ | | yyyy-MM-dd'T'HH:mm:ss.SSS'Z' | 2014-04-29T16:53:34.000Z | | yy-MM-dd'T'HH:mm:ss.SSS'Z' | 14-04-29T16:53:34.000Z | | yyyy-MM-dd'T'HH:mm:ss'Z' | 2014-04-29T16:53:34Z | | yy-MM-dd'T'HH:mm:ss'Z' | 14-04-29T16:53:34Z | | yyyy-MM-dd HH:mm:ss | 2014-06-03 11:31:45 | | yy-MM-dd HH:mm:ss | 14-06-03 11:31:45 | | dd.MM.yyyy HH:mm:ss | 03.06.2014 11:31:45 | | dd.MM.yy HH:mm:ss | 03.06.14 11:31:45 | | dd/MM/yyyy HH:mm:ss | 03/06/2014 11:31:45 | | dd/MM/yy HH:mm:ss | 03/06/14 11:31:45 | | dd/MM/yyyy hh:mm:ss a | 03/06/2014 11:31:45 AM | | dd/MM/yy hh:mm:ss a | 03/06/14 11:31:45 AM | | dd-MM-yyyy HH:mm:ss | 03-06-2014 11:31:45 | | dd-MM-yy HH:mm:ss | 03-06-14 11:31:45 | | dd-MM-yyyy hh:mm:ss a | 03-06-2014 11:31:45 AM | | dd-MM-yy hh:mm:ss a | 03-06-14 11:31:45 AM | | MM/dd/yyyy hh:mm:ss a | 06/03/2014 11:31:45 AM | | MM/dd/yy hh:mm:ss a | 06/03/14 11:31:45 AM | | MM-dd-yyyy hh:mm:ss a | 06-03-2014 11:31:45 AM | | MM-dd-yy hh:mm:ss a | 06-03-14 11:31:45 AM | | HH:mm:ss dd/MM/yyyy | 11:31:45 03/06/2014 | | HH:mm:ss dd/MM/yy | 11:31:45 03/06/14 | These formats use the following symbols: | Symbol | Meaning | | ---------- | --------------------------------------------------- | | yyyy or yy | Four-digit year (yyyy) or two-digit year (yy) | | MM | Two-digit month (01–12) | | M | One-digit month when month less than 10 (1–12) | | dd | Two-digit day (01–31) | | d | One-digit day when day less than 10 (1–31) | | 'T' | A separator that indicates that time of day follows | | HH | Two-digit hour (00–23) | | H | One-digit hour when hour less than 10 (0–23) | | mm | Two-digit minute (00–59) | | m | One-digit minute when minute less than 10 (0–59) | | ss | Two-digit second (00–59) | | s | One-digit second when second less than 10 (0–59) | | SSS | Optional three-digit milliseconds (000–999) | | 'Z' | The reference UTC time zone | # `date` Functions Use `date` functions in rules to manipulate date values in asset JSON at runtime. For instance, a `date` function can update date values to a standardized format. If a user enters a date value in the wizard, the `date` function can update the format at runtime. ## `format` Parameters: `Date dateValue`, `String format` Returns: `String` Recursive: Not supported Description: Returns a formatted string of the provided date/time value based on the provided format. ### Example This function call: ```json {    "format": "${date:format('01/02/2022', 'yyyy/MM/dd')}" } ``` Returns: ```json {    "format": "2022/01/02" } ``` ## `parse` Parameters: `String dateValue`, `String format` Returns: `Date` Recursive: Not supported Description: Parses the given date/time value based on the provided format. ### Example This function call: ```json {    "parsedDate": "${date:parse('01/02/2022', 'yyyy/MM/dd')}" } ``` Returns: ```json {    "parsedDate": "2022/01/02" } ``` ## `add` Parameters: `Date dateValue`, `String field`, `int delta` Returns: `Date` Recursive: Not supported Description: Performs date/time arithmetic on the provided dateValue on the provided valid date field (year, month, day, hour, minute, second, millisecond) using the delta value to increase or decrease the date field by. ### Example This function call: ```json {    "addedDate": "${date:add('2022/01/03 14:22:00', 'year', 3)}" } ``` Returns: ```json {    "addedDate": "2025/01/03 14:22:00" } ``` ## `now` Parameters: None Returns: `Date` Recursive: Not supported Description: Returns the current date and time. ### Example This function call: ```json {    "rightNow": "${date:now()}" } ``` Returns: ```json {    "rightNow": 1790715391598 } ``` # Date Functions Use SAQL date functions to perform time-based analysis. ## Understanding How Date Information is Uploaded to Analytics When you upload a date field to Analytics, it creates dimension and measure fields to contain the date and time information. You can use SAQL date functions to convert the dimensions and measures to dates. You can then use the dates to sort, filter, and group data in your SAQL queries. For example, suppose that you upload a dataset that contains the CloseDate date field. ![Screenshot of a datasaet.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_upload_dataset.png) During the dataflow processing, Analytics creates these fields. All the fields are dimensions, except for the epoch fields, which are measures. | Field | Description | | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | CloseDate | A dimension containing the date and time. For example, 2018-02-25T00:00:03.000Z. You can’t use this string in a date filter. Instead, ‘cast’ it to a date type using `toDate()`. | | CloseDate (Day) | Dimension containing the day in the month, for example 30. | | CloseDate (Hour) | Dimension containing the hour, for example, 11. If the original date did not contain the hour, this field contains 00. | | CloseDate (Minute) | Dimension containing the minute, for example, 59. If the original date did not contain the minute, this field contains 00 | | CloseDate (Month) | Dimension containing the month, for example, 12. | | CloseDate(Quarter) | Dimension containing the quarter, for example, 4. | | CloseDate (Second) | Dimension containing the second, for example, 59. If the original date did not contain the second, this field contains 00. | | CloseDate (Week) | Dimension containing the week, for example, 52. | | CloseDate_day_epoch | Measure containing the UNIX epoch time, which is the number of days that have elapsed since 00:00:00, Thursday, 1 January 1970. | | CloseDate_sec_epoch | Measure containing the Unix epoch time in seconds. Seconds epoch time is the number of seconds that have elapsed since 00:00:00, Thursday, 1 January 1970. | Analytics creates fields ending in `_Fiscal` for dates associated with a custom fiscal year. Querying dates with this field works the same way as it does for standard fiscal years. - **[daysBetween()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date-between.md)** Returns the number of days between two dates. This function is only valid in a `foreach` statement. - **[date_diff()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date-diff.md)** Returns the amount of time between two dates. This function is only valid in a `foreach` statement. - **[now()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date-now.md)** Returns the current datetime in UTC. This function is only valid in a `foreach` statement. - **[date()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-datefilter.md)** Returns a date that can be used in a filter. This function takes a year, a month, and a day dimension as input. - **[toDate()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-todate.md)** Converts a string or Unix epoch seconds to a date. Returns a date that can be used in another function such as `daysBetween(​)`. The returned date cannot be used in a filter. - **[date_to_epoch()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date2epoch.md)** Converts a date to Unix epoch seconds. - **[date_to_string()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date2string.md)** Converts a date to a string. - **[toString()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-2string.md)** Converts a date to a string. - **[Time-Based Filtering](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-daterange.md)** SAQL gives you many ways to specify the range of dates that you want to look at, such as "all ops from the last fiscal quarter" or "all cases from the last seven days". - **[Day in the Week, Month, Quarter, or Year](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-dayinweek.md)** Returns the day in the specified time period for a given date. These functions answer questions like "do we close more deals at the beginning or end of a quarter?". - **[First Day in the Week, Month, Quarter, or Year](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-firstday.md)** Returns the date of the first day in the specified week, month, quarter, or year. - **[Last Day in the Week, Month, Quarter, or Year](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-lastday.md)** Returns the date of the last day in the specified week, month, quarter, or year. - **[Number of Days in the Month, Quarter, or Year](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-numdays.md)** Returns the number of days in the month, quarter, or year for the specified date. - **[Date Formats](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-date-formats.md)** For Date fields, specify the format of the date by using one of the following supported formats. Dates must match the format exactly and can't have any extra text. **See Also** - [Analyze Your Data Over Time](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-dates.md) # Date Functions SQL for CRM Analytics supports `DateTime`, `DateOnly`, and `Date` date types. If you’re familiar with standard SQL, the `DateOnly` type corresponds with SQL’s `Date` type and the `DateTime` type corresponds with SQL's `Timestamp` type. `DateTime` and `DateOnly` have custom time zone support. If your org doesn’t support custom time zones, then use the `Date` type, which supports GMT date information only. A `DateTime` date type follows this format. ```nolang DateTimeFormat = "2006-01-02 15:04:05" ``` A `DateOnly` date type follows this format. ```nolang DateOnlyFormat = "2006-01-02" ``` - **[Access Parts of a Date](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-access.md)** Use the `EXTRACT()` function to access parts of a date. You can use `EXTRACT()` in projections, filtering, grouping and ordering. - **[Project a Date Field](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-project.md)** To project a date field of type `DateTime`, use the `EXTRACT()` function on the date field in the `SELECT` statement. - **[Filter By Date Parts or Date Field](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-filter.md)** To filter by a date part, use the `WHERE` clause with the `EXTRACT()` function, and pass it the desired date parts (year, month, or day). To filter by a date field, use the `WHERE` clause with a logical operator. - **[Group By Date Part](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-group.md)** To group by date part, use the `GROUP BY` clause and the `EXTRACT()` function. Pass `EXTRACT()` the date parts to isolate. - **[Order By Date Part](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-order.md)** To order by date part, use `EXTRACT()` on the date field with the `ORDER BY` clause. The query returns the count of rows containing these same values and orders the results by count descending. - **[Project a Custom Fiscal Date Part](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-cfy.md)** To project a custom fiscal date part, pass custom fiscal date parts to the `EXTRACT()` function. - **[Day in Week, Month, Quarter or Year Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-order-functions.md)** Use the following functions to find the position of a day within a week, month, quarter, or year. - **[First and Last Day in the Week, Month, Quarter or Year Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-first-last-functions.md)** Use the following functions to find the first and last week, month, quarter, or year for both standard and fiscal calendars. These functions accept `DateTime`, `DateOnly`, and legacy input values. They return the same type as the input value. # Date Range Filter Interactions Use the `asDateRange()` serialization function to bind filters based on date ranges. You can create filters using absolute or relative date ranges. If the input data is a one-dimensional array with two elements: - And both elements are numbers, CRM Analytics assumes the numbers are epoch times. `[1016504910000, 1016504910000]` results in `fieldName in [dateRange([2002,3,19], [2010,8,12])]`. - Otherwise, the first element is used as the minimum and the second element is used as the maximum. `["current day", "1 month ahead"]` results in `fieldName in ["current day".."1 month ahead"]`. If one of the elements is null, the date range is open-ended. `["1 month ago", null]` results in `fieldName in ["1 month ago"..]`. If the input data is a two-dimensional array where the outer array has two elements: - And both nested arrays have two elements, CRM Analytics assumes the data is in the relative date array format. `[["year", -2], ["year", 1]]` results in`fieldName in ["2 years ago".."1 year ahead"]`. - And both nested arrays have 3 elements, the nested arrays are passed to the SAQL `dateRange()` function. `[[2015, 2, 1], [2016, 2, 1]]` results in `fieldName in [dateRange([2015,2,1], [2016,2,1])]`. If the input data is `null`, the result is `fieldName in all`, which doesn’t filter anything. ## Binding to a Date Filter Widget For instance, let’s say you make a selection in a date widget that returns this absolute date range (in epoch format). ```json [ {min: 1016504910000, max: 1281655993000} ] ``` You can create a filter using the returned selection data. ```javascript q = filter q by {{row(queryFoo.selection, [0], ["min", "max"]).asDateRange("date(year, month, day)")}}; ``` After evaluating the binding, CRM Analytics produces this date range filter. ```javascript q = filter q by date(year, month, day) in [dateRange([2002,3,19], [2010,8,12])]; ``` For relative dates, assume that the date widget returns these relative datas based on your selection. ```json [ {min: ["quarter", -2], max: ["quarter", 3]} ] ``` After evaluation, this data range filters results. ```javascript q = filter q by date(year, month, day) in ["2 quarters ago".."3 quarters ahead"]; ``` ## Binding to a Custom List of Date Ranges Create a custom query with rows for each custom date range. You can specify ranges using absolute or relative dates. To filter with absolute ranges, the results of the custom query must return absolute dates. ```json [ {label: "8/30/15 - 8/30/16", range: [[2015, 8, 30], [2016, 8, 30]]} {label: "7/30/16 - 8/30/16", range: [[2016, 7, 30], [2016, 8, 30]]} ] ``` You can create the filter based on the selected value of the source query. ```javascript q = filter q by {{cell(queryFoo.selection, 0, "range").asDateRange("date(year, month, day)")}}; ``` After CRM Analytics evaluates the binding, the filter is as shown. ```javascript q = filter q by date(year, month, day) in [dateRange([2015, 8, 30], [2016, 8, 30])]; ``` To filter with relative ranges, the source query results must be as shown. ```json [ {"label": "YTD", "range": ["1 year ago", "current day"]} {"label": "MTD", "range": ["1 month ago", "current day"]} {"label": "Everything up to today", "range": [null, "current day"]} ] ``` You can use this binding to create a filter based on the selected value of the source query. ```javascript q = filter q by {{cell(queryFoo.selection, 0, "range").asDateRange("date(year, month, day)")}}; ``` After CRM Analytics evaluates the binding, the filter becomes: ```javascript q = filter q by date(year, month, day) in ["1 year ago".."current day"]; ``` You can also create an open-ended range filter by specifying null as one of the relative date keywords in the source query. The bound filter is as shown. ```javascript q = filter q by {{cell(queryFoo.selection, 2, "range").asDateRange("date(year, month, day)")}}; ``` After CRM Analytics evaluates the binding, the filter becomes: ```javascript q = filter q by date(year, month, day) in [.."current day"]; ``` **note:** The SAQL function [`date_to_epoch()`](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_saql.meta/bi_dev_guide_saql/bi_saql_functions_date2epoch.htm) returns epoch seconds, but date range filters bindings require milliseconds. # date_diff() Returns the amount of time between two dates. This function is only valid in a `foreach` statement. ## Syntax `date_diff(datepart,startdate,enddate)` _datepart_ specifies how you want to measure the time interval: - `year` - `month` - `quarter` - `day` - `week` - `hour` - `minute` - `second` _startdate_ specifies the start date. _enddate_ specifies the end date. ## Usage Returns the time difference between two dates in years, months, or days. For example, `date_diff("year", toDate("31-12-2015", "dd-MM-yyyy"), toDate("1-1-2016", "dd-MM-yyyy"))` returns 1. If _startdate_ is after _enddate_, the difference is returned as a negative number. You must use `date_diff()` in a `foreach()` statement. You cannot use this function in `group by`, `order by`, or `filter` statements. The maximum amount of time returned is 9,223,372,036,854,775,807 nanoseconds. This maximum amount of time can be measured in any supported _datepart_ value (nanoseconds aren't supported). For example, in days, the maximum amount of time returned is 106,751.99 days (excluding leap seconds). ## Example - How Many Weeks Did Each Opportunity Take to Close? Use `date_diff()` with _datepart_ = `week` to calculate how long, in weeks, it took to close each opportunity. ```nolang q = load "DTC_Opportunity"; q = foreach q generate date_diff("week", toDate(CreatedDate_sec_epoch), toDate(CloseDate_sec_epoch) ) as 'Weeks to Close'; q = order q by 'Weeks to Close'; ``` ## Example - How Long Ago Was an Opportunity Closed? Use `date_diff()` with _datepart_ = `month` to calculate how many months have passed since each opportunity closed. Use `now()` as the end date. ```nolang q = load "DTC_Opportunity"; q = foreach q generate date_diff("month", toDate(CloseDate_sec_epoch), now() ) as 'Months Since Close'; q = order q by 'Months Since Close'; ``` **See Also** - [daysBetween()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date-between.md) - [now()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date-now.md) - [Calculate How Long Activities Take](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-daysbetween.md) - [date_diff(datepart, startdate, enddate)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-functions-timezone-date-diff.md) # date_diff(datepart, startdate, enddate) Returns an integer representing the interval that has elapsed between two dates. | | | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `datepart` | The part of the date to use when calculating the difference. Allowed values are:
  • `year`
  • `month`
  • `quarter`
  • `day`
  • `week`
  • `hour`
  • `minute`
  • `second`
| | `startdate` | The start date of the interval. | | `enddate` | The end date of the interval. | The difference between two dates is calculated based on the difference in the indicated date parts. For example, the year difference between two dates is calculated by subtracting the year part of `startdate` from the year part of `enddate`. Suppose `OrderDate` and `ShipDate` are `DateOnly` types. The order date is 31-1-2017 and the ship date is 1-2-2018. The year difference between the order date and ship date is 1. ```nolang date_diff("year", 'OrderDate' 'ShipDate'); ``` The month difference between the order date and ship date is 2. ```nolang date_diff("month", 'OrderDate' 'ShipDate'); ``` If _`startdate`_ is after `enddate`, the result is a negative integer. **See Also** - [date_diff()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-date-diff.md) # date_to_epoch() Converts a date to Unix epoch seconds. ## Syntax `date_to_epoch(date)` ## Usage This function must take a `toDate()` or `now(​)` function as its first argument. ## Example ```nolang q = foreach q generate date_to_epoch(toDate(​”yyyy-mm-dd hh:mm:ss”)) as ds1; ``` # date_to_string() Converts a date to a string. ## Syntax `date_to_string(date, formatString)` For the allowed formats, see [Date Formats](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-date-formats.md). **note:** This function is identical to `toString()`. ## Usage This function must take a `toDate()` or `now(​)` function as its first argument. ## Example ```nolang q = foreach q generate date_to_string(now(​), "yyyy-MM-dd HH:mm:ss") as ds1; ``` # date_to_string(DateTime | DateOnly, format) Converts a date to a string. This function takes a `DateTime`, `DateOnly`, or `now()` as its first argument. For the allowed formats, see the Date Formats section in [Date Formats](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-date-formats.md). Use `date_to_string()` to display the close date for your opportunities in the format `yyyy-MM-dd.`. `CloseDate` must be a `DateTime` or `DateOnly` type. ```nolang q = foreach q generate date_to_string('CloseDate', "yyyy-MM-dd") as 'Close Date'; ``` If `CloseDate` is a `Date` type, convert it to a `DateOnly` type with `toDate()`. ```nolang q = foreach q generate date_to_string(toDate('CloseDate', "yyyy-MM-dd"), "yyyy-MM-dd") as 'Close Date'; ``` # date() Returns a date that can be used in a filter. This function takes a year, a month, and a day dimension as input. ## Syntax `date(year, month, day)` ## Usage Specify the year, month, and day. Each input value must be a date dimension type. ```nolang date('OrderDate_Year', 'OrderDate_Month', 'OrderDate_Day') ``` ## Example Which opportunities have your reps closed in the past 30 days? Use `date()` to select records with a close date in the past 30 days. ```nolang q = load "DTC_Opportunity"; -- use date() to create a date that you can use in a filter -- 'CloseDate_Year', 'CloseDate_Month', and 'CloseDate_Day' are date fields in the DTC_Opportunity data set q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["30 days ago".."current day"]; q = group q by 'Account_Owner'; q = foreach q generate 'Account_Owner' as 'Account_Owner', sum('Amount') as 'sum_Amount'; q = order q by 'Account_Owner' asc; ``` **See Also** - [toDate()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-todate.md) - [Time-Based Filtering](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-daterange.md) # Dates in XMD Specify date conventions for Analytics dashboards and lenses. ```nolang "dates" : [ { "alias" : "Order_Date", "label" : "Order Date", "firstDayOfWeek" : -1, "fiscalMonthOffset":0, "fields" : { "day" : "Order_Date_Day", "epochDay" : "Order_Date_day_epoch", "epochSecond" : "Order_Date_sec_epoch", "fullField" : "Order_Date", "hour" : "Order_Date_Hour", "minute" : "Order_Date_Minute", "month" : "Order_Date_Month", "quarter" : "Order_Date_Quarter", "second" : "Order_Date_Second", "week" : "Order_Date_Week", "year" : "Order_Date_Year" } }, { "alias" : "Ship_Date", "label" : "Ship Date", "firstDayOfWeek" : -1, "fiscalMonthOffset":0, "fields" : { "day" : "Ship_Date_Day", "epochDay" : "Ship_Date_day_epoch", "epochSecond" : "Ship_Date_sec_epoch", "fullField" : "Ship_Date", "hour" : "Ship_Date_Hour", "minute" : "Ship_Date_Minute", "month" : "Ship_Date_Month", "quarter" : "Ship_Date_Quarter", "second" : "Ship_Date_Second", "week" : "Ship_Date_Week", "year" : "Ship_Date_Year" }, "showInExplorer" : false } ], ``` The `dates` section can have the following parameters. | Parameter | Description | | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | alias | Identifier (API name) for the dataset field used to generate the date part fields in the dataset. For example, Order_Date generates Order_Date_Month and Order_Date_Minute. | | fields | Array of the date part fields, like CloseDate*Day, CloseDate_Year, and CloseDate_Hour. Specify all date parts. If `fiscalMonthOffset` is set in the dataflow or XMD file for CSV data, you must also specify fiscal date parts, like CloseDate_Week_Fiscal. To specify a date part, use the format `*`. For example, for the week date part for the CloseDate field, enter`CloseDate_Week`. | | firstDayOfWeek | This parameter is deprecated at the dataset level. You can set this property in the [sfdcDigest transformation](https://help.salesforce.com/articleView?id=bi_integrate_salesforce_extract_transformation_operation.htm) for Salesforce data or in the metadata (schema) file for CSV uploads (using the UI or External Data API). | | fiscalMonthOffset | This parameter is deprecated at the dataset level. You can set this property in the [sfdcDigest transformation](https://help.salesforce.com/articleView?id=bi_integrate_salesforce_extract_transformation_operation.htm) for Salesforce data or in the metadata (schema) file for CSV uploads (using the UI or External Data API). | | label | Display name for the dataset field, up to 40 characters. Example: `"label": "Closing Date"` | | showInExplorer | (Boolean) Indicates whether the dataset field can be selected from the dashboard designer or explorer when creating dashboards and lenses. Even if `showInExplorer` is `false`, you can still use the field for SAQL queries, manually adding it in JSON, and accessing it using the Analytics REST API. Example: `"showInExplorer": true` | In the dataset XMD file, if the user defines a label for a date field, the label value is used as the alias value for that field when the dataset is generated. For more information about date parts and the first day of the week, see [Date Handling in Datasets](https://help.salesforce.com/articleView?id=bi_integrate_date_generation.htm). # Dates Outside Ranges Defined by Custom Fiscal Year If your query includes a date that falls outside of a range defined by an inherited fiscal year, SAQL does not return data for that date. If a date falls outside of a range defined by an inherited custom fiscal year from Salesforce, then SAQL returns `null` for that date. When grouping by a date field that includes dates outside a range defined by an inherited custom fiscal year, no group is returned for undefined dates. If you group data based on non-fiscal periods, dates that aren’t included in a custom fiscal year return data as expected. ## Example If your fiscal year ends in March 2021, and a date field, `CreatedDate`, is in April 2021, grouping by `CreatedDate_Month_Fiscal` returns `null` or no group for April 2021. Grouping by `CreatedDate_Month` returns data as expected. Consider this example dataset. | Opportunity Name | Created Date | Amount | | ---------------- | ------------ | ------ | | Widgets | 2/1/2017 | 100 | | Widgets | 2/1/2018 | 100 | | Widgets | 2/1/2019 | 100 | | Widgets | 2/1/2020 | 100 | | Widgets | 2/1/2021 | 100 | | Widgets | 2/1/2022 | 100 | | Widgets | 2/1/2023 | 100 | In Salesforce, you have custom fiscal years defined as January 1 to December 31 for each year from 2018 through 2022. Inherit them in Analytics by using the **Start Date** setting. When running a query like this: ```nolang q = load "opportunities"; q = foreach q generate 'CreatedDate' as 'Created Date', CreatedDate_Year_Fiscal as 'Fiscal Year'; q = limit q 2000; ``` SAQL returns these results: | Created Date | Fiscal Year | | ------------ | ----------- | | 2/1/2017 | - | | 2/1/2018 | 2018 | | 2/1/2019 | 2019 | | 2/1/2020 | 2020 | | 2/1/2021 | 2021 | | 2/1/2022 | 2022 | | 2/1/2023 | - | Because a custom fiscal year definition doesn’t include 2/1/2017 or 2/1/2023, SAQL returns `null`. Now, let’s group the dataset. ```nolang q = load "opportunities"; q = group q by 'CreatedDate_Year_Fiscal'; q = foreach q generate 'CreatedDate_Year_Fiscal' as 'Fiscal Year', count() as 'Count'; q = order q by 'CreatedDate_Year_Fiscal'; q = limit q 2000; ``` SAQL returns these results: | Fiscal Year | Count | | ----------- | ----- | | 2018 | 1 | | 2019 | 1 | | 2020 | 1 | | 2021 | 1 | | 2022 | 1 | Since the custom fiscal year definition doesn’t include 2/1/2017 or 2/1/2023, the query excludes these dates from the results. # Day in the Week, Month, Quarter, or Year Returns the day in the specified time period for a given date. These functions answer questions like "do we close more deals at the beginning or end of a quarter?". ## Example Suppose that you want to see on which day of the week most deals are closed. Use `day_in_week(date)`. ```nolang q = load "Data"; q = foreach q generate day_in_week(toDate('CloseDate_sec_epoch')) as 'Day In Week Closed'; q = group q by 'Day In Week Closed'; q = foreach q generate 'Day In Week Closed' as 'Day In Week Closed', count() as 'count'; q = order q by 'count' desc; ``` The resulting data displays the number of opportunities closed, grouped by the day of the week that the opportunities were closed on. ![Diagram showing number of close opps, grouped by day of the week they were closed.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_dayInWeek.png) It looks like most opportunities are closed on Thursday (day 5). ## day_in_week(date) Returns an integer representing the day of the week for a specific date, where 1 = Sunday, 2 = Monday, etc. ```nolang q = foreach q generate day_in_week(toDate('CloseDate_sec_epoch')) as 'Day In Week Closed'; ``` ## day_in_month(date) Returns an integer representing the day of the month for a specific date. ```nolang q = foreach q generate day_in_month(toDate('CloseDate_sec_epoch')) as 'Day in Month Closed'; ``` ## day_in_quarter(date) Returns an integer representing the day of the quarter for a specific date. ```nolang q = foreach q generate day_in_quarter(toDate('CloseDate_sec_epoch')) as 'Day in Quarter Closed'; ``` ## day_in_year(date) Returns an integer representing the day of the year for a specific date. ```nolang q = foreach q generate day_in_year(toDate('CloseDate_sec_epoch')) as 'Day in Year Closed'; ``` # Day in Week, Month, Quarter or Year Functions Use the following functions to find the position of a day within a week, month, quarter, or year. Date position functions take this syntax. ```nolang SELECT EXTRACT (FUNCTIONNAME FROM DATE) AS DATEALIAS FROM DATASET; ``` - **[Day of Week](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-dow.md)** Returns an integer that represents the day of the week for a specific date. - **[Day of Month](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-day.md)** Returns an integer that represents the day of the month for a specific date. - **[Day of Quarter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-doq.md)** Returns an integer that represents the day of the quarter for a specific date. The first quarter of the year begins on January 1. - **[Day of Year](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-doy.md)** Returns an integer that represents the day of the year for a specific date. # Day of Month Returns an integer that represents the day of the month for a specific date. ## Example ```nolang SELECT OrderDate as "date", EXTRACT (DAY FROM OrderDate) as "day_of_month" FROM "dates_sample_data"; ``` | date | day_of_month | | ------------------- | ------------ | | 2015-01-21 15:30:00 | 21 | | 2015-01-21 00:00:00 | 21 | | 2015-01-31 10:00:30 | 31 | | 2015-02-03 15:30:00 | 3 | | 2016-01-21 23:59:59 | 21 | | 2015-10-31 23:59:59 | 31 | | 2015-12-03 00:00:00 | 3 | | 2016-01-11 03:30:00 | 11 | | 2016-01-11 03:30:00 | 11 | # Day of Quarter Returns an integer that represents the day of the quarter for a specific date. The first quarter of the year begins on January 1. ## Example ```nolang SELECT OrderDate as "date", EXTRACT (DOQ FROM OrderDate) as "day_of_quarter" FROM "dates_sample_data"; ``` | date | day_of_quarter | | ------------------- | -------------- | | 2015-01-21 15:30:00 | 21 | | 2015-01-21 00:00:00 | 21 | | 2015-01-31 10:00:30 | 31 | | 2015-02-03 15:30:00 | 34 | | 2016-01-21 23:59:59 | 21 | | 2015-10-31 23:59:59 | 31 | | 2015-12-03 00:00:00 | 64 | | 2016-01-11 03:30:00 | 11 | | 2016-01-11 03:30:00 | 11 | # Day of Week Returns an integer that represents the day of the week for a specific date. ## Example ```nolang SELECT OrderDate as "date", EXTRACT (DOW FROM OrderDate) as "day_of_week" FROM "dates_sample_data"; ``` | date | day_of_week | | ------------------- | ----------- | | 2015-01-21 15:30:00 | 3 | | 2015-01-21 00:00:00 | 3 | | 2015-01-31 10:00:30 | 6 | | 2015-02-03 15:30:00 | 2 | | 2016-01-21 23:59:59 | 4 | | 2015-10-31 23:59:59 | 6 | | 2015-12-03 00:00:00 | 4 | | 2016-01-11 03:30:00 | 1 | | 2016-01-11 03:30:00 | 1 | # Day of Year Returns an integer that represents the day of the year for a specific date. ## Example ```nolang SELECT OrderDate as "date", EXTRACT (DOY FROM OrderDate) as "day_of_year" FROM "dates_sample_data"; ``` | date | day_of_year | | ------------------- | ----------- | | 2015-01-21 15:30:00 | 21 | | 2015-01-21 00:00:00 | 21 | | 2015-01-31 10:00:30 | 31 | | 2015-02-03 15:30:00 | 34 | | 2016-01-21 23:59:59 | 21 | | 2015-10-31 23:59:59 | 304 | | 2015-12-03 00:00:00 | 337 | | 2016-01-11 03:30:00 | 11 | | 2016-01-11 03:30:00 | 11 | # day_in_month(date) Returns an integer representing the day of the month for a specific date. ```nolang q = foreach q generate day_in_month('OrderDate') as "Day in Month"; ``` # day_in_quarter(date) Returns an integer representing the day of the quarter for a specific date. ```nolang q = foreach q generate day_in_quarter('OrderDate') as "Day in Quarter"; ``` # day_in_week(date) Returns an integer representing the day of the week for a specific date. 1 = Sunday, 2 = Monday and so on. ```nolang q = foreach q generate day_in_week('OrderDate') as "Day in Week"; ``` # day_in_year(date) Returns an integer representing the day of the year for a specific date. ```nolang q = foreach q generate day_in_year('OrderDate') as "Day in Year"; ``` # daysBetween() Returns the number of days between two dates. This function is only valid in a `foreach` statement. ## Syntax `daysBetween(date1, date2)` _date1_ specifies the start date. _date2_ specifies the end date. ## Usage If _date1_ is after _date2_, the number of days returned is a negative number. You must use `daysBetween()` in a `foreach()` statement. You cannot use this function in `group by`, `order by`, or `filter` statements. ## Example How many days did it take to close each opportunity? Use `daysBetween()`. ```nolang q = load "DTC_Opportunity"; q = foreach q generate daysBetween(toDate(CreatedDate_sec_epoch), toDate(CloseDate_sec_epoch) ) as 'Days to Close'; q = order q by 'Days to Close'; ``` ## Example How long has each opportunity been open for, in days? Use `daysBetween()` and `now()`. ```nolang q = load "DTC_Opportunity"; q = filter q by 'Closed' == "false"; q = foreach q generate daysBetween(toDate(CreatedDate_sec_epoch), now() ) as 'Days to Close'; q = order q by 'Days to Close'; ``` **See Also** - [date_diff()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date-diff.md) - [Calculate How Long Activities Take](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-daysbetween.md) - [daysBetween(date1, date2)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-functions-timezone-days-between.md) # daysBetween(date1, date2) Returns the number of days between two dates as an integer. For example, display the number of days to close a deal. `OpenDate` and `CloseDate` fields can be `DateTime` or `DateOnly`. ```nolang q = foreach q generate daysBetween('OpenDate','CloseDate') as "Days to Close"; ``` **See Also** - [daysBetween()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-date-between.md) # Debug the Template CRM Analytics provides debug logs for templated apps to inspect the app creation lifecycle. These debug logs give you visibility into asset creation and the processing of any rules or Apex configuration modifier classes that you created. Use the debug logs during template testing when app creation isn’t working as expected. These steps cover setting up your trace flag to create your debug logs, creating your app to generate debug logs, and viewing the generated debug logs. 1. From Setup, in the **Quick Find** box, enter Debug Logs, then click **Debug Logs**. 2. Click **New**. 3. Select the entity to trace. For apps created in CRM Analytics Studio, the entity type must be `User` and the entity name must be your username. For apps created by the auto-install process, the entity type must be `Automated Process`. 4. The default time period to collect logs is set for 30 minutes. If a different or longer time period is required, update the **Start Date** or the **Expiration Date** values. 5. To create your debug level, click **New Debug Level**. Find the `Wave` debug log category and set it to `Finest`. Save your changes. You can reuse this debug level each time you create a trace flag. 6. To activate your trace flag, click **Save**. 7. From Analytics Studio, create an app from your template or kick off the automated process that creates the templated app. When app creation begins, debug logs are generated. 8. On the `Debug Logs` page, all debug logs are listed. To see your generated debug logs, refresh the page. ![The Debug Logs table with log files](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_debug_logs.png) 9. View the `Analytics Templated App Poller` log for details on the templated app creation process. Other logs listed from the templated app process include REST API calls to load the template wizard configuration and create the app folder and any Apex WaveTemplateConfigurationModifier output. If your template loads external data files, this process creates multiple `Analytics Templated App Poller` logs. Download any logs to save past the specified expiration date. Open your downloaded logs in a syslog viewer to allows filtering and easier reading. # Decode the Fact Map Depending on how you run a report, the fact map in the report results can contain values for only summary or both summary and detailed data. The fact map values are expressed as keys, which you can programmatically use to visualize the report data. Fact map keys provide an index into each section of a fact map, from which you can access summary and detailed data. The pattern for the fact map keys varies by report format as shown in this table. |Report format|Fact map key pattern| |-------------|--------------------| |Tabular|`T!T`: The grand total of a report. Both record data values and the grand total are represented by this key.| |Summary|`!T`: T refers to the row grand total.| |Matrix|`!`.| Each item in a row or column grouping is numbered starting with `0`. Here are some examples of fact map keys: |Fact Map Key|Description| |------------|-----------| |`0!T`|The first item in the first-level grouping.| |`1!T`|The second item in the first-level grouping.| |`0_0!T`|The first item in the first-level grouping and the first item in the second-level grouping.| |`0_1!T`|The first item in the first-level grouping and the second item in the second-level grouping.| Let’s look at examples of how fact map keys represent data as it appears in a Salesforce tabular, summary, or matrix report. ## Tabular Report Fact Map Here’s an example of an opportunities report in tabular format. Since tabular reports don’t have groupings, all of the record level data and summaries are expressed by the `T!T` key, which refers to the grand total. ![Tabular Report Fact Map Keys](https://developer.salesforce.com/media/salesforce_analytics_rest_api/analyticsapi_tabularfactmap.png) ## Summary Report Fact Map This example shows how the values in a summary report are represented in the fact map. ![Summary Report Fact Map Keys](https://developer.salesforce.com/media/salesforce_analytics_rest_api/analyticsapi_summaryfactmap.png) ||| |-|-| |**Fact Map Key**|**Description**| |`0!T`|Summary for the value of opportunities in the Prospecting stage.| |`1_0!T`|Summary of the probabilities for the Manufacturing opportunities in the Needs Analysis stage.| ## Matrix Report Fact Map Here’s an example of some fact map keys for data in a matrix opportunities report with a couple of row and column groupings. ![Matrix Fact Map Keys](https://developer.salesforce.com/media/salesforce_analytics_rest_api/analyticsapi_matrixfactmap.png) |**Fact Map Key**|**Description**| |----------------|---------------| |`0!0`|Total opportunity amount in the Prospecting stage in Q4 2010.| |`0_0!0_0`|Total opportunity amount in the Prospecting stage in the Manufacturing sector in October 2010.| |`2_1!1_1`|Total value of opportunities in the Value Proposition stage in the Technology sector in February 2011.| |`T!T`|Grand total summary for the report.| **See Also** - [Execute Sync](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-getreportrundata.md) - [Execute Async](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-instances-summaryasync.md) # degrees({n}) Returns the degrees value of `{n}` radians. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `radians()` returns `null`. `degrees({n})` takes the following syntax. ```nolang SELECT DEGREES(N) as ALIAS FROM DATASET; ``` ## Example This example returns the degrees of 1.57079 radians. ```nolang SELECT DEGREES(1.57079) as degreesValue FROM "Opportunity" LIMIT 1; ``` | degreesValue | | ------------ | | 90 | # degrees(n) Returns the degrees value of a radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `degrees()` returns `null`. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate degrees(radians) as degrees; ``` # Delete a Dashboard Delete a dashboard by sending a DELETE request to the Dashboard Results resource. Deleted dashboards are moved to the Recycle Bin. ## Example This DELETE request `/services/data/v34.0/analytics/dashboards/01ZD00000007S89MAE` to the Dashboard Results resource deletes the dashboard and returns a 204 HTTP response code with no content in the response body. # Delete an Analytics Notification Delete an Analytics Notification using a DELETE request. Once deleted, the analytics notification can't be recovered. Use a DELETE request on the [Analytics Notification](https://developer.salesforce.com/docs/analytics/reference/notifications/analytics-api-notifications-reference-notification.md) resource to delete an analytics notification. ## Example Usage `/services/data/v38.0/analytics/notifications/analytics notification ID` The analytic notification deletes and returns a 204 HTTP response code with no content in the response body. # Delete Reports Delete a report by sending a DELETE request to the Report resource. Deleted reports are moved to the Recycle Bin. **note:** Deleting a report also cancels any running async report jobs and deletes all scheduled notifications. ## Example This DELETE request `/services/data/v34.0/analytics/reports/00OD0000001cxIE` to the Report resource deletes the report and returns a 204 HTTP response code with no content in the response body. # Deploy Tableau Next Assets Tableau Next Marketplace is designed to share and deploy Tableau Next assets in an org and across orgs. The Marketplace uses the App Template Framework (ATF) to package and deploy assets. Use the ATF to create templates of single assets, like a Tableau Next dashboard, or multiple assets that depend on each other, like a Tableau Next workspace containing analytics assets and Data 360 data assets. An "app" is a collection of multiple, related assets. Creating templates is similar to packaging, but it’s more powerful. It ties assets together with tokenized IDs, and providing a run-time engine for customization of assets in each org. We recommend building templates to deploy your Tableau Next and Data 360 solutions to your production orgs and your customers. Standard packaging is an option as well, but you go further faster by using templates. To learn more about working with templates, see the App Template Framework developer guide. (_Coming Soon_). For details on packaging, see [Use CLI to Deploy Tableau Next Assets from Sandbox to Production](https://developer.salesforce.com/docs/analytics/tableau-next-isv-dev/guide/tn-deploy-assets-using-cli.md). # Describe Retrieves report, report type, and related metadata for a tabular, summary, or matrix report. - Report metadata gives information about the report as a whole. Tells you such things as, the report type, format, the fields that are summaries, row or column groupings, filters saved to the report, and so on. - Report type metadata tells you about all the fields available in the report type, those you can filter, and by what filter criteria. - Report extended metadata tells you about the fields that are summaries, groupings, and contain record details in the report. A property that displays null indicates that its value is not available. ## Resource URL ```nolang /services/data//analytics/reports//describe ``` ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |GET|Retrieves report, report type, and related metadata for a tabular, summary, or matrix report. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-get-reportmetadata.md).| ## Response Body |Property|Type|Description| |--------|----|-----------| |`reportMetadata`|[Report metadata](#describe)|Unique identifiers for groupings and summaries.| |`reportTypeMetadata`|[Report type metadata](#describe)|Fields in each section of a report type plus filter information for those fields.| |`reportExtendedMetadata`|[Report extended metadata](#describe)|Additional information about summaries and groupings.| **Report metadata** |Property|Type|Description| |--------|----|-----------| |`aggregates`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field can be referenced in a row-level formula (true) or not (false).| |`buckets`|[Bucket field](#describe)|Describes a bucket field.| |`chart`|[Chart[]](#describe)|Details about the chart used in a report.| |`crossFilters`|[Cross filter](#describe)[]|Cross filters applied to the report.| |`customDetailFormula`|[Custom Detail Formula](#describe)[]|An array of objects that describes row-level formulas.| |`customSummaryFormula`|[Custom summary formula](#describe)|Describes a custom summary formulas.| |`currency`|String|Report currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is `null` if the organization does not have Multi-Currency enabled.| |`dashboardSetting`|Name/value pair|Allows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The `Name` and `Value` fields in `dashboardSetting` are used as Grouping and Aggregate in dashboard components.| |`detailColumns`|Array of strings|Unique API names for the fields that have detailed data.| |`developerName`|String|Report API name.| |`division`|String|Determines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.| |`folderId`|String|ID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.| |`groupingsAcross`|[Groupings across[]](#describe)|Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.| |`groupingsDown`|[Groupings down[]](#describe)|Unique identities for each row grouping in a report. The identity is `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for grouping.| |`hasDetailRows`|Boolean|Indicates whether to include detailed data with the summary data.| |`hasRecordCount`|Boolean|Indicates whether the report shows the record count.| |`historicalSnapshotDates`|Array of strings|List of historical snapshot dates.| |`id`|String|Unique report ID.| |`name`|String|Display name of the report.| |`presentationOptions`|[Report presentation options](#describe)|Display options in the Lightning Report Builder.| |`reportBooleanFilter`|String|Logic to parse custom field filters. Value is `null` when filter logic is not specified.| |`reportFilters`|[Filter details[]](#describe)|List of each custom filter in the report along with the field name, filter operator, and filter value.| |`reportFormat`|String|Format of the report. Possible values are `TABULAR`, `SUMMARY`, `MATRIX`, or `MULTI_BLOCK`. The `MULTI_BLOCK` property is available in API version 43.0 and later.| |`reportType`|Report type|Unique API name and display name for the report type. `type` (string) is the unique identifier of the report type. `label` (string) is the display name of the report type.| |`scope`|String|Defines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`showGrandTotal`|Boolean|Indicates whether the report shows the grand total.| |`showSubtotals`|Boolean|Indicates whether the report shows subtotals, such as column or row totals.| |`sortBy`|Array of strings|API name of the field on which the report is sorted and the direction of the sort (asc or desc).| |`standardDateFilter`|Array of strings|Standard date filters available in reports. Each standard date filter contains the following properties: `column` (API name of the date field on which you filter the report data), `durationValue` (the range for which you want to run the report; the value is a date literal or 'CUSTOM.'), `startDate` (start date), and `endDate` (end date).| |`standardFilters`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsRoleHierarchy`|Boolean|Indicates whether the report type supports role hierarchy filtering (true) or not (false).| |`topRows`|[Top rows](#describe)|Describes a row limit filter applied to the report.| |`userOrHierarchyFilterId`|String|Unique user or role ID of the user or role used by the report's role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!{_column_name_} represents a unique count of values for the specified {_column_name_}. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.” ```nolang { ... "reportBooleanFilter": "(1 OR 2) AND 3", "reportFilters": [ { "value": "Analyst,Integrator,Press,Other", "column": "TYPE", "operator": "notEqual" }, { "value": "100,000", "column": "SALES", "operator": "greaterThan" }, { "value": "Small", "column": "Size", "operator": "notEqual" } ] } } ``` Example sortBy: ```nolang "sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}] ``` **Chart** |Property|Type|Description| |--------|----|-----------| |`chartType`|String|Type of chart.| |`groupings`|String|Report grouping.| |`hasLegend`|Boolean|Indicates whether the report has a legend.| |`showChartValues`|Boolean|Indicates whether the report shows chart values.| |`summaries`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`summaryAxisLocations`|String|Specifies the axis that shows the summary values. Valid values are `X` and `Y`.| |`title`|String|Name of the chart.| Example summaries identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. **Groupings down** |Property|Type|Description| |--------|----|-----------| |`name`|String|API name of the field used as a row grouping.| |`sortOrder`|String|Order in which data is sorted within a row grouping. Value can be `asc` for ascending order or `desc` for descending order.| |`dateGranularity`|String|Interval set on a date field that’s used as a row grouping. Value can be Day, Calendar Week, Calendar Month, Calendar Quarter, Calendar Year, Fiscal Quarter, Fiscal Year, Calendar Month in Year, or Calendar Day in Month.| |`sortAggregate`|String|Summary field that’s used to sort data within a grouping in a report that’s in summary format. Applies if you have the Aggregate Sort feature enabled as part of its pilot program. The value is null when data within a grouping is not sorted by a summary field. In this example, data grouped by Account Owner is sorted by the sum of Annual Revenue.| Example sortAggregate: ```nolang { "aggregates": ["s!SALES","RowCount"], "groupingsDown": [ { "name": "USERS.NAME", "sortOrder": "Desc", "dateGranularity": "None", "sortAggregate": "s!SALES" } ] } ``` **Report presentation options** |Property|Type|Description| |--------|----|-----------| |`hasStackedSummaries`|Boolean|Indicates whether stacked summaries are enabled in the report.| |`historicalColumns`|[Historical column presentation options](#describe)|Presentation options of the historical column.| Example historicalColumns presentation options: ```nolang "presentationOptions" : { "historicalColumns" : { "Opportunity__hd.CloseDate__hst" : { "decreaseIsPositive" : false, "showChanges" : false }, "Opportunity__hd.Amount__hst" : { "decreaseIsPositive" : false, "showChanges" : true } } } ``` **Historical column presentation options** |Property|Type|Description| |--------|----|-----------| |`decreaseIsPositive`|Boolean|Indicates whether a negative change (decrease in value) is displayed in green instead of red in Lightning Report Builder.| |`showChanges`|Boolean|Indicates whether to display a change column for a given historical column.| **Groupings across** |Property|Type|Description| |--------|----|-----------| |`name`|String|API name of the field used as a column grouping.| |`sortOrder`|String|Order in which data is sorted within a column grouping. Value can be `asc` for ascending order or `desc` for descending order.| |`dateGranularity`|String|Interval set on a date field used as a column grouping. Value can be Day, Calendar Week, Calendar Month, Calendar Quarter, Calendar Year, Fiscal Quarter, Fiscal Year, Calendar Month in Year, or Calendar Day in Month.| **Filter details** |Property|Type|Description| |--------|----|-----------| |`column`|String|Unique API name for the field that’s being filtered.| |`filterType`|String|Describes the type of value used to filter report data. Valid values are `fieldToField` (filters report data by comparing values of one field with the values of a second field), `fieldValue` (filters report data by comparing values of a field with a defined value), or `null` (if null, the `filterType` defaults to `fieldValue`).| |`isRunPageEditable`|Boolean|Indicates if this is an editable filter in the user interface.| |`operator`|String|Unique API name for the condition used to filter a field such as “greater than” or “not equal to.” Filter conditions depend on the data type of the field. Valid values are `equals`, `notEqual`, `lessThan`, `greaterThan`, `lessOrEqual`, `greaterOrEqual`, `contains`, `notContain`, `startsWith`, `includes`, `excludes`, or `within` (`DISTANCE` criteria only).| |`value`|String|Value by which a field is filtered. For example, the field Age can be filtered by a numeric value. For datetime fields, if you make a POST request and specify a calendar date without including a time, then a default time gets included. The time defaults to midnight minus the difference between your timezone and Greenwich Mean Time (GMT). For example, if you specify 8/8/2015 and your timezone is Pacific Standard Time (GMT-700), then the API returns 2015-08-08T07:00:00Z.| Example filterType. In this example, the first filter is a field-to-field filter that compares the Amount field with Projected Amount field. The second filter is a field filter that returns records for which a row-level formula returns more than 0. ```nolang "reportFilters" : [ { "column" : "AMOUNT", "filterType" : "fieldToField", "isRunPageEditable" : true, "operator" : "notEqual", "value" : "PROJECTED_AMOUNT" }, { "column" : "CDF1", "filterType" : "fieldValue", "isRunPageEditable" : true, "operator" : "greaterThan", "value" : "0" } ] ``` **Bucket field** |Property|Type|Description| |--------|----|-----------| |`bucketType`|BucketType|The type of bucket. Possible values are `number`, `percent`, and `picklist`| |`developerName`|String|API name of the bucket.| |`label`|String|User-facing name of the bucket.| |`nullTreatedAsZero`|Boolean|Specifies whether null values are converted to zero (`true`) or not (`false`).| |`otherBucketLabel`|String|Name of the fields grouped as “Other” (in buckets of `BucketType` `PICKLIST`).| |`sourceColumnName`|String|Name of the bucketed field.| |`values`|Array of BucketTypeValues|Describes the values included in the bucket field..| **Bucket field value** |Property|Type|Description| |--------|----|-----------| |`label`|String|The user-facing name of the bucket.| |`sourceDimensionValues`|String|A list of the values from the source field included in this bucket category (in buckets of type `PICKLIST` and buckets of type `TEXT`).| |`rangeUpperBound`|Double|The greatest range limit under which values are included in this bucket category (in buckets of type `NUMBER`).| **Cross filter** |Property|Type|Description| |--------|----|-----------| |`criteria`|Array of [Filter details[]](#describe)|Information about how to filter the `relatedEntity`. Use to relate the primary entity with a subset of the `relatedEntity`.| |`includesObject`|Boolean|Specifies whether objects returned have a relationship with the `relatedEntity` (true) or not (`false`).| |`primaryEntityField`|String|The name of the object on which the cross filter is evaluated.| |relatedEntity|String|The name of the object that the `primaryEntityField` is evaluated against. (The right-hand side of the cross filter).| |relatedEntityJoinField|String|The name of the field used to join the `primaryEntityField` and `relatedEntity`.| **Custom Detail Formula** |Property|Type|Description| |--------|----|-----------| |`decimalPlaces`|Integer|Formats the value returned by the row-level formula. It is required for numeric return values, invalid for non-numeric return values.| |`description`|String|User-defined description of the row-level formula.| |`formula`|String|Specifies the formula expression to be evaluated. All report type fields, except bucketed fields and historical tracking fields can be referenced.| |`formulaType`|String|Specifies the return type of the formula. Valid values include date, datetime, number, or text.| |`label`|String|Specifies a name for the row-level formula.| **Custom summary formula** |Property|Type|Description| |--------|----|-----------| |`label`|String|The user-facing name of the custom summary formula.| |`description`|String|The user-facing description of the custom summary formula.| |`formulaType`|String|The format of the numbers in the custom summary formula. Possible values are `number`, `currency`, and `percent`.| |`decimalPlaces`|Integer|The number of decimal places to include in numbers.| |`downGroup`|String|The name of a row grouping when the `downGroupType` is `CUSTOM`. `Null` otherwise.| |`downGroupType`|String|Where to display the aggregate of the custom summary formula. Possible values are `all`, `custom`, and `grand_total`.| |`acrossGroup`|String|The name of a column grouping when the `accrossGroupType` is `CUSTOM`. `Null` otherwise.| |`acrossGroupType`|String|Where to display the aggregate of the custom summary formula. Possible values are `all`, `custom`, and `grand_total`.| |`formula`|String|The operations performed on values in the custom summary formula.| **Top rows** |Property|Type|Description| |--------|----|-----------| |`rowLimit`|Integer|The number of rows returned in the report.| |`direction`|String|The sort order of the report rows.| **Report type metadata** |Property|Type|Description| |--------|----|-----------| |`categories`|[Categories[]](#describe)|Returns all row-level formulas in a report as an object identical to the other categories objects. For row-level formulas, these properties are always false: allowedInCustomDetailFormula, Bucketable, Filterable, isCustom, and isLookup. For row-level formulas, these properties are always null: filterValues and inactiveFilterValues.| |`dataTypeFilterOperatorMap`|Filter operator reference|Lists all the possible field data types that can be used to filter the report. Each data type, such as phone, percent, currency, or picklist has two properties: `name` (string), a unique API name for each field type’s filter criteria—use this API name in the metadata to define filter criteria for a report; and `label` (string), the display name for each filter criteria available to fields of a particular data type. For example, multipicklist fields can have for filter criteria, “equals,” “not equal to,” “includes,” and “excludes.” Bucket fields are considered to be of string data type.| |`dateGranularityInfos`|[`dateGranularityInfos[]`](#describe)|An array of objects each of which specifies a measure of time used to group date fields (day, week, month, fiscal quarter, and more).| |`divisionInfo`|[Division info[]](#describe)|Default division and list of all possible record-level divisions that can be used in a report.| |`objects`|[Objects info[]](#describe)|List of objects included in report type. Available in API version 54.0 and later.| |`scopeInfo`|[Scope info[]](#describe)|Scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`standardDateFilterDurationGroups`|[Standard date filter duration groups[]](#describe)|List of standard date filters available in reports.| |`standardFilterInfos`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsJoinedFormat`|Boolean|Specifies whether a report type is compatible with joined reports (`true`) or not (`false`).| **Categories** |Property|Type|Description| |--------|----|-----------| |`label`|String|Display name of a section in the report type under which fields are organized. For example, in an Accounts with Contacts custom report type, Account General is the display name of the section that has fields on general account information.| |`columns`|[Column map](#describe)|Information for all fields in the report type organized under a particular section’s unique API name.| **Column map** |Property|Type|Description| |--------|----|-----------| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field is whether a field is can be referenced in a row-level formula (`true`) or not (`false`).| |`bucketable`|Boolean|Specifies whether a field can be used as the basis for a bucket column (`true`) or not (`false`).| |`dataType`|String|Data type of the field.| |`entityColumnName`|String|Describes the relationship between an sObject and a report field by returning the sObject and sObject field name that a report field maps to. The value returned is formatted as `sObject.sObject field`. The property is part of an object that describes a report field, such as an object in the `columns[]` array of a report type object from `reportTypeMetadata`. For example, on the `LAST_UPDATE_BY` column, the value of `entityColumnName` is `“User.Name”`, which tells us that it’s mapped to the `Name` field on the `User` sObject. For a standard report column that uses a lookup field, `entityColumnName` returns the related object and field. For example, the `LAST_UPDATE_BY` column returns `"User.Name"`. For a custom lookup field, `entityColumnName` can return the object that contains the field and the field's API name instead of the related object's field. For example, a custom lookup-to-`User` field on a custom object can return `"MyCustomObject.MyCustomField"`. Row-level formulas aren’t directly mapped to sObject fields like report fields, but they still have an `entityColumnName` property. For row-level formulas, the value of `entityColumnName` is `CDF1`.| |`fieldToFieldFilterable`|Boolean|Specifies whether a field can be referenced in a field-to-field filter (`true`) or not (`false`).| |`filterValues`|String array|All filter values for a field, if the field data type is of picklist, multi-select picklist, boolean, or checkbox. For example, checkbox fields always have a value of `True` or `False`. For fields of other data types, the filter value is an empty array because their values can’t be determined. Filter values have two properties: `name` (unique API name for a filter value, of type string) and `label` (display name of a filter value, of type string).| |`filterable`|Boolean|`False` means that the field is of a type that can’t be filtered. For example, fields of the type Encrypted Text can’t be filtered.| |`isCustom`|Boolean|Specifies whether a column is a custom (`true`) or standard (`false`) field.| |`isLookup`|Boolean|Specifies whether a field is a lookup (`true`) or not (`false`).| |`label`|String|Display name of a field.| |`maxLength`|Integer|Indicates the maximum permited number of characters for the value of a column field. If there is no limit, use `null`.| |`uniqueCountable`|Boolean|Specifies whether a field supports unique count (`true`) or not (`false)`| Example entityColumnName: ```nolang "reportTypeMetadata" : { "categories" : [ { "columns" : { "LAST_UPDATE_BY" : { "allowedInCustomDetailFormula" : true, "bucketable" : true, "dataType" : "string", "entityColumnName" : "User.Name", "fieldToFieldFilterable" : false, "filterValues" : [ ], "filterable" : true, "inactiveFilterValues" : [ ], "isCustom" : false, "isLookup" : true, "label" : "Last Modified By", "maxLength" : null, "uniqueCountable" : true } } } ] } ``` **`dateGranularityInfos`** |Property|Type|Description| |--------|----|-----------| |`label`|String|The name of the time measure as it appears in the application.| |`value`|String|API name of the time measure.| **Division Info** |Property|Type|Description| |--------|----|-----------| |`defaultValue`|String|Users are assigned a default division that applies to their newly created accounts, leads, and custom objects that are enabled for divisions.| |`values`|String|All division values. Division values have two properties: `label` (display name of a division) and `name` (unique API name of a division).| **Objects Info** |Property|Type|Description| |--------|----|-----------| |`apiName`|String|API name of the object.| |`joinType`|String|Present for custom report types. Indicates how the object is joined. Valid values are `ROOT` (primary object), `INNER` (inner join), or `OUTER` (outer join).| |`label`|String|Display name of the object.| **Scope Info** |Property|Type|Description| |--------|----|-----------| |`defaultValue`|String|Default scope of the data on which you run the report.| |`values`|Array of strings|All scope values. Valid values depend on the report type. Scope values have the following properties: `allowsDivision` (allows you to segment the report by this scope), `label` (display name of the scope), and `value` (value of the scope).| **Standard date filter duration groups** |Property|Type|Description| |--------|----|-----------| |`label`|String|Display name of the standard date filter grouping. Valid values are Calendar Year, Calendar Quarter, Calendar Month, Calendar Week, Fiscal Year, Fiscal Quarter, Day and custom value based on a user-defined date range.| |`standardDateFilterDurations`|[Standard date filter durations[]](#describe)|Details about each possible relative date filter defined under the standard date filter grouping.| **Standard date filter durations** |Property|Type|Description| |--------|----|-----------| |`endDate`|String|End date of a date filter.| |`label`|String|Display name of a date filter. Valid date filters are relative date filters—like `Current FY` and `Current FQ`—and custom date filters.| |`startDate`|String|Start date of a date filter.| |`value`|String|API name of a date filter. Valid date filters are relative date filters—like `THIS_FISCAL_YEAR` and `NEXT_FISCAL_QUARTER`—and custom date filters.| **Report extended metadata** |Property|Type|Description| |--------|----|-----------| |`aggregateColumnInfo`|[Aggregate column information](#describe)|Includes all report summaries such as, Record Count, Sum, Average, Max, Min, and custom summary formulas. Contains values for each summary listed in the report metadata [aggregates](#describe).| |`detailColumnInfo`|[Detail column information](#describe)|Two properties for each field that has detailed data identified by its unique API name. The detailed data fields are also listed in the report metadata.| |`groupingColumnInfo`|[Grouping column information](#describe)|Map of each row or column grouping to its metadata. Contains values for each grouping identified in the [groupingsDown](#describe) and [groupingsAcross](#describe) list.| |`historicalColumnInfo`|[Historical column information](#describe)|Provides additional information on columns that exist only in historical trending reports. (This property is applicable only to historical trending reports.)| **Aggregate column information** |Property|Type|Description| |--------|----|-----------| |`label`|String|Display name for record count, or the summarized or custom summary formula field.| |`dataType`|String|Data type of the summarized or custom summary formula field.| |`acrossGroupingContext`|String|Column grouping in the report where the custom summary formula is displayed. As this example shows in the JSON response and in the custom summary formula editor of the matrix report, the custom summary formula is set at the grand summary level for the columns.| |`downGroupingContext`|String|Row grouping in the report where the custom summary formula is displayed. In this example, the custom summary formula for a summary report is displayed at the first grouping level. This example is shown in both the JSON response and in the custom summary formula editor of the summary report.| Example acrossGroupingContext for a matrix report: ```nolang { "reportExtendedMetadata" : { "aggregateColumnInfo" : { "FORMULA1" : { "label" : "Stalled Oppty Avg", "dataType" : "Percent", "acrossGroupingContext" : "GRAND_SUMMARY", "downGroupingContext" : "GRAND_SUMMARY" }, } } } ``` ![Grouping level where the custom summary formula is displayed for a matrix report](https://developer.salesforce.com/media/salesforce_analytics_rest_api/analyticsapi_matrixrep_csfdisplay.png) Example downGroupingContext for a summary report: ```nolang { "reportExtendedMetadata" : { "aggregateColumnInfo" : { ...}, "FORMULA1" : { "label" : "Average Won", "dataType" : "Number", "acrossGroupingContext" : null, "downGroupingContext" : "TYPE" }, } } } ``` ![Grouping level where the custom summary formula is displayed in a summary report](https://developer.salesforce.com/media/salesforce_analytics_rest_api/analyticsapi_summaryrep_csfdisplay.png) **Detail column information** |Property|Type|Description| |--------|----|-----------| |`label`|String|The localized display name of a standard field, the ID of a custom field, or the API name of a bucket field that has detailed data.| |`dataType`|String|The data type of the field that has detailed data. Possible values are `string`, `boolean`, `combobox`, `currency`, `date`, `datetime`, `double`, `email`, `html`, `id`, `int`, `multipicklist`, `number`, `percent`, `phone`, `picklist`, `reference`, `text`, `textarea`, `time`, or `url`.| |`entityColumnName`|String|Describes the relationship between an sObject and a report field by returning the sObject and sObject field name that a report field maps to. The value returned is formatted as `sObject.sObject field`. The property is part of an object that describes a report field, such as an object in the `columns[]` array of a report type object from `reportTypeMetadata`. For example, on the `LAST_UPDATE_BY` column, the value of `entityColumnName` is `“User.Name”`, which tells us that it’s mapped to the `Name` field on the `User` sObject. For a standard report column that uses a lookup field, `entityColumnName` returns the related object and field. For example, the `LAST_UPDATE_BY` column returns `"User.Name"`. For a custom lookup field, `entityColumnName` can return the object that contains the field and the field's API name instead of the related object's field. For example, a custom lookup-to-`User` field on a custom object can return `"MyCustomObject.MyCustomField"`. Row-level formulas aren’t directly mapped to sObject fields like report fields, but they still have an `entityColumnName` property. For row-level formulas, the value of `entityColumnName` is `CDF1`.| |`filterValues`|String array|All filter values for a field, if the field data type is of picklist, multi-select picklist, boolean, or checkbox. For example, checkbox fields always have a value of `True` or `False`. For fields of other data types, the filter value is an empty array because their values can’t be determined. Filter values have two properties: `name` (unique API name for a filter value, of type string) and `label` (display name of a filter value, of type string).| |`filterable`|Boolean|`False` means that the field is of a type that can’t be filtered. For example, fields of the type Encrypted Text can’t be filtered.| |`isLookup`|Boolean|Specifies whether a field is a lookup (`true`) or not (`false`).| |`label`|String|Display name of a field.| |`uniqueCountable`|Boolean|Specifies whether a field supports unique count (`true`) or not (`false)`| Example entityColumnName: ```nolang "reportTypeMetadata" : { "categories" : [ { "columns" : { "LAST_UPDATE_BY" : { "allowedInCustomDetailFormula" : true, "bucketable" : true, "dataType" : "string", "entityColumnName" : "User.Name", "fieldToFieldFilterable" : false, "filterValues" : [ ], "filterable" : true, "inactiveFilterValues" : [ ], "isCustom" : false, "isLookup" : true, "label" : "Last Modified By", "maxLength" : null, "uniqueCountable" : true } } } ] } ``` **Grouping column information** |Property|Type|Description| |--------|----|-----------| |`label`|String|Display name of the field or bucket field used for grouping.| |`dataType`|String|Data type of the field used for grouping. Possible values are `string`, `boolean`, `combobox`, `currency`, `date`, `datetime`, `double`, `email`, `html`, `id`, `int`, `multipicklist`, `number`, `percent`, `phone`, `picklist`, `reference`, `text`, `textarea`, `time`, or `url`.| |`groupingLevel`|Integer|Level of the grouping. Value can be `0`, `1`, or `2` (first, second, or third row level grouping in summary reports), or `0` or `1` (first or second row or column level grouping in a matrix report).| **Historical column information** |Property|Type|Description| |--------|----|-----------| |`baseField`|String|Indicates the base column for the historical data. Example: For the historical column `Opportunity__hd.Amount__hst.N_DAYS_AGO:1`, which represents the historical `Amount` column from one day ago in an Opportunity report, the base column is `Opportunity.Amount`.| |`historicalColumn`|String|The specific historical column name. Example: The historical column for `Opportunity__hd.Amount__hst.N_DAYS_AGO:1` is `Opportunity__hd.Amount__hst`.| |`historicalSnapshotDate`|String|The snapshot date for this historical column. Example: For the historical column `Opportunity__hd.Amount__hst.N_DAYS_AGO:1`, the snapshot date is `N_DAYS_AGO:1, which is one day ago`.| |isHistoricalChange|Boolean|`True` if the column represents change between two historical columns.| **See Also** - [Execute Sync](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md) - [Execute Async](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instances-summaryasync.md) # Determine the Day in the Week, Month, Quarter, or Year These functions return the day of the week, month, quarter, or year, the date of the last day of the week, month, quarter, or year, and the number of days in the quarter or year. - **[day_in_week(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-day-in-week.md)** Returns an integer representing the day of the week for a specific date. 1 = Sunday, 2 = Monday and so on. - **[day_in_month(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-day-in-month.md)** Returns an integer representing the day of the month for a specific date. - **[day_in_quarter(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-day-in-quarter.md)** Returns an integer representing the day of the quarter for a specific date. - **[day_in_year(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-day-in-year.md)** Returns an integer representing the day of the year for a specific date. - **[week_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-week-last-day.md)** Returns the date of the last day of the week for a specific date. - **[year_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-year-last-day.md)** Returns the date of the last day of the year for a specific date. - **[quarter_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-quarter-last-day.md)** Returns the date of the last day of the quarter for a specific date. - **[month_days(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-month-days.md)** Returns the number of days in the month for a specific date. - **[quarter_days(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-quarter-days.md)** Returns the number of days in the quarter for a specific date. - **[year_days(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-year-days.md)** Returns the number of days in the year for a specific date. # Dimensions and Derived Dimensions in XMD You can add an action menu to a dimension value in Analytics lens and dashboard charts and tables. Users can then open a record and perform record-level actions. The available XMD parameters are the same for dimensions and derived dimensions. This XMD snippet shows the parameters used with `dimensions`. ```nolang "conditionalFormatting":{ "chartColor":{ "parameters":{ "values":[ { "formatValue":"#E8963B", "value":"false" }, { "formatValue":"#3AE867", "value":"true" } ] }, "referenceField":"Stage_IsAdvanced", "type":"categories" } ``` The `dimensions` and `derived dimensions` sections can have the following parameters. ## description Description of the dataset field, up to 1,000 characters. Example: `"description": "Region tracks where the sale was made."` ## field Identifier for the dataset field (API name). ## label Display name for the dataset field, up to 40 characters. Example: `"label": "Sales Manager"` ## linkTemplateEnabled (Boolean) Indicates whether to display the link to open a Salesforce record or URL. ## linkTemplate URL to open when the user clicks the link in the actions menu. Overrides the default `"/{{row.recordIdField}}"`. Example: `"linkTemplate": "/{{row.dimensionNameId}}"` ## linkTooltip Tooltip shown when hovering over the link in Analytics lens or dashboard. Example: `"linkTooltip": "Click to open the record"` ## members Array of display customizations for specific dimension values. ```nolang "members": [ { "member": "USA", "label": "United States", "color": "Blue" }, { "member": "MX", "label": "Mexico", "color": "Green" } ] ``` ## recordIdField Dataset field containing the Salesforce record ID for record-level actions. ## recordOrganizationField Dataset field containing the org ID used for multi-org record-level actions. ## recordDisplayFields Array of dataset fields shown when multiple records match an action. ```nolang "field": "AccountId.Name", "recordIdField": "AccountId.Id", "recordDisplayFields": ["Case_ID","Account_Name","Case_Owner"] ``` ## salesforceActionsEnabled (Boolean) Indicates whether the Salesforce actions menu appears on the field. Example: `"salesforceActionsEnabled": true` ## salesforceActions Array of actions that appear in the action menu. ```nolang "salesforceActions": [ { "enabled": true, "name": "FeedItem.TextPost" }, { "enabled": true, "name": "FSL__LogACall" } ] ``` For more information, see [Perform Actions on a Salesforce Record from Analytics](https://help.salesforce.com/articleView?id=bi_dashboards_actions_configure.htm). ## showInExplorer (Boolean) Indicates whether the dataset field can be selected from dashboard designer or explorer when creating dashboards and lenses. Example: `"showInExplorer": true` **See Also** - [Change Display Labels for Dataset Fields and Values](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-change-labels.md) - [Hide Dataset Fields from Lens and Dashboard](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-show-dataset-fields.md) - [Change Chart Colors for Dimension Values](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-change-chart-colors.md) - [Add Actions to Dimensions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-add-record-level-actions.md) # Display the Opportunities Closed This Month Use relative date ranges to filter opportunities closed in the current month. ## Example: Display Opportunities Closed This Month Suppose that you want to see which opportunities closed this month. Your data includes the account name, the close date fields, and the epoch seconds field. ![Diagram showing the number of days each account has been opened for.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_dates_data.png) Use `date()` to generate the close date in date format. Then use relative date ranges to filter opportunities closed in the current month. ```nolang q = load "OpsDates1"; q = filter q by date(’CloseDate_Year’, ‘CloseDate_Month’, ‘CloseDate_Day’) in ["current month" .. "current month"]; q = foreach q generate Account; ``` If the query is run in May 2018, the resulting data stream contains one entry: ![Screenshot displaying opportunities closed in the current month, with seconds epoch time.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_closed.png) To add the close date in a readable format, use `toDate()`. ```nolang q = load "OpsDates1"; q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["current month" .. "current month"]; q = foreach q generate Account, toDate('CloseDate_sec_epoch') as 'Close Date'; ``` The resulting data stream includes the full date and time of the close date. ![Screenshot displaying opportunities closed in the current month, with seconds epoch.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_example_result1.png) You can also display just the month and day of the close date. ```nolang q = load "OpsDates1"; q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["current month" .. "current month"]; q = foreach q generate Account, 'CloseDate_Month' + "/" + 'CloseDate_Day' as 'Close Date'; ``` The resulting data stream contains the month and day of the close date. ![Screenshot displaying opportunities closed in the current month, with close date and day.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_example_result.png) **See Also** - [Time-Based Filtering](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-daterange.md) # Download a CRM Analytics Dashboard as a PDF Download a CRM Analytics dashboard as a PDF. Use a request on the [Analytics Download](https://developer.salesforce.com/docs/analytics/reference/download/analytics-api-download-reference-resource.md) resource to download a CRM Analytics dashboard as a `.pdf` binary file. **note:** Downloads are requested by entering the URI in a browser address bar. ## Standard Example Usage ```nolang /analytics/download/dashboard/0FKB0000000xxxxxxx.pdf ``` |Parameter|Description| |---------|-----------| |`assetType`|Required. Specifies what type of Analytics asset to download. Valid values are:
  • `dashboard`
  • `lens`
  • `lightning-dashboard`
  • `report`
| |`assetId`|Required. Specifies the Analytics asset id to download.| |`downloadType`|Required. Specifies what file type to download the Analytics asset as. Valid values are:
  • `png`
  • `pdf`
| ## Query Parameter Example Usage Download a specific page and saved view of a CRM Analytics dashboard. ```nolang /analytics/download/dashboard/0FKB0000000xxxxxxx.pdf?savedViewId=0Svxx&pageId=page1 ``` Download a CRM Analytics dashboard to print on legal-sized paper. ```nolang /analytics/download/dashboard/0FKB0000000xxxxxxx.pdf?pageSize=LEGAL ``` Download a CRM Analytics dashboard without the tabular widget data. ```nolang /analytics/download/dashboard/0FKB0000000xxxxxxx.pdf?includeData=false ``` |Parameter|Description| |---------|-----------| |`includeData`|Optional. Indicates whether to include that tabular widget data (`true`) or not(`false`).| |`pageId`|Optional. Specifies the Id for a dashboard page to download.| |`pageSize`|Optional. Specifies page size to download. Valid values are:
  • `A3`
  • `A4`
  • `LEGAL`
  • `LETTER`
| |`savedviewId`|Optional. Specifies the Id for a dashboard saved view to download.| ## Example Response Body The response body is binary data of the `.pdf` representation of the CRM Analytics dashboard. # Download a CRM Analytics Lens as a PNG Download a CRM Analytics lens as an image. Use a request on the [Analytics Download](https://developer.salesforce.com/docs/analytics/reference/download/analytics-api-download-reference-resource.md) resource to download a CRM Analytics lens as a `.png` binary file. **note:** Downloads are requested by entering the URI in a browser address bar. ## Example Usage ```nolang /analytics/download/lens/0FKB0000000xxxxxxx.png ``` |Parameter|Description| |---------|-----------| |`assetType`|Required. Specifies what type of Analytics asset to download. Valid values are:
  • `dashboard`
  • `lens`
  • `lightning-dashboard`
  • `report`
| |`assetId`|Required. Specifies the Analytics asset id to download.| |`downloadType`|Required. Specifies what file type to download the Analytics asset as. Valid values are:
  • `png`
  • `pdf`
| ## Example Response Body The response body is binary data of the `.png` representation of the CRM Analytics lens. # Download a Lightning Experience Dashboard as a PNG Download a Lightning Experience dashboard as an image. Use a request on the [Analytics Download](https://developer.salesforce.com/docs/analytics/reference/download/analytics-api-download-reference-resource.md) resource to download a Lightning Experience dashboard as a `.png` binary file. **note:** Downloads are requested by entering the URI in a browser address bar. ## Example Usage ```nolang /analytics/download/lightning-dashboard/01ZB0000000xxxxxxx.png ``` |Parameter|Description| |---------|-----------| |`assetType`|Required. Specifies what type of Analytics asset to download. Valid values are:
  • `dashboard`
  • `lens`
  • `lightning-dashboard`
  • `report`
| |`assetId`|Required. Specifies the Analytics asset id to download.| |`downloadType`|Required. Specifies what file type to download the Analytics asset as. Valid values are:
  • `png`
  • `pdf`
| ## Example Response Body The response body is binary data of the `.png` representation of the Lightning Experience dashboard. # Download a Lightning Experience Report as a PNG Download a Lightning Experience report as a `.png` file. Use a request on the [Analytics Download](https://developer.salesforce.com/docs/analytics/reference/download/analytics-api-download-reference-resource.md) resource to download a Lightning Experience report as a `.png` binary file. **note:** Downloads are requested by entering the URI in a browser address bar. ## Example Usage ```nolang /analytics/download/report/00OB0000000xxxxxxx.pdf ``` |Parameter|Description| |---------|-----------| |`assetType`|Required. Specifies what type of Analytics asset to download. Valid values are:
  • `dashboard`
  • `lens`
  • `lightning-dashboard`
  • `report`
| |`assetId`|Required. Specifies the Analytics asset id to download.| |`downloadType`|Required. Specifies what file type to download the Analytics asset as. Valid values are:
  • `png`
  • `pdf`
| **note:** For a Lightning Experience report, the download request only works for `.png` when the report has a chart. If `.pdf` is used or the report doesn’t have a chart, the request returns an error. ## Example Response Body The response body is binary data of the `.png` representation of the Lightning Experience report. # Download Formatted Excel Reports Using the Reports REST API Use the Reports REST API to download report results as JSON or Excel. ## Request JSON Output Send a POST request with the Accept header set to application/json: ```nolang curl -X POST "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json" ``` ## Request Excel Output The Accept header controls the output format. Set it to `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` to receive Excel. Always keep Content-Type as `application/json`. If you must separate execution from download, first execute via POST with `Accept: application/json`, then retrieve the Excel file via GET. **note:** This endpoint isn't designed for concurrent export of large formatted reports. To avoid impact on overall system load, don't run more than one large report export at a time. For report size, row, and other API limits, see [Requirements and Limitations](https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_limits_limitations.htm). To execute a report and download it in a single request, send a POST: ```nolang curl -X POST "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \ --output "report.xlsx" ``` To download a previously executed report, send a GET: ```nolang curl -X GET "https://YOUR_INSTANCE.my.salesforce.com/services/data/v62.0/analytics/reports/YOUR_REPORT_ID" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \ --output "report.xlsx" ``` The response includes the filename in the Content-Disposition header. Read it from the response stream to save the file. ```nolang HTTP/1.1 200 OK Date: Thu, 09 Jul 2026 09:55:53 GMT Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Transfer-Encoding: chunked Connection: close Vary: Accept-Encoding X-Content-Type-Options: nosniff Content-Disposition: attachment; filename="New Opportunities Report-2026-07-09-15-25-49.xlsx" Strict-Transport-Security: max-age=63072000; includeSubDomains Sforce-Limit-Info: api-usage=2/15000 Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private X-Robots-Tag: none Set-Cookie: CookieConsentPolicy=0:1; path=/; expires=Fri, 09-Jul-2027 09:55:49 GMT; Max-Age=31536000; secure Server: sfdcedge X-SFDC-Request-Id: 3aecd0ec3baade21751f95eb0f30ce00 X-Request-Id: 3aecd0ec3baade21751f95eb0f30ce00 X-SFDC-Edge-Cache: none ``` # Downloads Examples Learn how to download dashboards, lenses, and reports as images or PDFs. - **[Download a CRM Analytics Dashboard as a PDF](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/downloads/analytics-api-download-example-crma-dashboard-pdf.md)** Download a CRM Analytics dashboard as a PDF. - **[Download a CRM Analytics Lens as a PNG](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/downloads/analytics-api-download-example-crma-lens-png.md)** Download a CRM Analytics lens as an image. - **[Download a Lightning Experience Dashboard as a PNG](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/downloads/analytics-api-download-example-le-dashboard-png.md)** Download a Lightning Experience dashboard as an image. - **[Download a Lightning Experience Report as a PNG](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/downloads/analytics-api-download-example-le-report-png.md)** Download a Lightning Experience report as a `.png` file. # Dynamically Display Your Top Five Reps with Windowing Windowing functions perform calculations over a dynamic range. ## Example - Dynamically Display Your Top Five Reps Use windowing to create a chart that dynamically displays your top-five reps for each country. The chart updates continuously as opportunities are won. The example uses windowing to calculate: - Percentage contribution that each rep made to the total amount, partitioned by country - Ranking of the rep’s contribution, partitioned by country These calculations let us display the top-five reps in each country. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by ('Billing_Country', 'Account_Owner'); q = foreach q generate 'Billing_Country', 'Account_Owner', -- sum(Amount) is the total amount for a single rep in the current country -- sum(sum('Amount') is the total amount for ALL reps in the current country -- sum(Amount) / sum(sum('Amount') calculates the percentage that each rep contributed -- to the total amount in the current country ((sum('Amount')/sum(sum('Amount')) -- [..] means "include all records in the partition" -- "by Billing_Country" means partition, or group, by country over ([..] partition by 'Billing_Country')) * 100) as 'Percent_AmountContribution', -- rank the percent contribution and partition by the country rank() over ([..] partition by ('Billing_Country') order by sum('Amount') desc ) as 'Rep_Rank'; -- filter to include only the top 5 reps q = filter q by 'Rep_Rank' <=5; ``` The resulting graph shows the top-five reps in each country and displays each rep’s ranking. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_top5.png) # Dynamically Set the Reference Line and Label on a Widget You can dynamically set a reference line and its label based on a measure from a query. For example, you can set the reference line to represent the sales target and then compare it against your won opportunities. **note:** You can create dynamic reference lines without code. Learn more about creating [reference lines](https://help.salesforce.com/articleView?id=analytics.bi_chart_reference_lines_multiple.htm). In this example, let’s say you have a timeline chart that shows the total opportunity amount over time. The dashboard also contains a list selector that allows you to show the total amount for a particular account. To compare the total for each account against the average for all accounts, you want to set a reference line based on the average opportunity amount for all accounts. ![The timeline chart shows a reference line with a label and value.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_binding_reference_line_value.png) To create the reference line label and its value based on the average for all accounts, add interactions in widget properties for the timeline chart (`chart_3`) as follows. ```nolang "referenceLines": [ { "color": "#9271E8", "value": "{{cell(all_1.result, 0, \"avg_Amount\").asString()}}", "label": "Avg: {{cell(all_1.result, 0, \"avg_Amount\").asString()}}" } ] ``` In this example, the interaction gets the average from the query (`all_1`), which calculates the average in the number widget based on the selected account name in the list widget. For more interaction examples, create the [CRM Analytics Learning Adventure app](https://help.salesforce.com/s/articleView?id=analytics.bi_learning_adventure_app.htm) in your org. # Edit auto-install.json `auto-install.json` configures the template for the auto-install framework. Always create this optional file if you plan to design your template for auto-installation via a managed package with an auto-install request. Template developers use this file to specify the configuration of the auto-install framework hook and the app installation. When this file is created, add the `autoInstallDefinition` attribute to the `template-info.json` file. ## Example ```nolang { "hooks": [ { "type" : "PackageInstall", "requestName" : "Hook for the Auto-Install Template" } ], "configuration" : { "appConfiguration" :{ "failOnDuplicateNames" : false, "autoShareWithLicensedUsers" : true, "autoShareWithOriginator" : true, "deleteAppOnConstructionFailure" : true, "values" : { "value1" : "testString", "value2" : false } } } } ``` The example creates an auto-install hook to install the template via a managed package, naming the auto-install request `Hook for the Auto-Install Template`. The supported auto-install hooks are `PackageInstall` only. The `appConfiguration` specifies that the installed app will: - not fail creation if an app or assets exist with the same developer name - be automatically shared with appropriately licensed users - be automatically shared with the user that created the auto-install request - be deleted if app creation fails for any reason; for create requests only, it doesn’t apply to app upgrades - be created with the template variable values in the `values` map **important:** Because users don’t use the CRM Analytics Studio wizard to create the app, an app `name` attribute is required. To specify the app name, add a `name` attribute in the template’s `folder.json` file. **note:** Templates packaged for automatic install can’t be dependent templates. The creation of auto-install requests can’t guarantee dependent templates are installed in the correct order. **See Also** - [auto-install.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-auto-install-json-attributes.md) # Edit folder.json The `folder.json` file describes the `featuredAssets` for the application. **note:** This file is required for embedded apps because it specifies the name and label for the templated app along with setting sharing rules for the app. The embedded app can’t be shared with other users and groups using CRM Analytics Studio. Template developers can use it to specify the order of the dashboards in the application instead of accepting the default behavior of alphabetizing by dashboard label. ## Example ```nolang { "name": "My Templated App", "featuredAssets": { "default": { "assets": [ {"id": "${App.Dashboards['ZDashboard'].Id}"}, {"id": "${App.Dashboards['BDashboard'].Id}"}, {"id": "${App.Dashboards['ADashboard'].Id}"} ] } }, "shares": [ { "shareType": "Organization", "accessType": "View" } ] } ``` The previous example tells the application to display the "ZDashboard" first, as the most prominent dashboard, rather than the default of A, B, then Z. If a dashboard has a conditional attribute in `template-info.json` that resolves so that the dashboard isn’t added at app creation time, a rule must be added to the `template-to-app-rules.json` to remove the dashboard from the `folder.json` file. This rule removes that dashboard entry from the `featuredAssets` list at runtime and prevents app creation from failing with a "Dashboard not found" error. The rule looks like this: ```nolang { "name": "RemoveDashboardZFromFolderJson", "condition": "${!Variables.HasDashboardZ}", "appliesTo": [ { "type": "folder", "name": "*" } ], "actions": [ { "action": "delete", "description": "Remove conditional dashboard", "path": "$.featuredAssets.default.assets..[?(@.id=~ /^.DashboardZ.$/i)]" } ] } ``` **See Also** - [folder.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-folder-json-attributes.md) # Edit org-readiness.json The `org-readiness.json` file configures the validations to run on a user org to ensure it can create an app successfully. The org readiness file defines the values to use for validation, the template requirements for the org with success and failure messages to display to the user, and the validation definitions. The evaluated result of each `definition` is stored in the template context as `Readiness['']`. ```nolang { "values" : { "Sentiment_Analysis_transformField": { "sobjectName": "Case", "fieldName": "Description" }, "Sentiment_Analysis_dataset_sourceObjectAdditionalFields" : [ ] }, "templateRequirements": [ { "expression": "${Readiness['Total Accounts'] > Variables.MinimumNumberOfAccounts}", "type": "SobjectRowCount", "successMessage": "Congratulations! The expected number of accounts matched!", "failMessage": "Sorry, you don't have enough accounts, you need at least ${Variables.MinimumNumberOfAccounts} accounts in your org.", "tags": [ "Account" ], "image": { "name": "sales.png" } } ], "definition": { "Total Accounts": { "type": "SobjectRowCount", "sobject": "Account" } } } ``` **See Also** - [org-readiness.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-org-readiness-json-attributes.md) # Edit Rules Files Rules files define how an app gets created by the template. There are two type of rules files: `template-to-app-rules.json` and `app-to-template-rules.json`. They use the same syntax, but serve different purposes. - `template-to-app-rules.json` defines the rules that the template follows when creating an app. For example, you can define a rule that specifies that if an org doesn’t use certain objects, the app doesn't use them in dashboards or the dataflow. Another rule can replace a label name in a chart with the name of a field from a Salesforce object selected in a wizard question. Rules also define how variables are handled. For example, if the wizard asks which fields to include in filters for accounts, `template-to-app-rules.json`determines how that choice is reflected in dashboards. - `app-to-template-rules.json` provides rules for converting an updated source app back to template form. After changing the source app, you update the template object with a PUT call to the CRM Analytics REST API. For example, you can tokenize all asset files every time they are pulled out of the source app. You use app-to-template rules infrequently, because you're unlikely to update the source app often. The rules file is referenced from `template-info.json`: ```nolang "rules" : [ { "type" : "appToTemplate", "file" : "appToTemplateRules.json" }, { "type" : "templateToApp", "file" : "templateToAppRules.json" } ], ``` The bulk of what follows details the use of `template-to-app-rules.json`. - **[Rules Files Structure](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-rules-files-structure.md)** Rules files can contain three sections: rules, constants, and macros. - **[Structuring and Organizing Rules](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-rules-structure.md)** The rules section of `template-to-app-rules.json` defines the rules followed by the template. - **[Rules Syntax](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-rules-syntax.md)** The rules object may contain any number of rule objects. A rule object is made up of: - **[Actions in Rules](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-actions-in-rules.md)** Actions define what a rule does. Use constants to make it easier to perform any action. - **[Actions Syntax for Rules](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-actions-syntax-rules.md)** - **[Use Functions in Rules](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-functions.md)** Functions make rules more powerful. For example, use functions to apply rules iteratively to arrays or to make rules conditional on the content of a string or an array. CRM Analytics Templates supports string, array, and json functions as well as static math and sfdc_fma functions. - **[Macros in Rules](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-macros-in-rules.md)** Use a macro when a single rule executes repeatedly on different JSON node paths. **See Also** - [rules.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-rules-json-attributes.md) # Edit template-info.json `template-info.json` describes the template. It references all the information required to create an app from the template. `template-info.json` can also contain conditions. For example, a source app can have a dashboard with charts. You can include conditions in the `template-info.json` file to remove specific charts when the user creates the app. Conditions can include overrides that enable the addition or exclusion of assets and data from the app. The override is defined in `variables.json`. See [Complex `variables.json` Variable Types](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-complex-var-types-variables-json.md). The `template-info.json` file has multiple parts. ## Template Metadata Metadata information for the template includes the name, description, icons, tags, and custom attributes. ```nolang { "label": "Analytics Training Materials", "name": "analyticsEducation", "description": "An example template to generate datasets, dashboards and lenses for the Analytics introduction course.", "assetVersion": 49, "templateType": "app", "icons": { "templateBadge" : { "name" : "learn" }, "appBadge" : { "name" : "16.png" }, "templatePreviews" : [ { "name": "preview_education", "label": "Analytics Training", "description": "Learn about templates to generate Analytics assets." } ] }, "tags": [ "Learn", "Templates", "Apps" ], "customAttributes": [ { "label" : "Features", "values" : [ "Prebuilt Apps", "Mobile Ready" ] } ] }, ``` **label** Contains the user’s name for the app. Analytics Studio displays this text in the app creation wizard, such as in the template picker and template details page. ![The Analytics Studio template picker showing display of text from icons, description, and label template-info.JSON file](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_templatepicker_example.png) **name** The unique developer ID for the template ID. Changing it generates a new template. **description** Specifies the description of the template. The template picker displays the contents of `description`, as shown in the previous image. **assetVersion** Specifies the version for the template assets. The version is set at the time of creation, generating a snapshot of the asset JSON files. The version doesn't update unless indicated when updating a template. For more information, see [Update an Existing Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-update-template.md). **templateType** Specifies the type of template: - `app`: a standard app - `embeddedapp`: an embedded app - `data`: a collection of data assets - `dashboard`: a single dashboard **icons** Contains three possible options. **templateBadge** Defines the small icon that appears in the app picker (shown in the previous image) and at the top of the template details window (shown in the next image). Don't use a file extension with the `name` attribute, for example `"learn"`, not `"learn.png"`. **appBadge** Defines the icon shown by Analytics Studio for the app after creation. Must be `"1.png"` through `"21.png"`. Use a file extension with the `name` attribute, for example `"16.png"`, not `"16"`. **templatePreviews** Defines preview images displayed on the template details window during the app creation process. Supports multiple images. Don't use a file extension with the `name` attribute, for example `"preview_education"`, not `"preview_education.png"`. **tags** Specifies tags that are used in template search and that appear on the template details page (shown in the next image). **customAttributes** Specifies information describing the template in the app creation wizard, such as Salesforce objects used or notable features (shown in the next image). ![The Analytics Studio template picker showing display of text from icons, description, and label template-info.JSON file](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_template_details.png) ## Template Version Information The `templateVersion` is a string validated as “`#.#`”. The `notesFile`, when present, must be an HTML file. If `releaseInfo` is present, users can reconfigure or upgrade an app that’s been created from the template from Analytics Studio. ```nolang "releaseInfo":{ "templateVersion": "1.0", "notesFile": "releaseNotes.html" }, ``` **note:** After creating an app from a template for the first time, users can reconfigure the app based on the existing version of the template. When you update the number in `templateVersion`, CRM Analytics prompts users who created an app from the template to upgrade the app to the new version. For more information about reconfiguring and upgrading apps from templates, see [Reconfigure an Analytics App](https://help.salesforce.com/articleView?id=bi_app_upgrade.htm&type=5) and [Upgrade an Analytics App](https://help.salesforce.com/articleView?id=bi_app_upgrade.htm&type=5). ## Variables File The file that contains all the variables used in the template is `variables.json`. ```nolang "variableDefinition": "variables.json", ``` ## Configuration Wizard File The file that defines the wizard the user fills out, answering questions to set variables, is `ui.json`. ```nolang "uiDefinition": "ui.json", ``` ## Org Readiness File The file that defines the validations to perform when the wizard loads is `org-readiness.json`. These validations verify that the org has the necessary data and setup to support creating an app from the template without failing. ```nolang "readinessDefinition" : "org-readiness.json" ``` ## Rules Files The file or files defining any rules to be applied to the template assets is `rules.json`. ```nolang "rules" : [ {    "type" : "templateToApp",    "file" : "template-to-app-rules.json"  }, {    "type" : "appToTemplate",    "file" : "app-to-template-rules.json"  } ], ``` The `templateToApp` rules file defines rules that run when a downstream app is created or updated from a template. These rules are the rules you’re most likely to edit. The `appToTemplate` rules file defines rules that run when a template is created or updated from a source app. These rules are created by the framework code. You aren’t likely to edit them. ## Dashboards and Lenses A dashboard or lens entry can contain a condition statement to determine whether the asset is added at app creation time based on a given variable. This condition statement can be an empty list (`"[]"`). ```nolang "dashboards": [ { "file": "dashboards/Elections_2012_Dashboard.json", "label": "elections_dashboard", "name": "Elections Dashboard", "condition" : "${Variables.StringValueInclude == 'Yes'}" } ], "lenses":[ { "file": "lenses/Election_Breakdown_By_State.json", "name": "Election Breakdown By State" } ], ``` ## External Datasets List of files that define external datasets (CSVs) to create. The list can include XMD. Each dataset entry can contain an entry for a conditional statement, allowing for decisions to be made by variables on whether a dataset asset is added at app creation time. This condition statement can be an empty list (`"[]"`). ```nolang "externalFiles":[ { "type" : "CSV", "name" : "State_Codes", "file" : "external_files/StateCode.csv", "schema" : "external_files/StateCode_schema.json" }, { "type" : "CSV", "name" : "Election_2012", "file" : "external_files/Election_2012.csv", "schema" : "external_files/Election_2012_schema.json", (optional) "userXmd" : "external_files/Election_2012_XMD.json" (optional) } ], ``` ## Datasets The SFDC dataset builder creates these datasets. Label is optional. ```nolang "datasetFiles": [ { name": "Election_1980", "label": "Election 1980", "userXmd": "dataset_files/Election_1980_XMD.json" }, { "name": "Election_2012", "label": "Election 2012" } ], ``` User XMD is NOT required. If it’s present, there's an XMD JSON file in the `dataset_files` directory. Otherwise, no XMD JSON file is present. If User XMD exists, it must be v2.0. Each dataflow or recipe file must contain a reference to the corresponding dataset (Extract and Register steps). That enables the dataset to be recreated in the creation process of any downstream app. Live datasets are supported with the `liveConnection` parameter. For more information, see [Use Live Datasets in a CRM Analytics Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-use-live-dataset.md). ## Dataflow Files List of files that define dataflows. This reference can be an empty list (`"[]"`). If your app includes multiple dataflows, reference each dataflow file. When a user creates an app from the template, dataflows are created in the order they’re entered here. ```nolang "eltDataflows" : [ { "label" : "One DF", "name" : "One_DF", "file" : "dataflow/One_DF.json" }, { "label" : "Two DF", "name" : "Two_DF", "file" : "dataflow/Two_DF.json" } ], ``` ## Recipe Files List of files that define recipes. This reference can be an empty list (`"[]"`). If your app includes multiple recipes, reference each recipe file. When a user creates an app from the template, recipes are created in the order they’re entered here. Edit the order as needed. If dataflows exist in the app, they execute before the recipes. For more information, see [Add a Recipe to a CRM Analytics Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-add-recipe.md). You can also specify whether a recipe should sync and execute during app creation with the `executeCondition` attribute. For more information, see [Configure Recipe Execution](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-execute-recipe.md). ```nolang "recipes" : [ { "label" : "Filter States Recipe", "name" : "Filter_States_Recipes", "file" : "recipes/filterRecipe.json" }, { "label" : "Append Cities Recipe", "name" : "Append_Cities_Recipe", "file" : "recipes/appendRecipe.json", "executeCondition" : "CreateOnly" } ], ``` ## Dashboard Components List of files that define components in dashboards. This reference can be an empty list (`"[]"`). Each dashboard component in the app’s dashboards gets a unique entry in this list. Each component entry can contain an entry for a conditional statement, allowing for decisions to be made by variables on whether a component asset is added at app creation time. This condition statement can be an empty list (`"[]"`). ```nolang "components" : [ { "label" : "ImageComponent", "name" : "ImageComponent_tp", "file" : "components/ImageComponent.json" } ], ``` ## Template Dependencies For templates with dependencies, add a line to `template-info.json` that refers to templates to include in the dependency. See [Create Dependent Templates](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-create-dependency.md). ## Images These images are associated with the app and used in dashboard files. Each image can contain an entry for a condition statement. Specifying a condition enables decisions to be made with variables on whether an image is added at app creation time. Images must be stored as static resources. References to each image must specify a `namespace` attribute if the org uses namespace. ```nolang "imageFiles" : [ { "name" : "image1", "condition" : "${Variables.ShowImage1}", "file" : "images/image1.png" "namespace" : "${Org.Namespace}" }, { "name" : "image2", "file" : "images/image2.png" "namespace" : "${Org.Namespace}" } ], ``` ## Folder File The file that contains the folder information including `featuredAssets` and `shares` is `folder.json`. ```nolang "folderDefinition": "folder.json", ``` ## Auto-Install File The file that contains the auto-install hook configuration and the installed app configuration is `auto-install.json`. This file must exist if your template is installed with a managed package and the app is created with an auto-install request. ```nolang "autoInstallDefinition": "auto-install.json", ``` ## Smart Wizard Apex Callback You can also call a smart wizard from `template-info.json` to perform computations or detection on the user's data. The call to the smart wizard must be backed up with an Apex callback class. The Apex callback class can run the smart wizard before or after the configuration wizard runs and when the creation of the app is kicked off. You call the Apex class from `template-info.json` with something like this: ```nolang "apexCallback": { "namespace": "${Org.Namespace}", "name": "GenericConfigurationModifier" }, ``` For more about the smart wizard, refer to the Best Practices section. **See Also** - [template-info.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-template-info-json-attributes.md) # Edit ui.json The `ui.json` file determines how your template displays the configuration wizard questions defined in `variables.json`. **note:** This file isn’t used in an embedded app. Templates with a `templateType` of `embeddedapp` aren’t visible in CRM Analytics Studio for install. The UI file determines wizard page layout, defining the order in which variables described in `variables.json` appear on a page. ```nolang {
 "ui" :{
 "pages": [ { "title":"Customization Questions", "variables":[
 { "name": "customizeUserObjectInfo" }
 ] }
, {
 "title":"User Object Information", // Only show this page if the user checked the "customizeUserObjectInfo" checkbox.
 "condition":"{{Variables.customizeUserObjectInfo == 'Yes'}}",
 "variables":[
 { "name": "userObjectUsernameField" },
 { "name": "userObjectName" }, { "name": "pageConditionVariable" },
 { "name": "showBoolean" } ], "helpUrl":"https://salesforce.com/wave/salesapp/page1/help.html"
 },
 {
 "title":"Job Information",
 "variables":[
 { "name": "maxAllowedOffset" }, { "name": "booleanExample", "visibility": "{{Variables.showBoolean ? 'Visible' : 'Hidden'}}" }, ], "helpUrl":"https://salesforce.com/wave/salesapp/page2/help.html"
 }
 ], "displayMessages": [ { "text":"When we're done creating the app, we'll send you an email.", "location": "AppLandingPage" } ]
 } ``` The displayMessages text is visible to the user on the page that displays the app creation progress. ![The app landing page showing the app creation progress and the custom displayMessages text.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templated_app_displayMessage.png) - **[Page Condition Syntax for ui.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-page-cond-syntax-ui-json.md)** You can make a page's appearance conditional on the value of a variable. For example, if the user answers "No" when asked if there is a Products dimension, you can use a conditional to ensure that no Products-related page displays in the wizard. Adding page conditions enables wizard page flow. If the condition is met, then the page with the condition will display; if the condition is not met, the page will not display. Use the following syntax to instruct which conditionals control the display of pages. - **[Variables Array in ui.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-vars-array-ui-json.md)** 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. - **[Use VisualForce To Customize the Wizard UI](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-creating-custom-wizard-vf.md)** To customize wizard appearance beyond the default interface, use VisualForce and a JavaScript library. **See Also** - [ui.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-ui-json-attributes.md) # Edit variables.json The `variables.json` file describes all the variables used in the `template-info.json`, `ui.json`, and the different `rules.json` files. `variables.json` includes text for wizard questions, descriptions, and specifications for the answers. Variables also define conditional questions. For example, if you want some questions to appear in the wizard only if an org contains certain data. Or you want to add more specific questions based on the answers to more general wizard questions. Variables enable the customization of apps; without them, everything is hard-coded. Variables allow the framework to replace tokenized data with customer-specific data. ## Variables Syntax Variables are declared in the following format: ```nolang { "" : } ``` Each variable has a unique name. Here are the parts of a variable definition. **label** (Required) Text for the label in the wizard, formatted as a question the user selection answers. **description** (Optional) Text for the description in the wizard, formatted to help the user select the correct response. **defaultValue** (Optional) Default value for the answer to the wizard question. **required** (Optional) Indicates whether an answer to the wizard question is required (`true`) or not (`false`). The default is `false`. **variableType** (Optional) The type of the variable. The list of valid variable types is [here](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-variables-json-attributes.md). Defaults to `StringType` if not specified. **excludes** (Optional) Defines values to exclude from selections in response to the wizard question. The values are a list of comma-separated field names or regex tokens to not show in a picker. **excludeSelected** (Optional) Excludes previously selected values from selections in response to subsequent wizard questions. The default is `false`. If there are two or more pickers with the same source and variable type and this field is `true` for both, the selected option is excluded from the list of options in the other picker. ## Examples **Generic variable** ```nolang "" : {

 "label" : "", "description" : "",

 "variableType" : { "type" : "SobjectType" }, "defaultValue" : { "sobjectName": "User" },

 "required" : true, "excludes" : [ "AboutMe", "Division"], "excludeSelected" : true } ``` **NumberType variable with enumerated values** ```nolang "numberExampleByTens" : {   "label" : "What's the maximum number to use for the offset?",   "description" : "Choose a value between 10 and 100",   "defaultValue" : 80,   "required" : true,    "variableType" : {        "type" : "NumberType",        "min" : 0,        "max" : 100,        "enums" : [10,20,30,40,50,60,70,80,90,100]    } } ``` **BooleanType variable** ```nolang "booleanExample" : {     "label" : "Please define the boolean parameter?",     "description" : "Some boolean value.",     "defaultValue": false,     "required" : true,     "variableType" : {         "type" : "BooleanType",     } } ``` **SobjectFieldType array variable** ```nolang "sobjectFieldArrayExample" : {    "label" : "Select the user name fields?",    "description" : "The user fields to use.",    "defaultValue" : [       {"sobjectName" : "User", "fieldName" : "FirstName"},       {"sobjectName" : "User", "fieldName" : "LastName"},    ],    "required" : true,    "variableType" : {    "type":"array"    } "itemsType" : {     "type" : "SobjectFieldType", "dataType" : "xsd:string"     }    } } ``` To use this variable, call it with the following: ```nolang ${Variables.sobjectFieldArrayExample[0].sobjectName} ${Variables.sobjectFieldArrayExample[0].fieldName} ${Variables.sobjectFieldArrayExample[0]} ``` See additional detail and examples in the sections that follow. - **[Simple Variable Types for variables.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-simple-var-types-variables-json.md)** We call the following variable types “simple” because they’re standard, predefined datatypes. - **[Complex variables.json Variable Types](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-complex-var-types-variables-json.md)** 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. - **[Array Variable Type for variables.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-array-type-variables-json.md)** Use an `ArrayType` variable to create a wizard question that accepts multiple selections. The user can make multiple choices from a list of values. Define a minimum and maximum for the number of items that can be selected. - **[excludes and excludeSelected Attributes in Variables](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-excludes-attributes.md)** In variables, use the `excludes` attribute in variables to define values to exclude from selections in response to wizard questions. Use the `excludeSelected` attribute to exclude values that have already been selected in previous wizard questions. - **[Use Case and Syntax for Variables with Related Values](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-var-value-ref-use-case-variables-json.md)** Construct variables that reference related values, for example an object and fields from the object, and a dataset and dates, dimensions, and measures from the dataset. **See Also** - [variables.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-variables-json-attributes.md) # Embed the Tableau Agent Bring your Tableau agent directly into your app. This agent helps your users see and understand data with conversational analytics. The agent generates natural language insights, visualizations, and proactive alerts in your flow of work. Use the `AnalyticsAgent` class to embed your agent as a component in your app. ## Create Your Agent Tableau Agent is a collection of pre-built agentic capabilities made available through the Analytics and Visualization agent template. Turning these settings on in Tableau Next makes the Analytics and Visualization agent template and its subagents and actions available to you To set up and create your agent, see [Set Up Tableau Agent in Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_admin_enable_agentforce_templates.htm). ## Get Your Agent ID Get the ID for your agent. 1. From Setup, in the Quick Find box, enter _Agentforce_, and select **Agentforce Agents**. 2. In the list of agents, click your agent name. 3. To get the ID of the agent, the ID from the Agent Details page URL. ![The agent ID in the Agent Details page URL.](https://developer.salesforce.com/docs/media/sdk/setup_agent_url_id.png '{"class": "image-lg"}') ## Add the AnalyticsAgent Component to Your App Embedding the `AnalyticsAgent` component is the same as embedding the other analytics components, using a container, the authentication configuration, and the SDK initialization. Construct the `AnalyticsAgent` component, using the `AgentProps`. The `AgentProps` specify the container name and agent ID, along with the agent context type and the API name for the context type. The `AUTH_CREDENTIAL` value is the Frontdoor URL or access token provided by the code you created to authorize your users with Salesforce. The `orgUrl` is the URL for your Salesforce org. The `AnalyticsAgent` component is designed to be embedded independent of other analytics components and works on its own. You can embed one or more corresponding analytics components to give your user context for asking the agent questions, but it isn't required for the agent to work. ### Single Component Mode To track a single analytics asset, provide a `contextConfig` with `contextType` and `contextTypeIdOrApiName`. The `AgentContextConfig` specifies the analytical view or data scope for the agent to use. ```javascript
``` #### Agent Context The agent context specifies the analytical view or data scope for the agent to use. The agent uses this context to answer user questions. You must reference the ID or API name of a semantic model, dashboard, or metric that exists in the same org as your Tableau agent. You can find the API name using the asset URL from Salesforce. In Tableau Next, view the asset you want to embed. When viewing the asset, the URL for the asset provides the asset API name. - Dashboard URL: `https://.force.com/tableau/dashboard//view`. - Semantic Model URL: `https://.force.com/tableau/sdm//edit`. - Metric URL: `https://.force.com/tableau/exploreMetric/?{metricParameters}`. Set the context type to the matching enum value, `AgentContextType.SDM`, `AgentContextType.DASHBOARD`, or `AgentContextType.METRIC` of the component type you selected. ### Multiple Component Mode To have the agent automatically track all embedded `AnalyticsDashboard` and `AnalyticsMetric` components on a page, omit the `contextConfig`. Omitting the `contextConfig` runs the agent in multiple component mode. The agent receives context updates from every dashboard and metrics component and can answer questions across all of them. ```javascript
``` Because `contextConfig` isn't provided, the agent picks up context from both the dashboard and metric components automatically. You can embed as many dashboard and metric components alongside the agent as you need. ## Header Settings You can also show the agent header and header actions, which aren't visible by default. The header actions include the agent information and restart session actions. When a user restarts a session, it clears their current session history. ```javascript const agent = new AnalyticsAgent({ parentIdOrElement: "agent-container", idOrApiName: "0Xxfib0000000xxxxx", contextType: "AgentContextType.METRIC", contextTypeIdOrApiName: "My_Metric_1", showHeader: true, showHeaderActions: true, }); ``` ## Customization Settings You can customize your agent component, setting `AgentProps` values like `agentName`, `welcomeText`, and `styleTokens`. ### Example for Agent Name and Welcome Message ```typescript const agent = new AnalyticsAgent({ parentIdOrElement: "agent-container", idOrApiName: "0Xxfib0000000xxxxx", agentName: "Sales Insights Agent", welcomeText: "Hello! Ask me anything about your sales data.", }); ``` ### Example for welcome image and agent avatar Override the welcome-screen image and the avatar shown next to inbound (agent) messages with the optional `welcomeImage` and `agentAvatar` props. Each takes an image `src` and an optional `alt` string for screen readers. ```javascript const agent = new AnalyticsAgent({ parentIdOrElement: 'agent-container', idOrApiName: '<%- agent-id %>', welcomeImage: {src: 'https://cdn.example.com/img/welcome.png', alt: 'Welcome to Sales Insights'}, agentAvatar: {src: 'https://cdn.example.com/img/agent-avatar.png', alt: 'Sales Insights agent'} }); agent.render(); ``` When embedding via the `` HTML element, pass each override as a JSON-encoded `welcome-image` / `agent-avatar` attribute: ```html ``` | Property | Type | Description | | -------------- | -------------- | -------------------------------------------- | | `welcomeImage` | `WelcomeImage` | Image shown on the agent welcome screen. | | `agentAvatar` | `AgentAvatar` | Avatar shown next to inbound agent messages. | Each `src` must be a `https://` URL (with no embedded credentials) or a root-relative path under `/img/`. Any other value is ignored, and the default image is used. The image host must also be trusted by your org, or the browser blocks the image and the default is shown. To trust the host: 1. In Salesforce Setup, go to **Security** > **Trusted URLs**. 2. Click **New Trusted URL**. 3. In **URL**, enter the image host. For example, `https://cdn.example.com`. 4. Under **CSP Directives**, enable **img-src**. 5. Click **Save**. ### Example for Style Tokens ```typescript const agent = new AnalyticsAgent({ parentIdOrElement: "agent-container", idOrApiName: "0Xxfib0000000xxxxx", showHeader: true, agentName: "Revenue Insights", welcomeText: "Ask me anything about your revenue data.", styleTokens: { containerBackground: "#faf5ff", headerBackground: "#ede9fe", headerBlockTextColor: "#5b21b6", welcomeBlockTextColor: "#4c1d95", welcomeBlockFontSize: "26px", welcomeBlockFontWeight: "600", messageBlockInboundBackgroundColor: "#ede9fe", messageBlockInboundTextColor: "#3b0764", messageBlockOutboundBackgroundColor: "#7c3aed", messageBlockOutboundTextColor: "#ffffff", messageInputTextBackgroundColor: "#faf5ff", messageInputFooterBorderFocusColor: "#8b5cf6", messageInputFooterSendButton: "#ec4899", }, }); ``` To view all the available style tokens, see [`AgentStyleTokens`](/docs/analytics/sdk/references/sdk-js-v11/AgentStyleTokens.html) A smaller Salesforce Slack-themed agent ![A Salesforce Slack-themed agent ](https://developer.salesforce.com/docs/media/sdk/embedded_agent_small_slack_theme.png '{"class": "image-xs"}') A larger Salesforce Slack-themed agent ![A Microsoft Teams-themed agent embedded in Teams](https://developer.salesforce.com/docs/media/sdk/embedded_agent_large_theme.png '{"class": "image-lg"}') Themed agents embedded in external web apps ![A dark themed agent embedded in an external web app](https://developer.salesforce.com/docs/media/sdk/embedded_agent_dark_theme.png '{"class": "image-xs"}') ![A green-themed agent embedded in an external web app](https://developer.salesforce.com/docs/media/sdk/embedded_agent_green_theme.png '{"class": "image-xs"}') ## Events Use the `COMPONENT_LOADED` event to listen for when the agent component is successfully loaded with an active session and is ready for interaction. Listen for `ERROR` events, using the payload to get details for troubleshooting. ```Typescript import {EventName} from '@salesforce/analytics-embedding-sdk'; agent.addEventListener(EventName.COMPONENT_LOADED, () => { console.log('Agent is ready'); }); agent.addEventListener(EventName.ERROR, (event) => { console.error('Agent error:', event); }); ``` ## Start a New Agent Session Programmatically ```typescript await agent.startNewAgentSession(); ``` ## Reference For detailed reference, see: - [`AnalyticsAgent`](/docs/analytics/sdk/references/sdk-js-v2/AnalyticsAgent.html) class - [`AgentContextType`](/docs/analytics/sdk/references/sdk-js-v2/AgentContextType.html) enum - [`AgentProps`](/docs/analytics/sdk/references/sdk-js-v2/AgentProps.html) type ## Agent Troubleshooting These are possible errors users might see when using the agent and suggestions on resolving them. | Error Message | Possible Resolutions | | ------------------------------------ | --------------------------------------------------------------------------------------------------------- | | "Something went wrong, try again" | Users can check the access in the agent access section. The Agent `idOrApiName` value might be incorrect. | | Agent doesn't understand the context | Check the topic in the agent home. Check the context in the code. | # ends_with() Returns `true` if the string ends with the specified characters. ## Syntax `ends_with(string, suffix)` ## Usage Returns `true` if ends with _suffix_, otherwise returns `false`. String comparison is case-sensitive. If any of the parameters are `null`, then the function returns `null`. If _suffix_ is an empty string, then the function returns `null`. ## Example ```nolang ends_with("FIT", "T") == true ends_with("FIT", "BIT") == false ``` # ends_with({source_str}, {search_str}) Returns a Boolean indicating whether a string ends with the search string. `ENDS_WITH()` follows this syntax. - _source_str_ - : The string to be searched. - _search_str_ - : The string to search for within the source string. ## Example This example returns a Boolean that confirms whether the value in the `City` field ends with “ale.” ```nolang SELECT City, ENDS_WITH(City, "ale") as "endValue" FROM "Superstore" LIMIT 5; ``` | City | endValue | | --------------- | -------- | | Henderson | false | | Henderson | false | | Los Angeles | false | | Fort Lauderdale | true | | Fort Lauderdale | true | # Enhance Your Dashboard Functionality with Custom LWC Extensions Use custom Lightning Web Components (LWC) to augment native Tableau Next dashboards with your own custom functionality. With the Dashboard Extension SDK, your custom components interact directly with the data and widgets in your dashboards. Because these extensions inherit global dashboard styling and respond to filter updates, they provide a cohesive and native user experience. This guide covers implementing and integrating custom LWCs into Tableau Next dashboards with the Component Widget framework. ## Prerequisites - Install VS Code and configure it for Salesforce development. Use these Trailhead modules for installation and configuration: - [Quick Start: Visual Studio Code for Salesforce Development](https://trailhead.salesforce.com/content/learn/projects/quickstart-vscode-salesforce) - [Quick Start: Lightning Web Components - Set Up Visual Studio Code](https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/set-up-visual-studio-code) - Install the [Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm). ## Build Your Custom LWC Build a custom LWC for your dashboard with this approach. ### Decide between hard-coded and dynamic data binding Your custom LWC references the dashboard data source, either hard-coded or through dynamic data binding. Use dynamic data binding to create a more powerful and flexible dashboard extension. | Type | Hard-Coded | Data-Bound | | ---- | ---------- | ---------- | | **Semantic model** | Set in code | Selected by the author | | **Fields** | API names set in code | Mapped in the configuration UI | | **Retarget** | Edit code and redeploy | Change a property value | | **Use when** | One extension serves one model | One extension serves many models or orgs | ### Compare hard-coded and dynamic binding When hard coding, the component owns the binding contract. You create variables for your data source, dimensions, and measures, and then assign static values to these variables. Hard coding example: ```javascript const DATA_SOURCE = 'Superstore'; const DIMENSION = 'Orders.Region'; ``` For dynamic binding, the SDK provides well-defined types, `SemanticModel`, `SemanticMeasure`, and `SemanticDimension`, which the dashboard author uses to select the data source, measure, and dimension at runtime. Your component then reads the resolved values from these types. Dynamic binding example: ```javascript @api sdmName; // semantic model @api measureField; // measure + aggregation @api dimensionField; // dimension ``` ### Create the component To build a custom LWC, follow the steps in [Create a Hello World Lightning Web Component](https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/create-a-hello-world-lightning-web-component). ## Enable the Component Widget ### Required metadata To make your custom LWC visible in the Tableau Next dashboard extension picker, your LWC must include the `analytics__Dashboard` target in the component metadata file. ```xml analytics__Dashboard ``` Set the LWC's display name and description, which appear in the extension picker. ```xml My Custom Component A unique description for my custom component. ``` ### Optional metadata for data binding To use data binding, declare the data properties in `targetConfigs`. Set `label` and `description` for each property, because these values render in the configuration UI. You must name `label` by role, such as `Group-by Dimension`, not by variable name. When the LWC declares these types, the configuration UI passes an object for each property. Because these object shapes are guaranteed, read the values directly. The defined data types are `SemanticModel`, `SemanticMeasure`, and `SemanticDimension`. For a semantic model, the component sets the `apiName` and `id` values internally from the configuration UI. Don't specify these values in the metadata configuration. The configuration UI adds an `aggregation` selector automatically for measure fields. #### Data type syntax ```text type SemanticModel = { apiName: string; // data source developer name id: string; // data source ID label: string; // display name } type SemanticMeasure = { name: string; // qualified: Table.Field aggregation: string; // e.g. "Sum" label: string; } type SemanticDimension = { name: string; // qualified: Table.Field label: string; } ``` #### Data type example ```text sdmName apiName: superstore3 id: 2SMUA000000OXXXXXX label: Superstore measureField name: superstore3.Sales134 aggregation: Sum label: Sales dimensionField name: superstore3.Region457 label: Region ``` How to use each defined value in your component code: - `apiName` — pass as the data source name for `applyFilter()`. - `name` — use in query field expressions. Qualified as `ModelName.Field`; split on the `.`. - `label` — use for display text such as column headers. Don't derive labels from field names. - `aggregation` — use for aggregating measure values, `this.measureField?.aggregation;` #### Metadata example ```xml 66.0 ``` ### Deploy your component Deploy your custom LWC into your org. Use the VS Code palette commands `SFDX: Authorize an Org` and `SFDX: Deploy This Source to Org`. ## Add Your Custom Component to Your Dashboard After deploying your custom LWC to your org, add the component to your Tableau Next dashboard. Use the widget configuration to customize the component functionality and dynamically bind to data sources in your org. ### Add a widget 1. In Tableau Next, open your dashboard for editing. 2. Click the Extension icon and select an area of the dashboard. ![Tableau Next dashboard extension menu option](https://developer.salesforce.com/docs/media/tn-isv-dev/tn_isv_dashboard_ext_menu.png '{"class": "image-md"}') 3. Click **Add Extension**. 4. Select your custom component and click **Select**. 5. Set properties for the component on the widget panel, or replace it with a different component. 6. Set the widget style on the design panel. ### Configure the data bindings in the widget panel Use the widget panel to bind your data. ![The properties panel for a Tableau Next dashboard extension widget.](https://developer.salesforce.com/docs/media/tn-isv-dev/tn_isv_dashboard_ext_widget_properties.png '{"class": "image-md"}') 1. Select a semantic model. 2. Map each measure and dimension property to a field in the selected model. 3. If applicable, select the aggregation for any measure fields. 4. Save and confirm that the extension renders data. To retarget the component, select a different semantic model and map the properties, and then save. No redeployment of the component is required. ## Use the Dashboard Extension SDK Pass dashboard filters, parameters, and state to your custom LWC with the Dashboard Extension SDK, so your LWC to interacts with the data in your dashboard. The Dashboard Extension SDK is the integration layer and secure boundary between the Tableau Next dashboard runtime and custom LWC. Extensions receive the SDK via `DashboardWidgetComponentProps` and use it to read dashboard context, subscribe to runtime events, and publish filters or parameters. ### Get the Dashboard Extension SDK Each dashboard extension widget automatically includes the SDK. In your component, the SDK is available as the `sdk` property passed with your widget properties. The constructor registers with the runtime so that when filters or parameters are applied elsewhere on the dashboard, the SDK sends `FILTER_CHANGE` and `PARAMETER_CHANGE` events to your subscribers. ### API Overview #### Context Retrieve the current dashboard context. ```javascript @returns (Record) getContext() ``` This method optionally takes the parameters: - `currentPage` - (`string`) the name of the current dashboard page - `currentLayout` - (`string`) the name of the current dashboard layout - `dashboardState.filters` - (`array`) a list of the current semantic filters - `dashboardState.parameters` - (`array`) a list of the current parameters #### Events Use `SDK_EVENTS` to subscribe to dashboard runtime events. | Event | Constant | When Fired | | ----- | -------- | ---------- | | Filter change | `SDK_EVENTS.FILTER_CHANGE` | Dashboard filters change | | Parameter change |`SDK_EVENTS.PARAMETER_CHANGE` | Dashboard parameters change | `on(eventName, handler)` subscribes to an event. Returns an `unsubscribe` function. `off(eventName, handler)` removes an event subscription. ```javascript const SDK_EVENTS = { FILTER_CHANGE: 'filterChange', PARAMETER_CHANGE: 'parameterChange', }; ``` `FILTER_CHANGE` and `PARAMETER_CHANGE` are fired internally when the runtime invokes the callbacks for `setApplyFilter` and `setApplyParameter`, which the SDK registered during construction. #### Actions Extension actions are available in `sdk.actions`. **`applyFilter()`** Publish a filter to the dashboard. `sdk.actions.applyFilter(filter)` `filter` is an object with: - `fieldOrFields` — `string[]` for a single field or `string[][]` for multiple fields - `values` — `string[]` for a single value or `string[][]` for multiple values; for values for multiple fields, use an array of value tuples - `operator` — `string` filter operator; defaults to `In` - `dataSourceName` — `string` the optional data source name; defaults to the value from `registerDataSource` **`applyParameter()`** Publish a parameter for the dashboard to use in a query. `sdk.actions.applyParameter(parameter)` `parameter` is an object with: - `name` — `string` the parameter name - `value` — `string` the parameter value - `dataSourceName` — `string` the optional data source name. Specify a data source name or the value from `registerDataSource`. **`notifyLifecycleChange()`** Notifies when the lifecycle state of the component changes. For each state, add a `notifyLifecycleChange()` call so the dashboard renders consistently instead of showing a blank widget. `sdk.actions.notifyLifecycleChange(eventName, details?)` `eventName` — `string` event name, valid values are: - `LIFE_CYCLE_EVENTS.INIT` — component initializing - `LIFE_CYCLE_EVENTS.LOADED` — component loaded successfully, query returned successfully - `LIFE_CYCLE_EVENTS.ERROR` — component is in an error state: query failure or invalid configuration - `LIFE_CYCLE_EVENTS.NODATA` — component query returns no results `details` — an object with: - `message` — `string` the optional event message - `error` — `string` the optional error message #### Query a bound semantic model The data shapes for the component metadata are guaranteed, so read the values directly. You don't have to verify the shape in code, only verify that the required properties are mapped. The properties are undefined until they're mapped in the extension widget panel. ```javascript get isConfigured() { return Boolean(this.sdmName && this.measureField && this.dimensionField); } get aggregationMethod() { return `SEMANTIC_AGGREGATION_METHOD_${this.measureField.aggregation.toUpperCase()}`; } buildFieldExpression(name) { const p = name.split('.'); return p.length === 2 ? { table_field: { name: p[1], table_name: p[0] } } : { semantic_field: { name } }; } // Query only when isConfigured is true. if (this.isConfigured) { const dim = this.dimensionField.name; const msr = this.measureField.name; const query = { fields: [ { expression: this.buildFieldExpression(dim), alias: dim, rowGrouping: true }, { expression: this.buildFieldExpression(msr), alias: msr, rowGrouping: false, semanticAggregationMethod: this.aggregationMethod } ], options: { limitOptions: { limit: 101 } } }; const rows = await this.sdk.fetchDataUsingQueryAndSource(query, this.sdmName.apiName); } ``` Always set `limitOptions.limit`, because high-cardinality dimensions can return more rows than an extension can render. #### Create filters from a bound field Use dynamically bound fields to create dynamic filters. ```javascript this.sdk.actions.applyFilter({ fieldOrFields: this.dimensionField.name, values: [selectedValue], operator: 'In', dataSourceName: this.sdmName.apiName }); ``` #### React to runtime updates When using dynamic data binding, re-query to pick up runtime changes to data values. Write code to handle: - When a bound property changes. Querying only in `connectedCallback()` means that the user sees stale data when editing data bindings. - When `FILTER_CHANGE` events occur, so the extension component responds to the dashboard filters, not just the component controls. ## Dashboard Extension SDK Example This example shows how to use the Dashboard Extension SDK in your component JavaScript. ```javascript // In your extension component, define sdk prop as @api. // After the extension component is connected, sdk is available for use @api sdk; // Define dynamic data binding properties @api sdmName; @api measureField; @api dimensionField; // Register the data source that your extension uses or pass dataSourceName on each filter or parameter connectedCallback() { // React to filter changes this.unsubscribe = this.sdk.on(SDK_EVENTS.FILTER_CHANGE, (filters) => { // update your UI with filters }); } disconnectedCallback() { // Clean up this.unsubscribe(); } // Get the dashboard context const { currentPage, dashboardState } = this.sdk.getContext(); // Apply a single field filter from the extension to the dashboard (Hardcoded filter value) this.sdk.actions.applyFilter({ fieldOrFields: 'Account.Type', operator: 'In', values: ['A', 'B'], dataSourceName: 'myDataSDM' }); // Apply a parameter this.sdk.actions.applyParameter({ name: 'Region', value: 'East', dataSourceName: 'myDataSDM' }); // Report a loaded lifecycle event this.sdk.actions.notifyLifecycleChange(LIFE_CYCLE_EVENTS.LOADED); // Report an error lifecycle event with details this.sdk.actions.notifyLifecycleChange(LIFE_CYCLE_EVENTS.ERROR, { message: 'Load failed' }); // Use dynamic values from data binding get isConfigured() { return Boolean(this.sdmName && this.measureField && this.dimensionField); } get aggregationMethod() { return `SEMANTIC_AGGREGATION_METHOD_${this.measureField.aggregation.toUpperCase()}`; } buildFieldExpression(name) { const p = name.split('.'); return p.length === 2 ? { table_field: { name: p[1], table_name: p[0] } } : { semantic_field: { name } }; } // Query only when isConfigured is true. if (this.isConfigured) { const dim = this.dimensionField.name; const msr = this.measureField.name; // Apply dynamic filter this.sdk.actions.applyFilter({ fieldOrFields: this.dimensionField.name, values: [selectedValue], operator: 'In', dataSourceName: this.sdmName.apiName }); const query = { fields: [ { expression: this.buildFieldExpression(dim), alias: dim, rowGrouping: true }, { expression: this.buildFieldExpression(msr), alias: msr, rowGrouping: false, semanticAggregationMethod: this.aggregationMethod } ], options: { limitOptions: { limit: 101 } } }; const rows = await this.sdk.fetchDataUsingQueryAndSource(query, this.sdmName.apiName); if (rows) { this.sdk.actions.notifyLifecycleChange(LIFE_CYCLE_EVENTS.LOADED); } else { this.sdk.actions.notifyLifecycleChange(LIFE_CYCLE_EVENTS.ERROR, { message: 'Query failed' }); } } else { this.sdk.actions.notifyLifecycleChange(LIFE_CYCLE_EVENTS.ERROR, { message: 'Configuration failed' }); } ``` ## Generate a Dashboard Extension with an AI Agent When prompting an AI agent to generate a dashboard extension, include enough detail to avoid common mistakes. For example, to prevent the agent from hard coding values, specify these directives in your prompts: 1. Specify the `analytics__Dashboard` target, and set `masterLabel` and `description`. 2. Declare `SemanticModel`, `SemanticMeasure`, and `SemanticDimension` properties, and mark required ones. 3. Read properties as `@api` values — don't hard code field API names. 4. Build the query at runtime from resolved values. 5. Show a configuration message when required properties are unmapped. 6. Publish selections with `applyFilter`. Review the generated metadata file to confirm property types before deploying. ## Verify Dynamic Binding After deploying your component, verify that the dynamic data binding works as expected. 1. Load the extension with no data mapped. 2. Select a semantic model and confirm the extension renders the data. 3. Select another model with different field names and confirm the updated data renders. This step catches accidental hard coding. ## Considerations and Limitations Each component is responsible for its own internal access checks. If a permission error occurs, the component must notify the dashboard via an event to allow for consistent error propagation. LWC support on mobile operating systems is limited. Rendering components on mobile devices can cause errors. For dynamic data binding, keep these points in mind. - Set the component `apiVersion` to 66.0 or later. Earlier versions don't render semantic property pickers. - Semantic property types require dynamic data binding enabled in the org. Without it, the configuration panel is empty. - Deleting a bound field from the model leaves the property unresolved. Handle the empty value and remap. - Renaming or removing a property breaks dashboards that already mapped it. Add new optional properties rather than repurposing existing ones. - Interactive marks that publish filters must be keyboard operable with ARIA state. Extensions automatically inherit dashboard styling, but not accessibility behavior. Implement keyboard and ARIA support yourself. ## Troubleshooting - Your component isn't in the extension picker — missing `analytics__Dashboard` target or `masterLabel`. Add both and redeploy. - The configuration panel is empty — data binding unavailable in the org, or the `apiVersion` is too low. - Configuration failures after data mapping — a property resolved to an empty value. Make sure to handle both string and object shapes. - Native visualizations don't respond to `applyFilter` — the field reference or `dataSourceName` doesn't match the visualization. Log the response and use the qualified field name. - Deployment fails after removing a property — component validation reconciles against the deployed version. Delete the component from the org, and then redeploy. - Your changes don't appear after deployment — the old version is cached. Hard refresh, or remove and re-add the extension. # Equality Filter Interactions You can bind filters based on certain conditions. CRM Analytics supports multiple operators that provide flexibility when defining the conditions. ## Filter Example (SAQL Form) Let's say you have these results from the source query. ```json [ {grouping: "first", measure: 19} {grouping: "second", measure: 32} ] ``` You can bind a filter using the `asEquality()` interaction function. This filter condition determines whether the returned value equals `“bar"`. ```javascript q = filter q by {{cell(stepFoo.selection, 1, "measure").asEquality("bar")}}; ``` After evaluating the interaction based on the data returned from the source query, CRM Analytics produces this filter. ```javascript q = filter q by bar == 32; ``` **note:** If a selection returns multiple values, `asEquality()` inserts the `'in'` operator, instead of `==`, in the filter statement. For example, this filter condition determines if any value in the `“grouping”` column equals `“bar”`. ```javascript q = filter q by {{column(stepFoo.selection, ["grouping"]).asEquality("bar")}}; ``` If the selection returns `first` and `second`, the filter becomes: ```javascript q = filter q by bar in ["first","second"]; ``` ## Filter Example with the in Operator (Compact Form) Let’s say you want to filter the Case by Status widget in this dashboard based on the account selected in the Account list widget. ![The Account list widget filters the other widgets in the dashboard based on the selected account.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_binding_query_filter_compact_form.png) Faceting doesn’t work in this case because the queries on these widgets are based on different datasets. To enable filtering, create an interaction in the Cases by Status widget’s query (`Status_1`) based on the selection in the Account widget’s query (`AccountId_Name_1`). This interaction compares the value of the `AccountId.Name` field in the `Status_1` query to the selected values in the `AccountId.Name` field of the `AccountId_Name_1` query. Because there can be multiple selected account names, use the `in` operator. ```json "steps": { "Status_1": { "datasets": [{ "id": "0FbB00000000rlDKAQ", "label": "CasesAccounts", "name": "CasesAccounts", "url": "/services/data/v38.0/wave/datasets/0FbB00000000rlDKAQ" }], "isFacet": true, "isGlobal": false, "query": { "measures": [ [ "count", "*" ] ], "groups": [ "Status" ], "filters": [ [ "AccountId.Name", "{{column(AccountId_Name_1.selection, [\\"AccountId.Name\\"]).asObject()}}", "in" ] ] }, "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "visualizationType": "hbar", "options": {} } }, "AccountId_Name_1": { "datasets": [{ "id": "0FbB00000000rlIKAQ", "label": "OpptiesAccountsSICsUsers", "name": "OpptiesAccountsSICsUsers", "url": "/services/data/v38.0/wave/datasets/0FbB00000000rlIKAQ" }], "isFacet": true, "isGlobal": false, "query": { "measures": [ [ "count", "*" ] ], "groups": [ "AccountId.Name" ] }, "selectMode": "single", "type": "aggregateflex", "useGlobal": false, "visualizationParameters": { "options": {} } } ... ``` ## Filter Example with an Inequality Operator (SAQL Form) Let's say you have these results from a source query. ```json [ {grouping: "first", measure: 19} {grouping: "second", measure: 32} ] ``` You can create a filter interaction using on an inequality operator. ```javascript q = filter q by bar > {{cell(queryFoo.selection, 1, "measure").asString()}}; ``` After evaluating the interaction, the filter becomes: ```javascript q = filter q by bar > 32; ``` ## Filter Example with the matches Operator (SAQL Form) Let's say you have these results from a source query. ```json [ {grouping: "first", measure: 19} {grouping: "second", measure: 32} ] ``` You can create a filter interaction using on the matches operator. ```javascript q = filter q by bar matches "{{cell(queryFoo.selection, 1, "grouping").asString()}}"; ``` After evaluating the interaction, the filter results are: ```javascript q = filter q by bar matches "second"; ``` # Examples Learn how to run a report, refresh dashboard data, and send analytic notifications with these hands-on Reports and Dashboards REST API examples. - **[Reports Examples](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/examples-analytics-rest-api-reports-intro.md)** Learn how to run, create, edit, or delete reports with the Reports REST API. Running a report returns a fact map that describes report data. Learn how to read report fact maps. - **[Dashboards Examples](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/examples-analytics-rest-api-dashboards-intro.md)** Learn how to refresh, create, edit, copy, and delete dashboards. - **[Downloads Examples](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/examples-analytics-rest-api-downloads-intro.md)** Learn how to download dashboards, lenses, and reports as images or PDFs. - **[Notifications Examples](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/examples-analytics-rest-api-notifications-intro.md)** Learn how to refresh, create, edit, copy, and delete analytic notifications. Analytic notifications are surfaced in the Salesforce user interface as report subscriptions, dashboard subscriptions, or Analytics notifications. # Examples These hands-on SAQL examples walk you through writing a query to retrieve data - **[Analyze Your Data Over Time](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-dates.md)** Use SAQL date functions for advanced time-based analysis. - **[Calculate How Long Activities Take](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-daysbetween.md)** Use `daysBetween()` and `date_diff()` to calculate the difference between two dates or times. - **[Display the Opportunities Closed This Month](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-date-examples.md)** Use relative date ranges to filter opportunities closed in the current month. - **[Forecast Future Data Points with timeseries](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-timeseries.md)** Use existing data to predict what might happen in the future. - **[Combine Data from Multiple Data Streams with cogroup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-cogroup.md)** You can combine data from two or more data streams into a single data stream using `cogroup`. The data streams must have at least one common field. - **[Replace Null Values with coalesce()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-coalesce.md)** When you use a left outer or full outer `cogroup` To blend data, unmatched data comes through as null. Use `coalesce()` To replace null values with the value of your choice. - **[Dynamically Display Your Top Five Reps with Windowing](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-top5.md)** Windowing functions perform calculations over a dynamic range. - **[Append Datasets using union](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-union.md)** You can append data from two or more data streams into a single data stream using `union`. The data streams must have the same field names and structure. - **[Calculate the Slope of the Regression Line](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-stats.md)** Use SAQL to perform linear analysis on your data to find the line that best fits the data. Then use .`regr_slope` to return the slope of this line. - **[Show the Top and Bottom Quartile](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-topbotquartile.md)** Use SAQL to calculate percentiles, like the top and bottom quartile of your data. - **[Calculate Grand Totals and Subtotals with the rollup Modifier and grouping() Function](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-rollup-grouping.md)** Calculate subtotals of grouped data in your SAQL query using the `rollup` modifier on the `group by` statement, then work with subtotaled data using `grouping()`. For example, to see the subtotaled value of opportunities by type and lead source, roll up the type and lead source groups. Then, label the subtotals with the grouping function. # excludes and excludeSelected Attributes in Variables In variables, use the `excludes` attribute in variables to define values to exclude from selections in response to wizard questions. Use the `excludeSelected` attribute to exclude values that have already been selected in previous wizard questions. ## "excludes" Attribute Regex Token Definition: `"//flags"` Flags are characters that Javascript RegEx global object takes, for example: g, i, m, u, and so on. Refer to the [RegEx Object API documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) for details. Example `excludes` statements: - `"excludes" : ["Name", "/^(Billing).+/"]`—Excludes `Name` field and all the fields that start with `Billing`. - `"excludes" : ["/^(?!Billing)^(?!Shipping).+/"]`—Excludes all fields except fields that start with `Billing` or `Shipping`. - `"excludes" : ["/.+(_kav)$/"]`—Excludes all fields that end with `_kav`. - `"excludes" : ["/^(?:(?!_kav).)*$/"]`—Excludes all fields except fields that end with `_kav`. - `"excludes" : ["/(?!^Case$|^Account$)(^.*$)/"]`—Excludes all objects except `Case` and `Account`. **note:** Including a value in `defaultValue` that is excluded results in an error. ## excludeSelected Attribute In this example, the option selected in `SObjectField1` picker isn’t available in `SObjectField2` picker. ```nolang "SObjectField1" : { "label" : "Select a field from account", "description" : "First account field.", "defaultValue" : { "sobjectName" : "Account", "fieldName" : "" }, "required" : true, "excludeSelected" : true, "variableType" : { "type" : "SobjectFieldType" } }, "SObjectField2" : { "label" : "Select another field from account", "description" : "Second account field.", "defaultValue" : { "sobjectName" : "Account", "fieldName" : "" }, "required" : true, "excludeSelected" : true, "variableType" : { "type" : "SObjectFieldtype" } } ``` # Execute Async Runs an instance of a report asynchronously with or without filters and returns a handle that stores the results of the run. The results can contain summary data with or without details. ## Resource URL ```nolang /services/data//analytics/reports//instances ``` ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |POST|Runs an instance of a report asynchronously. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-get-reportdata.md). Also see this [example of a GET request](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-list-asyncreportruns.md) that returns a list of asynchronous runs of a report.| ## POST Request Body |Property|Type|Description| |--------|----|-----------| |`aggregates`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field can be referenced in a row-level formula (true) or not (false).| |`buckets`|[Bucket field](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a bucket field.| |`chart`|[Chart[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Details about the chart used in a report.| |`crossFilters`|[Cross filter](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|Cross filters applied to the report.| |`customDetailFormula`|[Custom Detail Formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|An array of objects that describes row-level formulas.| |`customSummaryFormula`|[Custom summary formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a custom summary formulas.| |`currency`|String|Report currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is `null` if the organization does not have Multi-Currency enabled.| |`dashboardSetting`|Name/value pair|Allows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The `Name` and `Value` fields in `dashboardSetting` are used as Grouping and Aggregate in dashboard components.| |`detailColumns`|Array of strings|Unique API names for the fields that have detailed data.| |`developerName`|String|Report API name.| |`division`|String|Determines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.| |`folderId`|String|ID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.| |`groupingsAcross`|[Groupings across[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.| |`groupingsDown`|[Groupings down[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each row grouping in a report. The identity is `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for grouping.| |`hasDetailRows`|Boolean|Indicates whether to include detailed data with the summary data.| |`hasRecordCount`|Boolean|Indicates whether the report shows the record count.| |`historicalSnapshotDates`|Array of strings|List of historical snapshot dates.| |`id`|String|Unique report ID.| |`name`|String|Display name of the report.| |`presentationOptions`|[Report presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Display options in the Lightning Report Builder.| |`reportBooleanFilter`|String|Logic to parse custom field filters. Value is `null` when filter logic is not specified.| |`reportFilters`|[Filter details[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of each custom filter in the report along with the field name, filter operator, and filter value.| |`reportFormat`|String|Format of the report. Possible values are `TABULAR`, `SUMMARY`, `MATRIX`, or `MULTI_BLOCK`. The `MULTI_BLOCK` property is available in API version 43.0 and later.| |`reportType`|Report type|Unique API name and display name for the report type. `type` (string) is the unique identifier of the report type. `label` (string) is the display name of the report type.| |`scope`|String|Defines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`showGrandTotal`|Boolean|Indicates whether the report shows the grand total.| |`showSubtotals`|Boolean|Indicates whether the report shows subtotals, such as column or row totals.| |`sortBy`|Array of strings|API name of the field on which the report is sorted and the direction of the sort (asc or desc).| |`standardDateFilter`|Array of strings|Standard date filters available in reports. Each standard date filter contains the following properties: `column` (API name of the date field on which you filter the report data), `durationValue` (the range for which you want to run the report; the value is a date literal or 'CUSTOM.'), `startDate` (start date), and `endDate` (end date).| |`standardFilters`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsRoleHierarchy`|Boolean|Indicates whether the report type supports role hierarchy filtering (true) or not (false).| |`topRows`|[Top rows](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a row limit filter applied to the report.| |`userOrHierarchyFilterId`|String|Unique user or role ID of the user or role used by the report's role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!{_column_name_} represents a unique count of values for the specified {_column_name_}. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.” ```nolang { ... "reportBooleanFilter": "(1 OR 2) AND 3", "reportFilters": [ { "value": "Analyst,Integrator,Press,Other", "column": "TYPE", "operator": "notEqual" }, { "value": "100,000", "column": "SALES", "operator": "greaterThan" }, { "value": "Small", "column": "Size", "operator": "notEqual" } ] } } ``` Example sortBy: ```nolang "sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}] ``` ## Response Body |Property|Type|Description| |--------|----|-----------| |`id`|String|Unique ID for an instance of a report that was run asynchronously.| |`status`|String|New if the report run has just been triggered through a request, Success if the report ran, Running if the report is being run, or Error if the report run failed. The instance of a report run can return an error if, for example, your permission to access the report has been removed since you requested the run.| |`url`|String|URL where results of the report run for that instance are stored. The value is `null` if the report couldn’t be run because of an error.| |`ownerId`|String|API name of the user that created the instance.| |`completionDate`|Date, time string|Date, time when the instance of the report run finished. Only available if the report instance ran successfully or couldn’t be run because of an error. Date-time information is in ISO-8601 format.| |`hasDetailRows`|Boolean|When `false`, indicates that summary level data was requested for the report instance. When `true`, indicates that detailed data, which includes summary level data, was requested for the report instance.| |`requestDate`|Date, time string|Date and time when an instance of the report run was requested. Date-time information is in ISO-8601 format.| **See Also** - [Describe](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md) - [Execute Sync](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md) # Execute Sync Runs a report immediately with or without changing filters, groupings, or aggregates and returns the latest summary data with or without details for your level of access. ## Resource URL ```nolang /services/data//analytics/reports/ ``` ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |GET|Get report results. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-get-reportdata.md).| |POST|Get specific results by passing dynamic filters, groupings, and aggregates in the report metadata. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-filter-reportdata.md).| ## POST Request Body |Property|Type|Description| |--------|----|-----------| |`aggregates`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field can be referenced in a row-level formula (true) or not (false).| |`buckets`|[Bucket field](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a bucket field.| |`chart`|[Chart[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Details about the chart used in a report.| |`crossFilters`|[Cross filter](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|Cross filters applied to the report.| |`customDetailFormula`|[Custom Detail Formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|An array of objects that describes row-level formulas.| |`customSummaryFormula`|[Custom summary formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a custom summary formulas.| |`currency`|String|Report currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is `null` if the organization does not have Multi-Currency enabled.| |`dashboardSetting`|Name/value pair|Allows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The `Name` and `Value` fields in `dashboardSetting` are used as Grouping and Aggregate in dashboard components.| |`detailColumns`|Array of strings|Unique API names for the fields that have detailed data.| |`developerName`|String|Report API name.| |`division`|String|Determines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.| |`folderId`|String|ID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.| |`groupingsAcross`|[Groupings across[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.| |`groupingsDown`|[Groupings down[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each row grouping in a report. The identity is `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for grouping.| |`hasDetailRows`|Boolean|Indicates whether to include detailed data with the summary data.| |`hasRecordCount`|Boolean|Indicates whether the report shows the record count.| |`historicalSnapshotDates`|Array of strings|List of historical snapshot dates.| |`id`|String|Unique report ID.| |`name`|String|Display name of the report.| |`presentationOptions`|[Report presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Display options in the Lightning Report Builder.| |`reportBooleanFilter`|String|Logic to parse custom field filters. Value is `null` when filter logic is not specified.| |`reportFilters`|[Filter details[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of each custom filter in the report along with the field name, filter operator, and filter value.| |`reportFormat`|String|Format of the report. Possible values are `TABULAR`, `SUMMARY`, `MATRIX`, or `MULTI_BLOCK`. The `MULTI_BLOCK` property is available in API version 43.0 and later.| |`reportType`|Report type|Unique API name and display name for the report type. `type` (string) is the unique identifier of the report type. `label` (string) is the display name of the report type.| |`scope`|String|Defines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`showGrandTotal`|Boolean|Indicates whether the report shows the grand total.| |`showSubtotals`|Boolean|Indicates whether the report shows subtotals, such as column or row totals.| |`sortBy`|Array of strings|API name of the field on which the report is sorted and the direction of the sort (asc or desc).| |`standardDateFilter`|Array of strings|Standard date filters available in reports. Each standard date filter contains the following properties: `column` (API name of the date field on which you filter the report data), `durationValue` (the range for which you want to run the report; the value is a date literal or 'CUSTOM.'), `startDate` (start date), and `endDate` (end date).| |`standardFilters`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsRoleHierarchy`|Boolean|Indicates whether the report type supports role hierarchy filtering (true) or not (false).| |`topRows`|[Top rows](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a row limit filter applied to the report.| |`userOrHierarchyFilterId`|String|Unique user or role ID of the user or role used by the report's role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!{_column_name_} represents a unique count of values for the specified {_column_name_}. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.” ```nolang { ... "reportBooleanFilter": "(1 OR 2) AND 3", "reportFilters": [ { "value": "Analyst,Integrator,Press,Other", "column": "TYPE", "operator": "notEqual" }, { "value": "100,000", "column": "SALES", "operator": "greaterThan" }, { "value": "Small", "column": "Size", "operator": "notEqual" } ] } } ``` Example sortBy: ```nolang "sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}] ``` ## Response Body |Property|Type|Description| |--------|----|-----------| |`allData`|Boolean|When True, all report results are returned. When False, results are returned for the same number of rows as a report run in Salesforce. For reports that have too many records, use filters to refine results.| |`attributes`|[Attributes](#execute-sync)|Key report attributes and child resource URLs.| |`factMap`|[Fact map](#execute-sync)|Summary level data or both summary and detailed data for each row or column grouping. Detailed data is available if `hasDetailRows` is `true`. Each row or column grouping is represented by combination of row and column grouping keys defined in [Groupings down](#execute-sync) and [Groupings across](#execute-sync). See these [examples of fact map keys](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-factmap-example.md).| |`groupingsAcross`|[Groupings across](#execute-sync)|Collection of column groupings, keys, and their values.| |`groupingsDown`|[Groupings down](#execute-sync)|Collection of row groupings, keys, and their values.| |`hasDetailRows`|Boolean|When true, the fact map returns values for both summary level and record level data. When false, the fact map returns summary values.| |`hasExceededTabularRowLimit`|Boolean|When True, returns results for the same number of rows as a report run in Salesforce. For a report on Salesforce Objects, total and subtotal rows don't count toward this limit. For a report on Data 360 Objects, total and subtotal rows do count toward this limit. When False, all report results are returned.| |`reportExtendedMetadata`|[Report extended metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Additional information about columns, summaries, and groupings.| |`reportMetadata`|[Report metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Unique identifiers for groupings and summaries.| **Attributes** |Property|Type|Description| |--------|----|-----------| |`describeUrl`|String|Resource URL to get report metadata.| |`instancesUrl`|String|Resource URL to run a report asynchronously. The report can be run with or without filters to get summary or both summary and detailed data. Results of each instance of the report run are stored under this URL.| |`type`|String|API resource format.| |`reportName`|String|Display name of the report.| |`reportId`|String|Unique report ID.| **Fact map** |Property|Type|Description| |--------|----|-----------| |`rows`|[Data cells[]](#execute-sync)|Array of detailed report data listed in the order of the detail columns provided by the report metadata.| |`aggregates`|[Aggregates[]](#execute-sync)|Summary level data including record count for a report.| **Data cells** |Property|Type|Description| |--------|----|-----------| |`value`|[Detail column info data type](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|The value of a specified cell. If the response is an empty string, then API version 36.0 and earlier returns null. API version 37.0 and later returns an empty string.| |`label`|String|Display name of the value as it appears for a specified cell in the report.| **Aggregates** |Property|Type|Description| |--------|----|-----------| |`value`|Number|Numeric value of the summary data for a specified cell.| |`label`|String|Formatted summary data for a specified cell.| **Groupings across** |Property|Type|Description| |--------|----|-----------| |`groupings`|[Groupings[]](#execute-sync)|Information for each column grouping as a list.| **Groupings** |Property|Type|Description| |--------|----|-----------| |`value`|String|Value of the field used as a row or column grouping. The value depends on the field’s data type.| |`key`|String|Unique identity for a row or column grouping. The identity is used by the [fact map](#execute-sync) to specify data values within each grouping.| |`label`|String|Display name of a row or column grouping. For date and time fields, the label is the localized date or time.| |`groupings`|Array|Second or third level row or column groupings. If there are none, the value is an empty array.| |`dategroupings`|Array|Start date and end date of the interval defined by `date granularity`.| Grouping value by field data type: - Currency fields: `amount` (currency; value of a data cell) and `currency` (picklist; the ISO 4217 currency code, if available—for example, USD for US dollars or CNY for Chinese yuan; if the grouping is on the converted currency, this is the currency code for the report and not for the record). - Picklist fields: API name. For example, a custom picklist field, Type of Business with values 1, 2, 3 for Consulting, Services, and Add-On Business, has `1`, `2`, or `3` as the grouping value. - ID fields: API name. - Record type fields: API name. - Date and time fields: Date or time in ISO-8601 format. - Lookup fields: Unique API name. For example, for the Opportunity Owner lookup field, the ID of each opportunity owner’s Chatter profile page can be a grouping value. **Groupings down** |Property|Type|Description| |--------|----|-----------| |`groupings`|[Groupings[]](#execute-sync)|Information for each row grouping as a list.| **See Also** - [Describe](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md) - [Execute Async](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instances-summaryasync.md) # exp({n}) Returns the value of Euler's number e raised to the power of _n_, where e = 2.71828183… The smallest value for _n_ that does not result in 0 is 3e-324. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 700. `exp({n})` takes the following syntax. ```nolang SELECT exp(N) as ALIASNAME FROM DATASET; ``` ## Example This example returns the value of e raised to the 5th power. ```nolang SELECT exp(5) as expExample FROM Superstore LIMIT 1; ``` | expExample | | ---------- | | 148.413 | # exp(n) Returns the value of Euler's number _e_ raised to the power of _n_, where _e_ = 2.71828183… The smallest value for _n_ that doesn’t result in 0 is 3e-324. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 700. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate exp(value) as value; q = filter q by exp(value) < 5; ``` # Extended Metadata (XMD) Overview Use Extended Metadata (XMD) to customize the formatting of fields, field labels, member values, and colors in CRM Analytics dashboards and lenses. Available customizations vary depending on the data source—CRM Analytics datasets, Direct Data/Live Connectors, or Data 360 objects. If you modify the XMD, every UI visualization that uses the underlying data shows the modified format. ## Data Source Types XMD supports three primary data source types. - CRM Analytics Datasets: Manages formatting via dataset-level XMD JSON files (EdgeMartMetadata). - Direct Data/Live Connectors: Applies presentation formatting to live query sources, such as Snowflake Live Connectors. - Data 360 Objects: Supports Data Model Objects (DMOs), Data Lake Objects (DLOs), and Calculated Insight Objects (CIOs). Manages metadata dynamically, without data flows or dataset duplication. ## Customizations by Data Source This table shows which XMD customizations are available for CRM Analytics datasets, Direct Data/Live Connectors, and Data 360 objects (DMOs, DLOs, and CIOs). | Customization | Dataset | Direct Data/Live Connectors | Data 360 Object | | ------------------------------------------------------------------------------ | ------- | --------------------------- | --------------- | | Rename columns (change display labels for dimensions and measures) | Yes | Yes | Yes | | Rename field values | Yes | Yes | Yes | | Customize chart colors based on field values | Yes | Yes | Yes | | Format measures (decimal/grouping separators, prefixes, suffixes, multipliers) | Yes | Yes | No | | Hide or show fields in lens and dashboard | Yes | Yes | No | | Define the first day of the week for the calendar year | Yes | Yes | No | | Add action menus to dimensions | Yes | Yes | No | This is a partial list. For the complete list of dataset and Direct Data/Live Connector customizations, see [Format Dataset Fields and Field Values with XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-formatting-dataset-fields-and-values.md). ## Edit XMD Almost all the XMD functionality is supported in the UI for editing datasets and lenses. Use the **Edit Dataset** page to customize dataset actions, and use the **Lenses Dataset Fields** section to customize other actions. To edit the underlying JSON file for a dataset directly, see [Configure the XMD for a Dataset](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/task/bi-xmd-edit.md). For Data 360 objects, edit XMD directly from a dashboard widget. See [Access Data 360 XMD in the UI](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/task/bi-xmd-access-data-360.md). **note:** XMD acts purely as a presentation layer. It doesn't enforce or override Field-Level Security (FLS). FLS enforcement occurs at query execution time directly in Data Cloud. # Extended Metadata (XMD) Reference You can modify the XMD file to customize the formatting of dataset fields and field values that appear in Analytics lenses and dashboard widgets. Any fields in the XMD that aren’t described in this document aren’t supported and must not be customized. Configuring unsupported fields might cause unexpected behavior. You also can’t export XMD. When saving XMD files, use UTF-8 format to be sure that Analytics visualizations correctly display international characters. Almost all of the XMD functionality is now supported in the UI for editing datasets and lenses. The **Edit Dataset** page allows you to customize actions for the dataset, and the **Lenses Dataset Fields** section allows you to customize other actions. - **[Dates in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-reference-dates.md)** Specify date conventions for Analytics dashboards and lenses. - **[Dimensions and Derived Dimensions in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-reference-dimensions.md)** You can add an action menu to a dimension value in Analytics lens and dashboard charts and tables. Users can then open a record and perform record-level actions. The available XMD parameters are the same for dimensions and derived dimensions. - **[Measures and Derived Measures in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-reference-measures.md)** You can specify the format and multiplier for each measure. The XMD parameters are the same for measures and derived measures. - **[Organizations in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-reference-organizations.md)** If your datasets combine records from multiple Salesforce orgs, map Salesforce orgs to their URLs. Analytics uses these mappings to locate a record in a multi-org environment. The organizations section is used for opening links, not performing Salesforce actions. - **[ShowDetailsDefaultFields in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-reference-showdetailsdefaultfields.md)** Specify the default fields that appear in a Analytics values table. You can override the defaults and show other fields when you create a values table. **See Also** - [Configure the XMD for a Dataset](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/task/bi-xmd-edit.md) # External Data You can integrate external data into CRM Analytics to make the data available for queries from lenses and designer. ![Diagram of the process for uploading external data to CRM Analytics](https://developer.salesforce.com/media/bi_dev_guide_ext_data/bi_connect_data_external_detail_diagram.png) The External Data API enables you to upload external data files to CRM Analytics. The External Data API can upload .csv files, and you can optionally specify the structure of your data by defining metadata in JSON format. The External Data API is available in API version 31 and later. The high-level steps for uploading external data by using the API are: 1. Prepare your data in CSV format, and then create a metadata file to specify the structure of the data. 2. Connect programmatically to your Salesforce organization. 3. Configure the upload by inserting a row into the InsightsExternalData object, and then set input values such as the name of the dataset, the format of the data, and the operation to perform on the data. 4. Split your data into 10-MB chunks, and then upload the chunks to InsightsExternalDataPart objects. 5. Start the upload by updating the `Action` field in the InsightsExternalData object. 6. Monitor the InsightsExternalData object for status updates, and then verify that the file upload was successful. - **[External Data API Limits](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-limits.md)** When working with the External Data API, consider the following limits, in addition to the general CRM Analytics limits. - **[Prepare Data Files](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-prepare-data.md)** To upload external data from .csv files into a dataset, first prepare your data files. - **[Connect to Salesforce](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-connect-to-sf.md)** After preparing your data files, the next step in loading external data into CRM Analytics is to connect to your Salesforce organization by using standard Salesforce APIs. - **[Configure the Upload](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-configure-upload.md)** Configure the external data upload by inserting a row into the InsightsExternalData object and setting configuration values. - **[Add the Data](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-add-data.md)** When uploading external data files, you can use the InsightsExternalDataPart object to load the data in smaller chunks. - **[Manage the Upload](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-manage-upload.md)** After you’ve created a header and uploaded the data parts by using the `InsightsExternalData` and InsightsExternalDataPart objects, update the Action field on the header object to `Process` to start processing the data. - **[Update the Data](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-incremental-upload.md)** After you upload data into a dataset, update it by adding, upserting, or removing data. - **[External Data Metadata Overview](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/guide/bi-ext-data-schema-overview.md)** To upload external data into a CRM Analytics dataset, make sure that you have prepared your data and metadata files. # External Data API Limits When working with the External Data API, consider the following limits, in addition to the general CRM Analytics limits. | Value | Limit | | -------------------------------------------------------------------------------------------- | ----------------------------------------- | | Maximum file size per external data uploads | 40 GB | | Maximum file size for all external data uploads in a rolling 24-hour period | 50 GB | | Maximum number of external data jobs per dataset that can be run in a rolling 24-hour period | 50 | | Maximum number of characters in a field | 32,000 | | Maximum number of fields in a record | 5,000 (including up to 1,000 date fields) | | Maximum number of characters for all fields in a record | 400,000 | For more information on limits for all supported editions, see External Data Limits in [CRM Analytics Limits](https://help.salesforce.com/s/articleView?id=analytics.bi_limits.htm&type=5). # External Data Metadata Format Reference The metadata describes the structure of external data files. The metadata file is in JSON format. The .json file consists of 3 main sections: file format, object information, and field information. Include all required fields when you create a record, but you can leave out optional fields. ## The File Format Section The file format section of the metadata file specifies information about the format of the data file, including the character set and delimiter character.
Field Name Type Required? Description
charsetName String No

The character set of the .csv file. If this field is included, it must be set to UTF-8.

Example:

"charsetName": "UTF-8"
fieldsDelimitedBy String No

The character that separates field values in the .csv file. Any single character is supported.

Example:

"fieldsDelimitedBy": ","
fieldsEnclosedBy String No

The character that can be used to enclose fields in the .csv file. Any single character that isn’t the fieldsDelimitedBy value is supported. If a double quote is used within a field, escape it by preceding it with another double quote.

Example:

"fieldsEnclosedBy": "\""
fieldsEscapedBy String No

The character used to escape, or bypass, the creation of a row of data based on detecting the fieldsDelimitedBy value. The default is a double quote, ", which would surround the data to escape.

Example:

"fieldsEscapedBy": "\\"

See example below table.

linesTerminatedBy String No

Deprecated. Do not use.

numberOfLinesToIgnore Number No

The number of lines for the parser to ignore. (Allows you to specify a header.)

  • When the .csv file doesn’t have a header, set to 0.
  • When the .csv file has a header, set to 1.

The default value is 1.

Example:

"numberOfLinesToIgnore": 1
**fieldsEscapedBy Example:** This is an alternate escaping option to `fieldsEnclosedBy`. To illustrate, if `fieldsDelimitedBy` is comma, `fieldsEnclosedBy` is double quote, and `fieldsEscapedBy` is backslash, these two lines would result in the same thing: ```nolang col1,"col,with,commas",col3 col1,col\,with\,commas,col3 ``` ## The Objects Section The objects section of the metadata file specifies information about the top-level database object, including object-level security information, display name, and API name. **note:** The metadata file can contain only 1 object definition.
Field Name Type Required? Description
rowLevelSecurityFilter String No

The predicate that’s used to apply row-level security on the dataset.

When entering the predicate in the metadata file JSON, escape double quotes around string values.

Example:

"rowLevelSecurityFilter": "'OwnerId' == \"$User.Id\""

For more information about creating the predicate, see the Analytics Security Implementation Guide .

connector String Yes

The string that uniquely identifies the client application.

Example:

"connector": "AcmeCSVConnector"
description String No

The description of the object. Must be less than 1,000 characters.

Example:

"description": "The SalesData object tracks basic sales data."
fullyQualifiedName String Yes

The full path that uniquely identifies the record. Must be less than 1,000 characters.

Example:

"fullyQualifiedName": "CRM.SalesData"

For information on creating valid field names, see Field Name Restrictions in this topic.

label String Yes

The display name for the object. Can be up to 40 characters.

Example:

"label": "Sales Data"
name String Yes

The unique API name for the object. Can be up to 255 characters.

Example:

"name": "SalesData"

For information on creating valid field names, see Field Name Restrictions in this topic.

fields Array Yes

The array of fields for this object.

## The Fields Section The fields section of the metadata file specifies information about each field in the record, including data type and formatting information. **note:** The fields must be in the same order as the CSV columns are in.
Field Name Type Required? Description
fullyQualifiedName String Yes

The full path that uniquely identifies the field (object.field). Must be less than 1,000 characters.

Example:

"fullyQualifiedName": "SalesData.Amount"

For information on creating valid field names, see Field Name Restrictions in this topic.

label String Yes

The display name for the field. Can be up to 255 characters.

Example:

"label": "Opportunity Amount"
name String Yes

The unique API name for the field. Can be up to 255 characters.

Example:

"name": "Amount"

For information on creating valid field names, see Field Name Restrictions in this topic.

description String No

The description of the field. Must be less than 1,000 characters.

Example:

"description": "The Amount field contains the opportunity amount."
isSystemField Boolean No

Indicates whether this field is a system field to be excluded from query results.

Example:

"isSystemField": false
type String Yes

The type of the field. Can be Text, Numeric, or Date.

Example:

"type": "Numeric"
defaultValue String No

The default value of the field, if any. All numeric types require a default value.

isUniqueId Boolean No

Indicates whether this field is the primary key for the record. This field is required for incremental extract. Only 1 field can be set to be the unique ID.

Only text fields can be unique IDs. Numeric, date, and multivalue fields can't be unique IDs.

Example:

"isUniqueId": false
isMultiValue Boolean No

For text fields only. Indicates whether the field has multiple values. Applies only to Text fields.

Example:

"isMultiValue": false
multiValueSeparator String No

For text fields only. The character that separates multiple values. The default is “;”.

  • If isMultiValue equals true, specify a value.

  • If isMultiValue equals false, this field can be set to null.

Example:

"multiValueSeparator": ";"
format String Yes (for Date values only)

The format of the date or numeric value. See also: Date Formats and Numeric Formats .

Example:

"format": "dd-MM-yy HH:mm:ss" (Date)

Example:

"format": "$#,##0.00" (Numeric)

precision Number Yes (for Numeric values)

The maximum number of digits in a numeric value, or the length of a text value.

For numeric values: Includes all numbers to the left and to the right of the decimal point (but excludes the decimal point character). Value can be up to 18.

For text values: Value defaults to 255 characters, but can be up to 32,000 characters.

Example:

"precision": 10
scale Number Yes (for Numeric values)

The number of digits to the right of the decimal point in a numeric value. Must be less than the precision value.

Example:

"scale": 2
canTruncateValue Boolean No

For text fields only. Indicates whether to truncate a value when the value exceeds the precision. The default is true.

  • If true, truncates the value.

  • If false, the row is rejected.

Example:

"canTruncateValue": true
currencySymbol String No For numeric fields only. The character that signifies the value’s currency.

Example:

"currencySymbol": "£"
decimalSeparator String No For numeric fields only. The character that separates digits in a decimal number. Can be used to handle international number formats where the decimal separator is “,”. The default is “.”.

Example:

"decimalSeparator": ","
fiscalMonthOffset Number No

For date fields only. The difference, in months, between the fiscal year and the calendar year. For example, if the fiscal year starts in January, the offset is 0. If the fiscal year starts in October, the offset is 9.

Example:

"fiscalMonthOffset": 9

This attribute also controls whether Analytics generates fiscal date fields. To generate fiscal date fields, set fiscalMonthOffset to a value other than 0.

See also Date Handling in Datasets .

groupSeparator String No For numeric fields only. The character that separates digit groups in a number. Can be used to handle international number formats where the group separator is “.”. The default is “,”.

Example:

"groupSeparator": "."
isYearEndFiscalYear Boolean No

For date fields only. Indicates whether the fiscal year is the year in which the fiscal year ends or begins. Because the fiscal year can start in one calendar year and end in another, specify which year to use for the fiscal year.

  • If true, then the fiscal year is the year in which the fiscal year ends. The default is true.

  • If false, then the fiscal year is the year in which the fiscal year begins.

Example:

"isYearEndFiscalYear": true

This field is relevant only when fiscalMonthOffset is greater than 0.

See also Date Handling in Datasets .

firstDayOfWeek Number No For date fields only. The first day of the week for the calendar year and, if applicable, fiscal year. Use 0 to set the first day to be Sunday, 1 to set the first day to be Monday, and so on. Use -1 to set the first day to be January 1. The default is -1.

Example:

"firstDayOfWeek": 0

See also Date Handling in Datasets .

isSkipped Boolean No Indicates whether to skip the field when the data is uploaded.

Example:

"isSkipped": true
## Field Name Restrictions Field names in the .csv file and the metadata file: - Can contain only alphanumeric and underscore characters - Must begin with a letter - Can't end with an underscore - Can't contain 2 consecutive underscore characters, except when ending with “\_\_c” (case-sensitive) - Must be unique across all fields of the object **note:** We recommend that field names in dataset use no more than 40 characters. Long field names increase the likelihood of exceeding character limits when you augment dataset, because names are appended. ## Numeric Formats An example of a typical numeric value is $1,000,000.99, which is represented as $#,##0.00 in the `format` field. You’re required to specify the precision and scale of the number. The format is specified by using the following symbols: | Symbol | Meaning | | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | | 0 | One digit. Use to add leading or trailing 0s, like `#,###.00` for \$56,375.00. | | `#` | Adds zero or one digit | | . | Default symbol used as the decimal separator. Use the `decimalSeparator` field to set the decimal separator to a different symbol. | | - | Minus sign | | , | Grouping separator. Use the `groupSeparator` field to set the group separator to a different symbol. | | \$ | Currency sign. Use the `currencySymbol` field to set the currency indicator to a different symbol. | **note:** The format for numeric values when displayed in the UI defaults to No Format. Existing formatting is removed. For data ingestion, numeric values can’t contain any formatting (such as currency symbols or grouping separators). For example, \$1,000.00 isn’t a valid numeric value; the correct value is 1000.00. Valid characters when defining a numeric format are: - 0 - `#` - , - - - , - \$ ## Date Formats For Date fields, specify the format of the date by using one of the following supported formats. Dates must match the format exactly and can't have any extra text. For example, if the date format is "MM-dd-yyyy hh:mm:ss" and the value is "12-31-2015 12:00:00.0000", the upload fails because the value has extra milliseconds. **note:** The date formats listed here are the two-digit versions for date fields that use leading zeros; for example,`03/06/14 09:01:06 AM`. If a date field doesn't have leading zeros, use the one-digit version of the format. For example, use the format `M/d/yy h:m:s a` for date values such as **3/6/14 9:1:26 AM**. If you use a two-digit format for a field, rows containing values with one-digit date parts will fail. The timestamp part of each date format is optional. | Format | Sample Value | | ---------------------------- | ------------------------ | | yyyy-MM-dd'T'HH:mm:ss.SSS'Z' | 2014-04-29T16:53:34.000Z | | yy-MM-dd'T'HH:mm:ss.SSS'Z' | 14-04-29T16:53:34.000Z | | yyyy-MM-dd'T'HH:mm:ss'Z' | 2014-04-29T16:53:34Z | | yy-MM-dd'T'HH:mm:ss'Z' | 14-04-29T16:53:34Z | | yyyy-MM-dd HH:mm:ss | 2014-06-03 11:31:45 | | yy-MM-dd HH:mm:ss | 14-06-03 11:31:45 | | dd.MM.yyyy HH:mm:ss | 03.06.2014 11:31:45 | | dd.MM.yy HH:mm:ss | 03.06.14 11:31:45 | | dd/MM/yyyy HH:mm:ss | 03/06/2014 11:31:45 | | dd/MM/yy HH:mm:ss | 03/06/14 11:31:45 | | dd/MM/yyyy hh:mm:ss a | 03/06/2014 11:31:45 AM | | dd/MM/yy hh:mm:ss a | 03/06/14 11:31:45 AM | | dd-MM-yyyy HH:mm:ss | 03-06-2014 11:31:45 | | dd-MM-yy HH:mm:ss | 03-06-14 11:31:45 | | dd-MM-yyyy hh:mm:ss a | 03-06-2014 11:31:45 AM | | dd-MM-yy hh:mm:ss a | 03-06-14 11:31:45 AM | | MM/dd/yyyy hh:mm:ss a | 06/03/2014 11:31:45 AM | | MM/dd/yy hh:mm:ss a | 06/03/14 11:31:45 AM | | MM-dd-yyyy hh:mm:ss a | 06-03-2014 11:31:45 AM | | MM-dd-yy hh:mm:ss a | 06-03-14 11:31:45 AM | | HH:mm:ss dd/MM/yyyy | 11:31:45 03/06/2014 | | HH:mm:ss dd/MM/yy | 11:31:45 03/06/14 | These formats use the following symbols: | Symbol | Meaning | | ---------- | --------------------------------------------------- | | yyyy or yy | Four-digit year (yyyy) or two-digit year (yy) | | MM | Two-digit month (01–12) | | M | One-digit month when month less than 10 (1–12) | | dd | Two-digit day (01–31) | | d | One-digit day when day less than 10 (1–31) | | 'T' | A separator that indicates that time of day follows | | HH | Two-digit hour (00–23) | | H | One-digit hour when hour less than 10 (0–23) | | mm | Two-digit minute (00–59) | | m | One-digit minute when minute less than 10 (0–59) | | ss | Two-digit second (00–59) | | s | One-digit second when second less than 10 (0–59) | | SSS | Optional three-digit milliseconds (000–999) | | 'Z' | The reference UTC time zone | # External Data Metadata Overview To upload external data into a CRM Analytics dataset, make sure that you have prepared your data and metadata files. You can load external data into a dataset by preparing two files. - A data file, which contains the external data, in comma-separated value (CSV) format - An optional metadata file, which describes the structure of the data file in JSON format **note:** Providing a metadata file is recommended. Otherwise, every field is treated as text. The data and metadata files are used to populate a dataset with the external data. ## CSV Example The following CSV example contains data that conforms to the .json metadata file that’s described next. ```nolang Name,Amount,CloseDate opportunityA,100.99,6/30/2014 opportunityB,99.01,1/31/2012 ``` The first row in the CSV file lists the field names for your dataset. Each subsequent row corresponds to a record of data. A record consists of a series of fields delimited by commas. For information on creating valid field names, see [External Data Metadata Format Reference](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/reference/bi-ext-data-schema-reference.md). ## JSON Example The following JSON example represents a SalesData object with three fields: Name, Amount, and CloseDate. The example corresponds to the preceding CSV example. ```nolang { "fileFormat": { "charsetName": "UTF-8", "fieldsDelimitedBy": ",", "fieldsEnclosedBy": "\"", "fieldsEscapedBy":"" "linesTerminatedBy":"\r\n" "numberOfLinesToIgnore": 1 }, "objects": [ { "connector": "AcmeCSVConnector", "description": "", "fullyQualifiedName": "SalesData", "label": "Sales Data", "name": "SalesData", "fields": [ { "description": "", "fullyQualifiedName": "SalesData.Name", "label": "Account Name", "name": "Name", "isSystemField": false, "isUniqueId": false, "isMultiValue": false, "type": "Text" }, { "description": "", "fullyQualifiedName": "SalesData.Amount", "label": "Opportunity Amount", "name": "Amount", "isSystemField": false, "defaultValue": "0", "isUniqueId": false, "type": "Numeric", "precision": 10, "scale": 2, }, { "description": "", "fullyQualifiedName": "SalesData.CloseDate", "label": "Opportunity Close Date", "name": "CloseDate", "isSystemField": false, "isUniqueId": false, "type": "Date", "format": "MM/dd/yyyy", "fiscalMonthOffset": 0 } ] } ] } ``` ## CSV Format The External Data API uses a strict format for field values to optimize processing for large sets of data. Note the following when generating .csv files. - If a field value contains a control character or a new line the field value must be contained within double quotes (or your `fieldsEscapedBy` value). The default control characters (`fieldsDelimitedBy, fieldsEnclosedBy, fieldsEscapedBy`, or `linesTerminatedBy`) are comma and double quote. For example, `"Director of Operations, Western Region"`. - If a field value contains a double quote, escape the double quote by preceding it with another double quote (or your `fieldsEscapedBy` value): for example, `"This is the ""gold"" standard"`. - Field values aren’t trimmed. A space before or after a delimiting comma is included in the field value. A space before or after a double quote generates an error for the row. For example, `John,Smith` is valid. `John, Smith` is valid, but the second value is `" Smith"`. `"John", "Smith"` isn’t valid. - The maximum numeric value is 36,028,797,018,963,967 and the minimum is -36,028,797,018,963,968. - Dates must conform to specific formats, and they must match the formats exactly. For more information, see [External Data Metadata Format Reference](https://developer.salesforce.com/docs/analytics/bi-dev-guide-ext-data/reference/bi-ext-data-schema-reference.md). - At least one column in the CSV file must contain dimension values. - If column headers are specified, the number of column headers must equal the number of columns in each record. ## External Data Limits For more information on limits for all supported editions, see External Data Limits in [CRM Analytics Limits](https://help.salesforce.com/s/articleView?id=analytics.bi_limits.htm&type=5). # Feature Parameters for Analytics Templates Feature parameters are available to control behavior in the template-to-app process for CRM Analytics apps. Feature parameters are defined as metadata that is deployed as part of the managed package. When feature parameters are deployed with the template, the parameter values are set using the LMA application. For more information on feature parameters, see [Feature Parameter Metadata Types and Customs Objects](https://developer.salesforce.com/docs/atlas.en-us.pkg1_dev.meta/pkg1_dev/fma_types_objects.htm) in the First-Generation Managed Packaging Developer Guide. For implementation examples, view and clone the [Project Force App](https://github.com/forcedotcom/project-force) in Github. ## Analytics Template Metadata For Analytics templates, the managed package component is `WaveTemplateBundle`. The template metadata reads feature parameter values set in the LMA application as EL expressions and uses them to control the behavior of app creation. The supported types of feature parameter values are `Boolean`, `Date`, and `Integer`. ## Example Use an `Integer` Feature Parameter Value in Dashboard Creation For this example, the feature parameter is deployed using `/featureParameters/FinancingAmount.featureParameterInteger-meta.xml`. ```nolang LmoToSubscriber Amount Financed 250000 ``` The feature parameter metadata is referenced in the `template-to-app-rules.json` file: ```json { "constants": [ { "name": "FinancingAmount", "value": "${sfdc_fma:checkInteger('[namespace__FinancingAmount')}" } ], "rules": [ { "name": "Use Feature Parameter", "appliesTo": [ { "type": "dashboard" } ], "actions": [ { "action": "set", "path": "$.state..text_1.parameters.content.displayTemplate", "value": "${Constants.FinancingAmount}" } ] } ] } ``` # Features Not Supported in This Release The following Analytics features are not supported by the Analytics Templates framework. - Custom Maps and Charts - Einstein Discovery count analysis prediction type # FETCH Clause The `FETCH` clause specifies the number of rows to return. If no `FETCH` clause is specified, then SQL returns all rows. `FETCH` follows this syntax. `FETCH {FIRST||NEXT} {count} {ROW|ROWS} ONLY` - FIRST - : Returns the count of rows beginning from the first row in the dataset. - NEXT - : Returns the count of rows that immediately follow the current row. - count - : Optional. The number of rows to return. If you don't specify a count, `FETCH` returns one row by default. **note:** `FETCH FIRST ROW ONLY` is the same as `FETCH FIRST 1 ROW ONLY`. In this example, because there’s an offset of one row, `FETCH` starts from the second value of the `City` column, ordered ascending. The query returns the next three rows, which are the second, third, and fourth rows. ```nolang SELECT City FROM "Superstore" OFFSET 1 ORDER BY City FETCH NEXT 3 ROWS ONLY; ``` | City | | ------- | | Abilene | | Abilene | | Akron | Here, the query returns the first row. ```nolang SELECT City FROM "Superstore" ORDER BY City FETCH FIRST ROW ONLY; ``` | City | | -------- | | Aberdeen | # fill Use `fill()` to fill in any gaps in date fields. You most often use `fill()` before using the `timeseries` statement. By specifying the date fields to check, `fill()` creates a row that contains the missing month, day, week, quarter, or year and includes a null value. To include values outside the bounds of your data’s date range, specify a start date and end date to override existing limits. The function returns the missing date rows with null values. ## Syntax ```nolang results = fill resultSet by (dateCols=(dateField1, dateField2, ""), startDate=startDate, endDate=endDate, [partition]) ```
Name Description
resultSet Required. The results of a query that serve as input to the fill() function. This resultSet must have non-null input, or the timeseries() statement fails when run.
dateCols Required.

<span>date_fields</span> —The date fields in which to check for gaps.

The <span>date format</span> string accepts these values.

  • '<span>yearField</span>' , ‘ '<span>monthField</span>' , 'Y-M'

  • '<span>yearField</span>' , '<span>quarterField</span>' , 'Y-Q'

  • '<span>yearField</span>' , 'Y'

  • '<span>yearField</span>' , '<span>weekField</span>' , 'Y-W'

  • '<span>yearField</span>' , '<span>monthField</span>' , '<span>dayField</span>' , 'Y-M-D'

startDate —The starting date value beyond the scope of your data's date range.

endDate —The ending date value beyond the scope of your data's date range.

  • You can use startDate and endDate together or one and not the other.

  • If you leave out startDate , then the start date is the earliest date in your dataset.

  • If you leave out endDate , then the end date is the latest date in your dataset.

  • If startDate and endDate are within the bounds of your dataset, fill() ignores them.

partition Optional. A named parameter used to split query results into smaller parts. The fill() function resets when the named parameter value changes. After each group of rows is completed for a given partition, fill() runs on the next partition.
## Example This example uses `fill()` to add missing quarter and year values to tourist data. ```nolang q = load "TouristsData"; q = foreach q generate date_Year, date_Quarter, tourists; q = fill q by (dateCols=(date_Year, date_Quarter, "Y-Q")); q = limit q 15; ``` The query first returns the year, quarter, and number of tourists for each quarter. Based on the results from the first three years represented in the dataset, the only date data available is for the first quarter. These are the results from `q = load "TouristsData"; q = foreach q generate date_Year, date_Quarter, tourists;`. | year | quarter | tourists | | ---- | ------- | -------- | | 2001 | 1 | 4127 | | 2002 | 1 | 4173 | | 2003 | 1 | 4621 | `fill()` specifies in the `date_cols` array to group the input data by the quarter and year. To have a complete dataset of years and quarters, `fill()` adds the 2nd, 3rd, and 4th quarters for each year and a null value for the number of tourists. | year | quarter | tourists | | ---- | ------- | -------- | | 2001 | 1 | 4127 | | 2001 | 2 | - | | 2001 | 3 | - | | 2001 | 4 | - | | 2002 | 1 | 4173 | | 2002 | 2 | - | | 2002 | 3 | - | | 2002 | 4 | - | | 2003 | 1 | 4621 | | 2003 | 2 | - | | 2003 | 3 | - | | 2003 | 4 | - | ## Example with Extended Date Range This query returns null values for tourists where `date_Month` and `date_Year` come before or after the date values in the dataset or there are gaps within the data provided. ```nolang q = load "TouristsData"; q = foreach q generate date_Year, date_Month, tourists; q = fill q by (dateCols=(date_Year, date_Month, "Y-M"), startDate="2000-10", endDate="2001-07"); q = limit q 10; ``` | date_Month | date_Year | tourists | | ---------- | --------- | -------- | | 10 | 2000 | - | | 11 | 2000 | - | | 12 | 2000 | - | | 01 | 2001 | 41,735 | | 02 | 2001 | - | | 03 | 2001 | - | | 04 | 2001 | 26,665 | | 05 | 2001 | - | | 06 | 2001 | - | | 07 | 2001 | - | # FILL Use the `FILL()` table function to fill in any gaps in date fields. By specifying the date fields to check, `FILL()` creates rows that contain the missing month, day, week, quarter, or year and null data. Use it with `TIMESERIES()` to forecast future results when there are gaps in input data. `FILL()` takes the following syntax. ```nolang SELECT |* FROM FILL( INPUT=>(SELECT STATEMENT), DATE_COLS=>ARRAY[, 'DATE_COLUMN_TYPE'], [PARTITION=>'FIELD_NAME'] ) ``` | Name | Description | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `INPUT` | Required. A `SELECT` statement that includes date information and is the input to the `FILL()` function. | | `DATE_COLS` | Required.`{DATE_FIELDS}`—The array of date fields in which to check for gaps.The `{DATE_COLUMN_TYPE}` string accepts these values.
  • `'{YEAR_FIELD}'`, `'{MONTH_FIELD}'`, `'Y-M'`
  • `'{YEAR_FIELD}'`, `'{QUARTER_FIELD}'`, `'Y-Q'`
  • `'{YEAR_FIELD}'`, `'Y'`
  • `'{YEAR_FIELD}'`, `'{WEEK_FIELD}'`, `'Y-W'`
  • `'{YEAR_FIELD}'`, `'{MONTH_FIELD}'`, `'{DAY_FIELD}'`, `'Y-M-D'`
| | `PARTITION` | Optional. A field used to split query results into smaller partitions. The `FILL()` function resets when the field value changes. After each group of rows is completed for a given partition, `FILL()` runs on the next partition. | ## Example This example uses `FILL()` to add missing quarter and year values to tourist data. ```nolang SELECT "year", "quarter", tourists FROM FILL( INPUT=>(SELECT EXTRACT(YEAR FROM "date") as "year", EXTRACT(QUARTER FROM "date") as "quarter", tourists FROM "TouristsData"), DATE_COLS=>ARRAY['year', 'quarter', 'Y-Q']); ``` The input `SELECT` statement returns the year, quarter, and number of tourists for each quarter. Based on the results from the first three years represented in the dataset, the only date data available is for the first quarter. **tip:** Another way to project all columns from the `INPUT` query is by using `SELECT * FROM FILL(...)`. These are the results from executing only the `INPUT` `SELECT` query. | year | quarter | tourists | | ---- | ------- | -------- | | 2001 | 1 | 4127 | | 2002 | 1 | 4173 | | 2003 | 1 | 4621 | `FILL()` specifies in the `DATE_COLS` array to check for gaps in year and quarter fields in the input data. To have a complete dataset of years and quarters, `FILL()` adds the 2nd, 3rd, and 4th quarters for each year and a null value for the number of tourists. | year | quarter | tourists | | ---- | ------- | -------- | | 2001 | 1 | 4127 | | 2001 | 2 | - | | 2001 | 3 | - | | 2001 | 4 | - | | 2002 | 1 | 4173 | | 2002 | 2 | - | | 2002 | 3 | - | | 2002 | 4 | - | | 2003 | 1 | 4621 | | 2003 | 2 | - | | 2003 | 3 | - | | 2003 | 4 | - | # filter Selects rows from a dataset based on a filter predicate. ## Syntax ```nolang result = filter rows by predicate; ``` ## Usage A predicate is a Boolean expression that uses comparison or logical operators. The predicate is evaluated for every row. If the predicate is `true`, the row is included in the result. Comparisons on dimensions are lexicographic, and comparisons on measures are numerical. When a filter is applied to grouped data, the filter is applied to the rows in the group. If all member rows are filtered out, groups are eliminated. You can run a `filter` statement before or after `group` to filter out members of the groups. **note:** With results binding, an error may occur if the results from a previous query exceed the values supported by SAQL. For example, if something like `filter q by dim1 in {{results(Query_1)}};` produces a filter tree with a depth greater than 10,000 values, SAQL will fail with an error. ## Example The following example returns only rows where the origin is ORD, LAX, or LGA: ```nolang a1 = filter a by origin in ["ORD", "LAX", "LGA"]; ``` ## Example The following example returns only rows where the destination is LAX or the number of miles is greater than 1,500: ```nolang y = filter x by dest == "LAX" || miles > 1500; ``` ## Example When `in` operates on an empty array in a `filter` operation, everything is filtered and the results are empty. The second statement filters everything and returns empty results: ```nolang a = load "0Fbxx000000002qCAA/0Fcxx000000002WCAQ"; a = filter a by Year in []; c = group a by ('Year', 'Name'); d = foreach c generate 'Name' as 'group::AName', 'Year' as 'group::Year', sum(accounts::Revenue) as 'sRev'; ``` **See Also** - [Comparison Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-comparison.md) - [Logical Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-logical.md) - [Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statements.md) - [Null Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-null.md) - [Use Group and Filter Pre-projection](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-group-filter.md) # Filter by a Custom Fiscal Year Here’s how to filter by a custom fiscal year date. ## Example ```nolang q = load "opportunities"; q = filter q by date('CreatedDate_Year', 'CreatedDate_Month', 'CreatedDate_Day') in ["current fiscal_year".."current_fiscal_year"]; q = group q by 'CreatedDate_Year_Fiscal'; q = foreach q generate 'CreatedDate_Year_Fiscal' as 'Fiscal Year', count() as 'count'; q = order q by 'CreatedDate_Year_Fiscal' asc; q = limit q 2000; ``` Here’s the query output. | Fiscal Year | Count | | ----------- | ----- | | 2020 | 1 | # Filter By Date You can filter results by `DateTime` and `DateOnly` fields. Filters can include exact dates, specific date ranges, or relative date ranges. | Type of Filter | Example | | ------------------- | ---------------------------------------------------- | | exact date range | `q = filter q by year('CloseDate')=='2018';` | | specific date range | `q = filter q by year('CloseDate') in [2017..2018];` | | relative date range | See the examples below. | Examples of relative date range filters: ```nolang q = filter q by CloseDate in ["last 2 years"]; q = filter CloseDate in ["current fiscal_year".."current day"]; q = filter CloseDate in ["2 fiscal_years ago".."current day"]; ``` **note:** Filter with binary comparison operators `==`, `!=`, `<`, `>`, `<=`, and `>=` only after your query’s `foreach` statement, post-projection. For example, include the filter `q = filter q by CloseDate >= "2014-01-01"` post-projection. If you include it pre-projection, the query throws an error. The inability to include filters that use these comparison operators pre-projection is a limitation of the beta release. You can filter pre- and post-projection with the `IN` comparison operator. The `like` and `matches` operators are not supported for time zone-enabled `DateTime` and `DateOnly` fields. You can use these relative date keywords: - `current day` - `n day(s) ago` - `n day(s) ahead` - `current week` - `n week(s) ago` - `n week(s) ahead` - `current month` - `n month(s) ago` - `n month(s) ahead` - `current quarter` - `n quarter(s) ago` - `n quarter(s) ahead` - `current fiscal_quarter` - `n fiscal_quarter(s) ago` - `n fiscal_quarter(s) ahead` - `current year` - `n year(s) ago` - `n year(s) ahead` - `current fiscal_year` - `n fiscal_year(s) ago` - `n fiscal_year(s) ago` **See Also** - [filter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-filter.md) - [Comparison Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-comparison.md) # Filter By Date Parts or Date Field To filter by a date part, use the `WHERE` clause with the `EXTRACT()` function, and pass it the desired date parts (year, month, or day). To filter by a date field, use the `WHERE` clause with a logical operator. This example filters by year. ```nolang SELECT CloseDate FROM "OpportunityFiscalEMTimezoned" WHERE EXTRACT(YEAR FROM CloseDate) = 2014; ``` | CloseDate | | ------------------- | | 2014-12-31 15:00:00 | | 2014-12-30 16:00:00 | This example returns CloseDate fields that occur on or before the given timestamp. ```nolang SELECT CloseDate FROM "OpportunityFiscalEMTimezoned" WHERE CloseDate <= TIMESTAMP '2014-12-31 15:00:00'; ``` | CloseDate | | ------------------- | | 2014-12-30 16:00:00 | # Filter Dashboard Results You can filter dashboard results, status, or refresh requests, by using filter parameters. Dashboard results are always unfiltered, unless you have specified filter parameters in your request. When requesting a dashboard result, status, or refresh, you can specify up to three optional filter parameters: filter1, filter2 and filter3. These parameters allow you to apply filter options, which can be selected from the filters that are currently defined for the dashboard. Filters can be applied to the following requests: - A GET request on the [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) resource: returns data filtered by the specified parameters. - A PUT request on the [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) resource: refreshes the data that has been filtered by the specified parameters. - A GET request on the [Dashboard Status](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-status-resource.md) resource: returns status for the data that has been filtered by the specified parameters. ## Example Usage A dashboard with one filter ("Country") and two options ("United States" and "Canada") appears like this in the dashboard metadata: ```nolang { "dashboardMetadata" : { ... "filters" : [ { "name" : "Country", "options" : [ { "id" : "0ICxx0000000001GAA", "alias" : "United States", "operation" : "equals", "value" : "US", "startValue" : null, "endValue" : null } ], [ { "id" : "0ICxx0000000002GAA", "alias" : "Canada", "operation" : "equals", "value" : "CA", "startValue" : null, "endValue" : null } ], ... } ``` To retrieve dashboard results with a filter of "Country equals Canada" you could make the following GET request: ```nolang /services/data/v31.0/analytics/dashboards/01Zxx0000000000000?filter1=0ICxx0000000002GAA ``` **See Also** - [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) - [Dashboard Status](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-status-resource.md) # Filter Operator List Return a list of filter operators. ## Syntax **URI:** `/services/data/vXX.X/analytics/filteroperators` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Returns a list of filter operators.| **Parameters** |Parameter|Description| |---------|-----------| |`forDashboards`|Optional. When `forDashboards` equals `true`, returns filter operators for dashboard filters. Otherwise, the GET response always returns filter operators for report filters.| ## GET Response Body Returns an array of field data types. Each object contains the following fields: |Property|Type|Description| |--------|----|-----------| |`label`|String|The end user-facing name of the operator.| |`name`|String|The API name of the operator.| ## Example GET Reponse Body ```nolang { "date" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "string" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "double" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "picklist" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "textarea" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "percent" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "url" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "int" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "reference" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" } ], "datetime" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "boolean" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" } ], "phone" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "currency" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" } ], "id" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "starts with", "name" : "startsWith" } ], "email" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "less than", "name" : "lessThan" }, { "label" : "greater than", "name" : "greaterThan" }, { "label" : "less or equal", "name" : "lessOrEqual" }, { "label" : "greater or equal", "name" : "greaterOrEqual" }, { "label" : "contains", "name" : "contains" }, { "label" : "does not contain", "name" : "notContain" }, { "label" : "starts with", "name" : "startsWith" } ], "multipicklist" : [ { "label" : "equals", "name" : "equals" }, { "label" : "not equal to", "name" : "notEqual" }, { "label" : "includes", "name" : "includes" }, { "label" : "excludes", "name" : "excludes" } ] } ``` # Filter Operators Use the Filter Operators API to get information about which filter operators are available for reports and dashboards. The Filter Operators API is available in API version 40.0 and later. Resources for the Filter Operators API are available at `/services/data//analytics/filteroperators`. You can query each resource with an `HTTP` method.
Resource Supported HTTP Method Description

/services/data/<span><latest API version></span>/analytics/filteroperators

and

/services/data/<span><latest API version></span>/analytics/filteroperators?forDashboards=true

GET Returns a list of filter operators available for report filters. When forDashboards is true , returns a list of filter operators available for dashboard filters.
- **[Filter Operator List](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-filteroperators-reference-list.md)** Return a list of filter operators. # Filter Reports on Demand To get specific results on the fly, filter reports through the API. Filter changes made through the API does not affect the source report definition. Using the API, you can filter with up to 20 custom field filters and add filter logic (such as AND, OR). But standard filters (such as range), filtering by row limit, and cross filters are unavailable. Before you filter a report, it’s helpful to check these properties in the metadata that tell you if a field can be filtered, the values and criteria you can filter by, and filters that already exist in the report. - filterable - filterValues - dataTypeFilterOperatorMap - reportFilters You can filter reports during synchronous or asynchronous report runs by making a POST request to the Execute Sync or Execute Async resource. ## Example In a POST request, an accounts report is filtered synchronously by these passing filters with filter logic in the metadata to the Execute Sync resource. 1. Account Name not equal to Data Mart 2. Account Owner not equal to Admin User 3. Annual Revenue greater than "100,000" 4. Industry not equal to Manufacturing,Recreation Filter logic: (1 OR 4) AND 2 AND 3. ```nolang { "reportMetadata": { "name": "FilterAcctsReport", "id": "00OD0000001cw27MAA", "reportFormat": "SUMMARY", "reportBooleanFilter": "(1OR4)AND2AND3", "reportFilters": [ { "value": "DataMart", "operator": "notEqual", "column": "ACCOUNT.NAME" }, { "value": "AdminUser", "operator": "notEqual", "column": "USERS.NAME" }, { "value": "\"100,000\"", "operator": "greaterThan", "column": "SALES" }, { "value": "Manufacturing,Recreation", "operator": "notEqual", "column": "INDUSTRY" } ], "detailColumns": [ "RATING", "LAST_UPDATE", "SALES" ], "developerName": "Filter_Accts_Report", "reportType": { "type": "AccountList", "label": "Accounts" }, "currency": null, "aggregates": [ "s!SALES", "RowCount" ], "groupingsDown": [ { "name": "USERS.NAME", "sortAggregate": "s!SALES", "sortOrder": "Desc", "dateGranularity": "None" }, { "name": "ACCOUNT.NAME", "sortAggregate": null, "sortOrder": "Asc", "dateGranularity": "None" }, { "name": "DUE_DATE", "sortAggregate": null, "sortOrder": "Asc", "dateGranularity": "Month" } ], "groupingsAcross": [] } } ``` In response to the POST request, the report returns data that meets the given criteria. ```nolang { "hasDetailRows": false, "attributes": { "describeUrl": "/services/data/v29.0/analytics/reports/00OD0000001cw27MAA/describe", "instancesUrl": "/services/data/v29.0/analytics/reports/00OD0000001cw27MAA/instances", "type": "Report", "reportName": "Filter Accts Report", "reportId": "00OD0000001cw27MAA" }, "factMap": { "1_0!T": { "aggregates": [ { "value": 56000000, "label": "$56,000,000" }, { "value": 1, "label": "1" } ] }, "7_1!T": { "aggregates": [ { "value": 24000000, "label": "$24,000,000" }, { "value": 1, "label": "1" } ] }, ... "allData": true, "reportMetadata": { "name": "Filter Accts Report", "id": "00OD0000001cw27MAA", "reportFormat": "SUMMARY", "reportBooleanFilter": "(1 OR 4) AND 2 AND 3", "reportFilters": [ { "value": "Data Mart", "operator": "notEqual", "column": "ACCOUNT.NAME" }, { "value": "Admin User", "operator": "notEqual", "column": "USERS.NAME" }, { "value": "\"100,000\"", "operator": "greaterThan", "column": "SALES" }, { "value": "Manufacturing,Recreation", "operator": "notEqual", "column": "INDUSTRY" } ], "detailColumns": [ "RATING", "LAST_UPDATE", "SALES" ], ... } } ``` **See Also** - [Execute Sync](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-getreportrundata.md) # filters JSON The `filters` section defines the global filters added to a global filter panel widget, which is available in the dashboard designer. ## Global Filters Example ```nolang "filters": [ { "label": "Account.Type", "fields": [ "Account.Type" ], "operator": "in", "locked": false, "dataset": { "name": "opportunity" }, "value": [ "Customer" ] }, { "label": "ForecastCategory", "fields": [ "ForecastCategory" ], "operator": "in", "locked": true, "dataset": { "name": "opportunity" }, "value": [ "BestCase" ] } ], ``` - **[filters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-filters-parameters.md)** The `filters` key defines all global filters included in the dashboard. It contains a separate node, with configurable properties, for each global filter. Global filters apply to all layouts, but you can specify whether each widget applies the global filters. # filters Properties The `filters` key defines all global filters included in the dashboard. It contains a separate node, with configurable properties, for each global filter. Global filters apply to all layouts, but you can specify whether each widget applies the global filters. | Property Name | Description | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `label` | Field label displayed in the global filter | | `fields` | API name of the field by which to filter the records; a global filter can’t be based on multiple fields | | `operator` | Filter operator; supported operators are `in` (equals), `not in` (doesn’t equal), and `matches` (contains) | | `locked` | Prevents dashboard viewers from being able to change the global filter and for an incoming filter passed from a linked dashboard to overwrite the global filter | | `dataset` | Contains the `name` field, which specifies the API name of the dataset that contains the filter field. | | `value` | Array of field values used to filter the records | Example `dataset`: ```nolang "dataset": { "name": "opportunity" }, ``` To view an example of the `filters` key configured with the properties in the table, see [filters JSON](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-filters.md). Each hash contains the configured properties for a single filter. # filters Properties Use the `filters` property to add a filter to a step query. Although you can create filters for query steps in the user interface, you have to manually define filters for static steps in the dashboard JSON. The syntax for a filter in the step definition varies based on whether the step is in compact or SAQL form. This section describes the filter syntax for compact-form steps, including a description and example of every operator. For information about the filters for SAQL-form steps, see the [Analytics SAQL Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_saql.meta/bi_dev_guide_saql/bi_saql_intro.htm). ## Filter Syntax for Compact Form 2.0 Filters defined in compact-form steps have the following syntax. ```nolang "filters": [[ "field", [value], "operator" ]] ``` ## Example Filter For example, the following filter shows only records where `Sales` is between `1` and `100,000` and `Customer_Segment` is either `Consumer` or `Corporate`. ```nolang "filters": [ [ "Sales", [ 1, 100000 ], ">=<=" ], [ "Customer_Segment", [ "Consumer" "Corporate" ], "in" ] ]] ``` ## Dimension Filter Examples ```nolang "filters": [Region", ["East", "West"], "in"] "filters": [Region", ["st"], "matches"] "filters": [Region", [], "isnull"] "filters": [["year", "OrderDate"], [2020, 2022], "in"] ``` ## Measure Filter Examples ```nolang "filters": ["Profit", [], "isnull"] "filters": ["Profit", [1], ">="] "filters": ["Profit", [1, 100], ">=<="] ``` ## Absolute Date Filter Examples ```nolang "filters": ["OrderDate", ["2019-10-12", "2019-10-22"], "between" "filters": ["OrderDate", ["2019-10-12", null], "between"] "filters": ["OrderDate", [null, "2019-10-22"], "between"] ``` ## Relative Date Filter Examples ```nolang "filters": ["OrderDate", [[fiscal_year", -1], ["day", 0]], "between"]]"between"] ``` ## Compound Filter and Compound Date Filter in a Time-zone Enabled Org Example ```nolang "filters": [ [ [ "Type", "LeadSource" ], [ "Existing Business", "Advertisement" ], "in" ] [ [ ["year", "CloseDate"], ["quarter", "CloseDate"] ], [ [2020, 2], [2021, 3] ], "in" ] ] ``` ## Filter Syntax for Compact Form 1.0 Filters defined in compact-form steps have the following syntax. ```nolang "filters": [[ "field", [value], "operator" ]] ``` For example, the following filter shows only records with a “Customer” account type. ```nolang "filters": [[ "Account_Type", ["Customer"], "in" ]] ``` To compare against multiple values, include the values in an array, like this. ```nolang "filters": [[ "field", [[value1, value2, value3]], "operator" ]] ``` To specify an absolute date value for a date filter, specify the value in epoch format, where the value is the number of milliseconds since January 1, 1970 midnight UTC (1970-01-01 00:00:00). The following example shows dataset rows with a close date on or before January 1, 2016. ```nolang "filters": [[ "Close Date", [[ 1451606400000, null ]], ">=" ]] ``` ## Operators You can use different operators in a filter. The supported operators depend on the field type. If you don’t specify the operator, Analytics applies the `==` operator. | Operator | Description | Compact-Form 2.0 Example | Compact-Form 1.0 Example |   | | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | | `in` | Value of dataset field equals one of the specified values. Applies to dimensions only. | `["Dimension",["Value1","Value2"],"in"]` | `["Dimension",["Value1","Value2"],"in"]` |   | | `not in` | Value of dataset field is not in the specified list of values. Applies to dimensions only. | `["Dimension",["Value1","Value2"],"not in"]` | `["Dimension",["Value1","Value2"],"not in"]` |   | | `matches` | Value of dataset field contains the specified value. This operator is not case-sensitive. Applies to dimensions only. | `["Dimension",["Val"],"matches"]` | `["Dimension",["Val"],"matches"]` |   | | `is null` | Value of dataset field is null. Applies to measures, dimensions and absolute dates in Compact form 2.0 and to measures only in Compact form 1.0. | `["Measure",[],"isnull"]` | `["Measure",[[]],"isnull"]` |   | | `is not null` | Value of dataset field is not null. Applies to measures, dimensions and absolute dates in Compact form 2.0 and to measures only in Compact form 1.0. | `["Measure",[],"isnotnull"]` | `["Measure",[[]],"isnotnull"]` |   | | `==` | Value of dataset field equals the specified value. Applies to measures only. | `["Measure",[1],"=="]` | `["Measure",[[1]],"=="]` |   | | `!=` | Value of dataset field does not equal the specified value. Applies to measures only. | `["Measure",[1],"!="]` | `["Measure",[[1]],"!="]` |   | | `<` | Value of dataset field is less than the specified value. Applies to measures only. | `["Measure",[10],"<"]` | `["Measure",[[10]],"<"]` |   | | `>` | Value of dataset field is greater than the specified value. Applies to measures only. | `["Measure",[1],">"]` | `["Measure",[[1]],">"]` |   | | `<=` | Value of dataset field is less than or equal to the specified value. Applies to measures only in Compact form 2.0 and to measures and absolute dates only in Compact form 1.0. | `["Measure",[10],"<="]` |
  • `["Measure",[[10]],"<="]`
  • `["Date",[[1229040000000]],"<="]`
|   | | `>=` | Value of dataset field is greater than or equal to the specified value. Applies to measures only in Compact form 2.0 and to measures and absolute dates only in Compact form 1.0. | `["Measure",[1],">="]` |
  • `["Measure",[[1]],">="]`
  • `["Date",[[-374457600000]],">="]`
|   | | `>=<=` or `between` with measures and dates in Compact form 1.0 | Value of dataset field is between the specified values, inclusive. For relative dates, you can specify the following time periods: "year", "quarter", "month", "week", and "day". Applies to measures only in Compact form 2.0 and measures and dates only in Compact form 1.0. You can also use these operators with measures in Compact form 2.0 and measures and dates in Compact form 1.0:
  • >=\< (Greater than or equal to one value, but less than another)
  • >\<= (Greater than one value, but less than or equal to another)
  • >\< (Between two values, exclusive)
| `["Measure",[1,10],">=<="]` |
  • `["Measure",[[1,10]],">=<="]`
  • `["Date",[[-374457600000,1229040000000]],">=<="]`
  • `["Date",[[["month",-1],["month",1]]],">=<="]`
  • `["Close Date", [[null,1451606400000]],"<="]]`
|   | | `between` with dates in Compact form 2.0 | Value of dataset field is between the specified values, inclusive. For relative dates, you can specify the following time periods: "year", "quarter", "month", "week", and "day". |
  • `["Date",[null, 1388448000000], "between"]`
  • `["Date",[1388448000000, null], "between"]`
  • `["Date",[["year", -1], ["year", 1]], "between"]`
|   |   | To view a complete example with a binding syntax, see the [Bind the Initial Filter Selection](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-initial-selections.html) documentation. # First and Last Day in the Week, Month, Quarter or Year Functions Use the following functions to find the first and last week, month, quarter, or year for both standard and fiscal calendars. These functions accept `DateTime`, `DateOnly`, and legacy input values. They return the same type as the input value. Date position functions take this syntax. ```nolang SELECT FUNCTIONNAME(DATE) AS DATEALIAS FROM DATASET; ``` - **[week_first_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-week-first-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day (Sunday) of the week that contains the specified date. - **[fiscal_week_first_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-fiscal-week-first-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day (Monday) of the fiscal week that contains the specified date. - **[month_first_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-month-first-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy object as input. Returns an object of the same type that corresponds to the first day of the month that contains the specified date. - **[fiscal_month_first_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-fiscal-month-first-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the fiscal month that contains the specified date. - **[quarter_first_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-quarter-first-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the quarter that contains the specified date. - **[fiscal_quarter_first_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-fiscal-quarter-first-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the fiscal quarter that contains the specified date. By default, the first fiscal quarter is defined as February, March, April. The second quarter is May, June, July. The third is August, September, October. The fourth is November, December, January. - **[year_first_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-year-first-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the year that contains the specified date. - **[fiscal_year_first_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-fiscal-year-first-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the fiscal year that contains the specified date. By default, the fiscal year begins on February 1. - **[week_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-week-last-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day (Saturday) of the week that contains the specified date. - **[fiscal_week_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-fiscal-week-last-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day (Sunday) of the fiscal week that contains the specified date. - **[month_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-month-last-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the month that contains the specified date. - **[fiscal_month_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-fiscal-month-last-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the month that contains the specified date. - **[quarter_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-quarter-last-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the quarter that contains the specified date. - **[fiscal_quarter_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-fiscal-quarter-last-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the fiscal quarter that contains the specified date. - **[year_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-year-last-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the year that contains the specified date. - **[fiscal_year_last_day(date)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-fiscal-year-last-day.md)** Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the fiscal year that contains the specified date. # First Day in the Week, Month, Quarter, or Year Returns the date of the first day in the specified week, month, quarter, or year. ## Usage Use these functions in a `foreach()` statement. You cannot use them in `group by`, `order by`, or `filter` statements. Use the functions whose names begin with `week`, `month`, `quarter`, and `year` with standard calendar year dates. Use the functions whose names begin with `fiscal` with fiscal year dates. **note:** You can't use fiscal date functions in recipes and dataflow transformations. ## week_first_day(date) Returns the date of the first day of the week for the specified date. ```nolang q = foreach q generate week_first_day(toDate('CloseDate_sec_epoch')) as 'Week First Day'; ``` **note:** This function always counts the `firstDayOfWeek` as 0 (Sunday). It overrides the `firstDayOfWeek` parameter for `sfdcDigestTransformation` and CSV uploads. ## fiscal_week_first_day(date) Returns the fiscal date of the first day of the week for the specified date. ```nolang q = foreach q generate fiscal_week_first_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Week First Day'; ``` **note:** This function respects the `firstDayOfWeek` parameter for `sfdcDigestTransformation` and CSV uploads. The default value is 0 (Sunday). ## month_first_day(date) Returns the date of the first day of the month for the specified date. ```nolang q = foreach q generate month_first_day(toDate('CloseDate_sec_epoch')) as 'Month First Day'; ``` ## fiscal_month_first_day(date) Returns the fiscal date of the first day of the month for the specified date. ```nolang q = foreach q generate fiscal_month_first_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Month First Day'; ``` ## quarter_first_day(date) Returns the date of the first day of the quarter for the specified date. ```nolang q = foreach q generate quarter_first_day(toDate('CloseDate_sec_epoch')) as 'Quarter First Day'; ``` ## fiscal_quarter_first_day(date) Returns the fiscal date of the first day of the quarter for the specified date. ```nolang q = foreach q generate fiscal_quarter_first_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Quarter First Day'; ``` ## year_first_day(date) Returns the date of the first day of the year for the specified date. ```nolang q = foreach q generate year_first_day(toDate('CloseDate_sec_epoch')) as 'Year First day'; ``` **note:** This function always returns 1st January. ## fiscal_year_first_day(date) Returns the fiscal date of the first day of the year for the specified date. ```nolang q = foreach q generate fiscal_year_first_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Year First Day'; ``` **See Also** - [Date Formats and Fiscal Dates for Source Data](https://help.salesforce.com/s/articleView?id=bi_integrate_date_formats_and_fiscal_dates.htm) # first() Returns the first value for the specified field. Use `first()` to return the first value of a measure or dimension. You can also use `first()` used to return the value of a field without grouping by that field. **note:** If the values are not sorted, the 'first' value could be any value in the tuple. ## Example - Return the First Industry for an Account Owner Your reps own opportunities in several industries. You need a list of rep names with their first industry, where industry is sorted alphabetically. Group by account owner and industry, sort by industry, then use `first()` to get the first industry. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by ('Account_Owner', 'Industry'); q = foreach q generate 'Account_Owner' as 'Account_Owner', 'Industry' as 'Industry'; q = order q by 'Industry'; q = foreach q generate 'Account_Owner' as 'Account_Owner', first('Industry') as 'One Industry'; ``` ![Diagram showing first function with sorted field.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_1_sort.png) ## Example - Return Any Industry for an Account Owner Your reps own opportunities in several industries. You need a list of rep names with any one of a rep's industry - it doesn't matter which one. In this case. Group by account owner then use `first()` to get the first industry from an unsorted collection. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by 'Account_Owner'; q = foreach q generate 'Account_Owner' as 'Account_Owner', first('Industry') as 'One Industry'; ``` The resulting table displays each rep along with one of their industries (basically the first industry from an unsorted collection). ![Diagram showing first function.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_1st.png) **See Also** - [last()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-last.md) # fiscal_month_first_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the fiscal month that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", fiscal_month_first_day(OrderDate) as "fiscal_month_first_day" FROM "dates_sample_data"; ``` | date | fiscal_month_first_day | | ------------------- | ---------------------- | | 2015-01-21 15:30:00 | 2015-01-01 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-01 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-01 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-01 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-01 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-01 00:00:00 | | 2015-12-03 00:00:00 | 2015-12-01 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-01 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-01 00:00:00 | # fiscal_month_last_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the month that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", fiscal_month_last_day(OrderDate) as "fiscal_month_last_day" FROM "dates_sample_data"; ``` | date | fiscal_month_last_day | | ------------------- | --------------------- | | 2015-01-21 15:30:00 | 2015-01-31 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-31 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-31 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-28 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-31 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-31 00:00:00 | | 2015-12-03 00:00:00 | 2015-12-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-31 00:00:00 | # fiscal_quarter_first_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the fiscal quarter that contains the specified date. By default, the first fiscal quarter is defined as February, March, April. The second quarter is May, June, July. The third is August, September, October. The fourth is November, December, January. ## Example ```nolang SELECT OrderDate as "date", fiscal_quarter_first_day(OrderDate) as "fiscal_quarter_first_day" FROM "dates_sample_data"; ``` | date | fiscal_quarter_first_day | | ------------------- | ------------------------ | | 2015-01-21 15:30:00 | 2014-11-01 00:00:00 | | 2015-01-21 00:00:00 | 2014-11-01 00:00:00 | | 2015-01-31 10:00:30 | 2014-11-01 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-01 00:00:00 | | 2016-01-21 23:59:59 | 2015-11-01 00:00:00 | | 2015-10-31 23:59:59 | 2015-08-01 00:00:00 | | 2015-12-03 00:00:00 | 2015-11-01 00:00:00 | | 2016-01-11 03:30:00 | 2015-11-01 00:00:00 | | 2016-01-11 03:30:00 | 2015-11-01 00:00:00 | # fiscal_quarter_last_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the fiscal quarter that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", fiscal_quarter_last_day(OrderDate) as "fiscal_quarter_last_day" FROM "dates_sample_data"; ``` | date | fiscal_quarter_last_day | | ------------------- | ----------------------- | | 2015-01-21 15:30:00 | 2015-01-31 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-31 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-31 00:00:00 | | 2015-02-03 15:30:00 | 2015-04-30 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-31 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-31 00:00:00 | | 2015-12-03 00:00:00 | 2015-01-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-31 00:00:00 | # fiscal_week_first_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day (Monday) of the fiscal week that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", fiscal_week_first_day(OrderDate) as "fiscal_week_first_day" FROM "dates_sample_data"; ``` | date | fiscal_week_first_day | | ------------------- | --------------------- | | 2015-01-21 15:30:00 | 2015-01-19 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-19 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-26 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-02 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-18 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-26 00:00:00 | | 2015-12-03 00:00:00 | 2015-11-30 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-11 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-11 00:00:00 | # fiscal_week_last_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day (Sunday) of the fiscal week that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", fiscal_week_last_day(OrderDate) as "fiscal_week_last_day" FROM "dates_sample_data"; ``` | date | fiscal_week_last_day | | ------------------- | -------------------- | | 2015-01-21 15:30:00 | 2015-01-25 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-25 00:00:00 | | 2015-01-31 10:00:30 | 2015-02-01 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-08 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-24 00:00:00 | | 2015-10-31 23:59:59 | 2015-11-01 00:00:00 | | 2015-12-03 00:00:00 | 2015-12-06 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-17 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-17 00:00:00 | # fiscal_year_first_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the fiscal year that contains the specified date. By default, the fiscal year begins on February 1. ## Example ```nolang SELECT OrderDate as "date", fiscal_year_first_day(OrderDate) as "fiscal_year_first_day" FROM "dates_sample_data"; ``` | date | year_first_day | | ------------------- | ------------------- | | 2015-01-21 15:30:00 | 2014-02-01 00:00:00 | | 2015-01-21 00:00:00 | 2014-02-01 00:00:00 | | 2015-01-31 10:00:30 | 2014-02-01 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-01 00:00:00 | | 2016-01-21 23:59:59 | 2015-02-01 00:00:00 | | 2015-10-31 23:59:59 | 2015-02-01 00:00:00 | | 2015-12-03 00:00:00 | 2015-02-01 00:00:00 | | 2016-01-11 03:30:00 | 2015-02-01 00:00:00 | | 2016-01-11 03:30:00 | 2015-02-01 00:00:00 | # fiscal_year_last_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the fiscal year that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", fiscal_year_last_day(OrderDate) as "fiscal_year_last_day" FROM "dates_sample_data"; ``` | date | fiscal_year_last_day | | ------------------- | -------------------- | | 2015-01-21 15:30:00 | 2015-01-31 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-31 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-31 00:00:00 | | 2015-02-03 15:30:00 | 2016-01-31 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-31 00:00:00 | | 2015-10-31 23:59:59 | 2016-01-31 00:00:00 | | 2015-12-03 00:00:00 | 2016-01-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-31 00:00:00 | # floor({n}) Returns the nearest integer of equal or lesser value to n. n can be any real numeric value in the range of -1.797e308\<= n \<= 1.797e308. `floor({n})` takes the following syntax. ```nolang SELECT floor(COLUMN_NAME) as ALIASNAME FROM DATASET; ``` ## Example This example returns values in the Discount field rounded down to the nearest integer. In the first three rows, the Discount value is 0. The fourth and fifth values are 0.45 and 0.2, respectively, which are rounded to 0. ```nolang SELECT floor(Discount) as floorDiscount FROM Superstore LIMIT 5; ``` | floorDiscount | | ------------- | | 0 | | 0 | | 0 | | 0 | | 0 | # floor(n) Returns the nearest integer of equal or lesser value to _n_. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate floor(miles) as distance; ``` # Folder Child Operations Gets information about the child folders of the specified folder. The following user permissions are needed to access this resource. GET: - View access to the root folder in the tree ## Syntax **URI:** `/services/data/v43.0/folders//children` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Gets information about the child folders of the specified folder.| **Parameters** |Parameter|Type|Available Version|Description| |---------|----|-----------------|-----------| |`folderId`|String|42.0|Return data for this unique folder ID.| |`page`|Integer|43.0|Integer that indicates which page of results to return. Default is 1.| |`pageSize`|Integer|43.0|Integer that indicates how many results each page returns. Default is 10.| ## GET Gets information about the child folders of the specified folder. `/services/data/v43.0/folders//children` **Output Payload** FolderCollectionRepresentation **Sample Output Response** ```nolang { "folders" : [ { "childrenUrl" : "/services/data/v43.0/folders/00lR0000000Mf56IAC/children", "id" : "00lR0000000Mf56IAC", "label" : "BW33", "name" : "BW33", "parentId" : "00lR0000000E84WIAS", "type" : "report", "url" : "/services/data/v43.0/folders/00lR0000000Mf56IAC" } ], "totalSize" : 1, "url" : "/services/data/v43.0/folders/00lR0000000E84WIAS/children?page=1&pageSize=10" } ``` # Folder Collections Enables creation of report and dashboard folders and obtaining the list of folders. The following user permissions are needed to access this resource. POST: - Create Dashboard Folders (for dashboard folders) - Create Report Folders (for report folders) GET: - View access to the folder ## Syntax **URI:** `/services/data/v43.0/folders/` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`POST`|Creates a new folder with the specified name, label, and type.| |`GET`|Gets the list of folders.| ## POST Creates a new folder with the specified name, label, type, and parent ID (subfolders only). `/services/data/v43.0/folders/` **Request Body** |Query Parameter Name|Group|Available Version|Values|Description| |--------------------|-----|-----------------|------|-----------| |`folder`|Object|42.0, 43.0|[FolderInputRepresentation](#folder-collections)|Specifies the folder name, label, type, and parent ID.| **FolderInputRepresentation** |Code|Type|Available Version|Description| |----|----|-----------------|-----------| |`label`|String|42.0|Folder display name.| |`name`|String|42.0|Folder unique name. This is a mandatory field for admins; for non-admins, it is auto-generated.| |`type`|[ConnectFolderTypeEnum](#folder-collections)|42.0|Defined by the type of entity the folder contains.| |`parentId`|String|43.0|ID of the parent folder. This field is valid only for subfolders.| **ConnectFolderTypeEnum** |Type|Description| |----|-----------| |Dashboard|Dashboard folders.| |Document|Document folders.| |Email|Email folders.| |Insights|Insights folders.| |Reports|Reports folders.| **Sample Request Body** ```nolang { "label": "report_folder", "name": "report_folder1", "type": "report" "parentId": "00lxx000000fffffff" } ``` **Sample Output Response** ```nolang { "id" : "00lxx000000flSFAAY", "label" : "report_folder", "name" : "report_folder1", "shareRecipientsUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/share-recipients?shareType=User&limit=100", "sharesUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/shares", "supportedShareTypes" : [ "user", "role", "roleandsubordinates", "roleandsubordinatesinternal", "group", "portalrole", "portalroleandsubordinates", "customerportaluser" ], "type" : "report" "parentId" : "00lxx000000fffffff" } ``` ## GET Gets the list of report and dashboard folders. `/services/data/v43.0/folders/` **Parameters** |Field|Type|Available Version|Description| |-----|----|-----------------|-----------| |`type`|[ConnectFolderTypeEnum](#folder-collections)|43.0|Defined by the type of entity the folder contains. If not specified, returns all visible folders. If specified, returns visible folders of the specified type.| |`page`|Integer|43.0|Integer that indicates which page of results to return. Default is 1.| |`pageSize`|Integer|43.0|Integer that indicates how many results to return per page. Default is 10.| **Output Payload** [FolderCollectionRepresentation](#folder-collections) **FolderCollectionRepresentation** |Field|Type|Available Version|Description| |-----|----|-----------------|-----------| |`folders`|[FolderSummaryRepresentation](#folder-collections)|43.0|Collection of folders.| |`totalSize`|Integer|43.0|Size of the folder collection.| |`url`|ConnectUri|43.0|URL of the folder collection.| |`nextPageurl`|ConnectUri|43.0|URL to the next page in the collection.| |`previousPageurl`|ConnectUri|43.0|URL to the next page in the collection.| **FolderSummaryRepresentation** |Field|Type|Available Version|Description| |-----|----|-----------------|-----------| |`id`|ID|43.0|Unique identifier.| |`label`|String|43.0|Display label.| |`name`|String|43.0|Folder unique name.| |`namespace`|String|43.0|Namespace prefix to differentiate custom object and field names from those in use by other organizations.| |`type`|[ConnectFolderTypeEnum](#folder-collections)|43.0|Defined by the type of entity the folder contains.| |`parentId`|ID|43.0|ID of the parent folder.| |`url`|ConnectUri|43.0|URL of the folder.| |`childrenUrl`|ConnectUri|43.0|URL that represents the first level subfolders of the specified folder.| |`depth`|Int|43.0|Depth of the folder in the tree. A folder with depth 0 is the root folder.| **Sample Output Response** ```nolang { "folders" : [ { "childrenUrl" : "/services/data/v43.0/folders/00lRM000000jCWjYAM/children", "id" : "00lRM000000jCWjYAM", "label" : "Asia Sales", "name" : "Asia_Sales", "type" : "report", "url" : "/services/data/v43.0/folders/00lRM000000jCWjYAM" }, { "childrenUrl" : "/services/data/v43.0/folders/00lRM000000jDmNYAU/children", "id" : "00lRM000000jDmNYAU", "label" : "Europe Sales", "name" : "Europe_Sales", "type" : "report", "url" : "/services/data/v43.0/folders/00lRM000000jDmNYAU" }, { "childrenUrl" : "/services/data/v43.0/folders/00lRM000000jHKXYA2/children", "id" : "00lRM000000jHKXYA2", "label" : "North America Sales", "name" : "North_America_Sales", "type" : "report", "url" : "/services/data/v43.0/folders/00lRM000000jHKXYA2" } ], "totalSize" : 3, "url" : "/services/data/v43.0/folders?page=1&pageSize=10" } ``` # Folder Operations Enables renaming, deleting, and obtaining information on report and dashboard folders. The following user permissions are needed to access this resource. GET: - View access for the folder PATCH/DELETE: - Manage access for the folder ## Syntax **URI:** `/services/data/v43.0/folders/` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Gets information about the folder that has the specified folder ID.| |`PATCH`|Updates the label or name of the folder with the specified folder ID.
  • All users with manage access on the folder can change the folder label.
  • Only admin users can change the folder name.
| |`DELETE`|Deletes the folder that has the specified folder ID.| **Parameters** |Parameter|Description| |---------|-----------| |`folderId`|Specifies a unique folder ID.| ## GET Gets information about the folder that has the specified folder ID. `/services/data/v43.0/folders/` **Output Payload** [FolderDetailRepresentatiion](#folder-operations) **FolderDetailRepresentatiion** |Field|Type|Available Version|Description| |-----|----|-----------------|-----------| |`id`|String|42.0|Unique folder identifier.| |`label`|String|42.0|Folder display name.| |`name`|String|42.0|Folder unique name.| |`namespace`|String|42.0|Namespace prefix to differentiate custom object and field names from those in use by other organizations.| |`type`|[ConnectFolderTypeEnum](#folder-operations)|42.0|Defined by the type of entity the folder contains.| |`parentId`|ID|43.0|ID of the parent folder.| |`url`|ConnectUri|43.0|URL of the folder: `/services/data/v43.0/folders/`| |`childrenUrl`|ConnectUri|43.0|URL that represents the first level subfolders of the specified folder: `/services/data/v43.0/folders//children`| |`depth`|Integer|43.0|Depth of the folder in the tree. A folder with depth 0 is the root folder.| |`supportedShareTypes`s|List \<[supportedShareTypes](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-folders-share-recipients.md)>|43.0|List of supported share types for the folder in the organization.| |`sharesUrl`|ConnectUri|43.0|URL of the shares for the particular folder: `/services/data/v43.0/folders//shares`| |`shareRecipientsUrl`|ConnectUri|43.0|URL of the recipients of the share: `/services/data/v43.0/folders//share-recipients`| |`ancestors`|List \<[FolderSummaryRepresentation](#folder-operations)>|43.0|This folder’s ancestor folders, ordered by depth.| **ConnectFolderTypeEnum** |Type|Description| |----|-----------| |Dashboard|Dashboard folders.| |Document|Document folders.| |Email|Email folders.| |Insights|Insights folders.| |Reports|Reports folders.| **FolderSummaryRepresentation** |Field|Type|Available Version|Description| |-----|----|-----------------|-----------| |`id`|ID|43.0|Unique identifier.| |`label`|String|43.0|Display label.| |`name`|String|43.0|Folder unique name.| |`namespace`|String|43.0|Namespace prefix to differentiate custom object and field names from those in use by other organizations.| |`type`|[ConnectFolderTypeEnum](#folder-operations)|43.0|Defined by the type of entity the folder contains.| |`parentId`|ID|43.0|ID of the parent folder.| |`url`|ConnectUri|43.0|URL of the folder: `/services/data/v43.0/folders/`| |`childrenUrl`|ConnectUri|43.0|URL that represents the first level subfolders of the specified folder: `/services/data/v43.0/folders//children`| |`depth`|Int|43.0|Depth of the folder in the tree. A folder with depth 0 is the root folder.| **Sample Output Response** ```nolang { "ancestors" : [ ], "childrenUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/children", "depth" : 0, "id" : "00lxx000000flSFAAY", "label" : "report_folder", "name" : "report_folder1", "shareRecipientsUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/share-recipients?shareType=User&limit=100", "sharesUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/shares", "supportedShareTypes" : [ "user", "role", "roleandsubordinates", "roleandsubordinatesinternal", "group", "portalrole", "portalroleandsubordinates", "customerportaluser" ], "type" : "report", "url" : "/services/data/v43.0/folders/00lxx000000flSFAAY" } ``` ## PATCH Updates the label or name of the folder with the specified folder ID. - Users with manage access on the folder can change the folder label. - Only admin users can change the folder name. `/services/data/v43.0/folders/` **Request Body** |Query Parameter Name|Group|Since|Available Version|Description| |--------------------|-----|-----|-----------------|-----------| |`folder`|Object|42.0|[FolderInputRepresentation](#folder-operations)|Users with edit access on the folder can change `label` . Admins can change `name` . `type` cannot be changed.| **FolderInputRepresentation** |Code|Type|Available Version|Description| |----|----|-----------------|-----------| |`label`|String|42.0|Folder display name.| |`name`|String|42.0|Folder unique name. This is a mandatory field for admins; for non-admins, it is auto-generated.| |`type`|[ConnectFolderTypeEnum](#folder-operations)|42.0|Defined by the type of entity the folder contains:| |`parentId`|String|43.0|ID of the parent folder. This field is valid only for subfolders.| **Sample Request Body** ```nolang { "label": "report_folder1", "name": "report_folder1" } ``` **Sample Raw Response** ```nolang { "ancestors" : [ ], "childrenUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/children", "depth" : 0, "id" : "00lxx000000flSFAAY", "label" : "report_folder1", "name" : "report_folder1", "shareRecipientsUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/share-recipients?shareType=User&limit=100", "sharesUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/shares", "supportedShareTypes" : [ "user", "role", "roleandsubordinates", "roleandsubordinatesinternal", "group", "portalrole", "portalroleandsubordinates", "customerportaluser" ], "type" : "report", "url" : "/services/data/v43.0/folders/00lxx000000flSFAAY" } ``` ## DELETE Deletes the folder that has the specified folder ID. `/services/data/v43.0/folders/` # Folder Share by ID For a specified share ID, extracts folder share information (`GET`), updates the access level on the share (`PATCH`), or deletes the share (`DELETE`). The following user permissions are needed to access this resource. PATCH/DELETE: - Manage access to the folder GET: - View access to the folder ## Syntax **URI:** `/services/data/v41.0/folders//shares/` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Returns information for the specified folder share.| |`PATCH`|Updates the access level on the specified folder share.| |`POST`|Deletes the specified folder share.| **Parameters** |Parameter|Description| |---------|-----------| |`folderId`|ID of the folder containing the share.| |`shareId`|Perform the operation for this unique folder share ID.| ## GET **Response Body** |Property|Type|Description| |--------|----|-----------| |`accessType`|[ConnectFolderAccessTypeEnum](#folder-share-by-id)|Defined by the type of folder access.| |`shareId`|ID|Unique identifier of the share.| |`shareType`|[ConnectFolderShareTypeEnum](#folder-share-by-id)|Defined by the type of folder share.| |`sharedWithId`|ID|Unique identifier of the share recipient.| |`sharedWithLabel`|String|Label of the share recipient.| |`url`|ConnectUri|URL of the share.| **ConnectFolderAccessTypeEnum** |Type|Description| |----|-----------| |View|View access to the folder.| |Edit|Edit access to the folder.| |Manage|Manage access to the folder.| **ConnectFolderShareTypeEnum** |Type|Description| |----|-----------| |Group|Users in a specified public group.| |Role|Users with a specified role.| |RoleAndSubordinates|Users with a specified role and users with a role subordinate to that role.| |RoleAndSubordinatesInternal|Users with a specified role and users with a role subordinate to that role, except public portal users.| |Organization|All internal users.| |AllPrmUsers|All PRM Portal users.| |User|The specified individual user.| |PartnerUser|The specified individual user of a partner portal.| |AllCspUsers|All Customer Success Portal users.| |CustomerPortalUser|The specified individual user of a customer portal.| |PortalRole|Users with a specified role in a portal.| |PortalRoleAndSubordinates|PortalRoleAndSubordinates. Portal users with a specified role, and portal users with a role subordinate to that role.| |ChannelProgramGroup|PRM Portal users who are members of the specified channel programs and levels group.| **Output Example** ```nolang { “shareId” : “004xx000001Sy1GAAS” “accessType” : “manage”, “shareType” : “user” “sharedWithId” : “005xx000001Sy1GAAS” “sharedWithLabel” : “User1” } ``` ## PATCH **Request Body** |Query Param Name|Group|Available Version|Values|Description| |----------------|-----|-----------------|------|-----------| |folder|Object|41.0|[FolderShareInputRepresentation](#folder-share-by-id)|Folder share input representation.| **FolderShareInputRepresentation** |Parameter|Type|Available Version|Description| |---------|----|-----------------|-----------| |shareWithId|ID|41.0|ID of the entity that the folder can be shared with.| |accessType|[ConnectFolderAccessTypeEnum](#folder-share-by-id)|41.0|The access type for the recipient entity on the folder.| |shareType| |41.0|The type of the entity that the folder can be shared with.| **Sample Request Body** ```nolang { "accessType" : "manage", "shareType" : "user", "shareWithId" : "005R0000000Kg8yIAC" } ``` ## DELETE Deletes the folder share that has the specified folder ID. `/services/data/v43.0/folders//shares/` # Folder Share Recipients Return a list of folder share recipients. The following user permissions are needed to access this resource: - View access to the folder ## Syntax **URI:** `/services/data/v41.0/folders//share-recipients?shareType=` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Returns a list of recipients with whom the folder can be shared.| **Parameters** |Parameter|Description|Default| |---------|-----------|-------| |`folderId`|Return data for this unique folder ID.| | |`shareType`|Return data for the recipients of the specified type, such as user, group, or role.|User| |`searchTerm`|Search to match share recipients names.|“ ”| |`limit`|Limit to the number of search results.|100| ## GET **Response Body** |Property|Type|Description|Default| |--------|----|-----------|-------| |`shareRecipients`|List\<[FolderShareRecipientRepresentation](#folder-share-recipients)>|List of recipients along with their share type.| | |`shareType`|[ConnectFolderShareTypeEnum](#folder-share-recipients)|Defined by the type of folder share.| | |`shareWithId`|ID|Return the URL for share recipients.| | |`shareWithLabel`|String|Label of the folder share recipient.| | **FolderShareRecipientRepresentation** |Parameter|Type|Available Version|Description| |---------|----|-----------------|-----------| |shareWithId|ID|41.0|The ID of the folder share recipient.| |shareWithLabel|String|41.0|The label of the folder share recipient.| |shareType|[ConnectFolderShareTypeEnum](#folder-share-recipients)|41.0|The share type of the recipient.| |imageUrl|ConnectUri|42.0|The url of the image for the recipient.| |imageColor|String|42.0|The color of the image for the recipient.| **ConnectFolderShareTypeEnum** |Type|Description| |----|-----------| |Group|Users in a specified public group.| |Role|Users with a specified role.| |RoleAndSubordinates|Users with a specified role and users with a role subordinate to that role.| |RoleAndSubordinatesInternal|Users with a specified role and users with a role subordinate to that role, except public portal users.| |Organization|All internal users.| |AllPrmUsers|All PRM Portal users.| |User|The specified individual user.| |PartnerUser|The specified individual user of a partner portal.| |AllCspUsers|All Customer Success Portal users.| |CustomerPortalUser|The specified individual user of a customer portal.| |PortalRole|Users with a specified role in a portal.| |PortalRoleAndSubordinates|PortalRoleAndSubordinates. Portal users with a specified role, and portal users with a role subordinate to that role.| |ChannelProgramGroup|PRM Portal users who are members of the specified channel programs and levels group.| **Output Example 1** Get share recipients of type `user`. ```nolang /services/data/v41.0/folders/00lR0000000MQT5IAO/share-recipients?shareType=User { "shareRecipients" : [ { "shareType" : "user", "shareWithId" : "005R0000000Kg8wIAC", "shareWithLabel" : "Hank Chen" }, { "shareType" : "user", "shareWithId" : "005R0000000KkU6IAK", "shareWithLabel" : "Integration User" }, { "shareType" : "user", "shareWithId" : "005R0000000Kg8xIAC", "shareWithLabel" : "Nadia Smith" }, { "shareType" : "user", "shareWithId" : "005R0000000Kg8zIAC", "shareWithLabel" : "Sarah Vasquez" } ] } ``` **Output Example 2** Search for share recipients of type `Public Group`, with search term `Group`. ```nolang /services/data/v41.0/folders/00lR0000000MQT5IAO/share-recipients?shareType=Group&searchTerm=Group { "shareRecipients" : [ { "shareType" : "group", "shareWithId" : "00GR0000000EypUMAS", "shareWithLabel" : "Finance" }, { "shareType" : "group", "shareWithId" : "00GR0000000EypeMAC", "shareWithLabel" : "Marketing" }, { "shareType" : "group", "shareWithId" : "00GR0000000NvpIMAS", "shareWithLabel" : "Products" }, { "shareType" : "group", "shareWithId" : "00GR0000000EypZMAS", "shareWithLabel" : "Sales" }, { "shareType" : "group", "shareWithId" : "00GR0000000EypjMAC", "shareWithLabel" : "Technology" } ] } ``` # Folder Shares Extracts a list of current folder shares (`GET`), adds new shares (`POST`), or replaces existing shares (`PUT`). The following user permissions are needed to access this resource. POST/PUT: - Manage access to the folder GET: - View access to the folder ## Syntax **URI:** `/services/data/v41.0/folders//shares` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Returns a list of current folder shares.| |`PUT`|Creates new shares to replace the existing shares in the share list for the folder.| |`POST`|Creates new shares and appends them to the existing share list for the folder.| **Parameters** |Parameter|Description| |---------|-----------| |`folderId`|Perform the operation for this unique folder ID.| ## GET **Response Body** |Property|Type|Description| |--------|----|-----------| |`accessType`|[ConnectFolderAccessTypeEnum](#folder-shares)|Defined by the type of folder access.| |`shareId`|ID|Unique identifier of the share.| |`shareType`|[ConnectFolderShareTypeEnum](#folder-shares)|Defined by the type of folder share.| |`sharedWithId`|ID|Unique identifier of the share recipient.| |`sharedWithLabel`|String|Label of the share recipient.| |`url`|ConnectUri|URL of the share.| **ConnectFolderAccessTypeEnum** |Type|Description| |----|-----------| |View|View access to the folder.| |Edit|Edit access to the folder.| |Manage|Manage access to the folder.| **ConnectFolderShareTypeEnum** |Type|Description| |----|-----------| |Group|Users in a specified public group.| |Role|Users with a specified role.| |RoleAndSubordinates|Users with a specified role and users with a role subordinate to that role.| |RoleAndSubordinatesInternal|Users with a specified role and users with a role subordinate to that role, except public portal users.| |Organization|All internal users.| |AllPrmUsers|All PRM Portal users.| |User|The specified individual user.| |PartnerUser|The specified individual user of a partner portal.| |AllCspUsers|All Customer Success Portal users.| |CustomerPortalUser|The specified individual user of a customer portal.| |PortalRole|Users with a specified role in a portal.| |PortalRoleAndSubordinates|PortalRoleAndSubordinates. Portal users with a specified role, and portal users with a role subordinate to that role.| |ChannelProgramGroup|PRM Portal users who are members of the specified channel programs and levels group.| **Output Example 1** Sample raw response for a folder not shared with anyone. ```nolang { “shares” : [] } ``` **Output Example 2** Sample raw response for a folder shared with two users and a public group. ```nolang { "shares" : [ { "accessType" : "view", "shareId" : "0AFR00000004LtpOAE", "shareType" : "group", "sharedWithId" : "00GR0000000Mi1nMAC", "sharedWithLabel" : "Demo Group", "url" : "/services/data/v41.0/folders/00lR0000000MQT5IAO/shares/0AFR00000004LtpOAE" }, { "accessType" : "edit", "shareId" : "0AFR00000004LtkOAE", "shareType" : "user", "sharedWithId" : "005R0000000Kg8yIAC", "sharedWithLabel" : "Brian Alison", "url" : "/services/data/v41.0/folders/00lR0000000MQT5IAO/shares/0AFR00000004LtkOAE" }, { "accessType" : "manage", "shareId" : "0AFR00000004LtlOAE", "shareType" : "user", "sharedWithId" : "005R0000000Kg8cIAC", "sharedWithLabel" : "Fred Williamson", "url" : "/services/data/v41.0/folders/00lR0000000MQT5IAO/shares/0AFR00000004LtlOAE" } ] } ``` ## PUT/POST **Request Body** |Query Param Name|Group|Available Version|Values|Description| |----------------|-----|-----------------|------|-----------| |folder|Object|41.0|`FolderSharesInputRepresentation`|Folder input representation containing a list of shares.| **Sample Request Body** ```nolang { "shares" : [ { "accessType" : "view", "shareType" : "group", "shareWithId" : "00GR0000000Mi1nMAC" }, { "accessType" : "edit", "shareType" : "user", "shareWithId" : "005R0000000Kg8yIAC" }, { "accessType" : "manage", "shareType" : "user", "shareWithId" : "005R0000000Kg8cIAC" } ] } ``` # folder.json Attributes The `folder.json` file attributes are: | Attribute | Required | Description | | ---------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | Yes for auto-installed templates, No for templates that use the configuration wizard | Folder developer name. For apps created from auto-installed templates, the folder developer name is required for the creation of app. | | `label` | No | Folder label. | | `description` | No | Folder description. | | `featuredAssets` | Yes | Container for assets; this can be empty if no `featuredAssets` are present. | | `featuredAssets` → `default` | No | Container for assets. | | `featuredAssets` → `default`→ `assets` | No | Container for array of assets. | | `featuredAssets` → `default`→ `assets`→ `id` element | No | Tokenized ID of dashboard asset. | | `featuredAssets` → `default`→ `assets`→ `name` | No | Asset name. | | `featuredAssets` → `default`→ `assets`→ `namespace` | No | Asset namespace. | | `featuredAssets` → `default`→ `assets`→ `type` | No | Asset type, such as `dashboards`, `lenses`, or `eltDatflows`. Can be `null`. | | `shares` | No | Sharing rules for the folder. | | `shares` → `sharedWithID` | Yes, if `shares` is used. | User ID or Group ID to share this folder with. | | `shares` → `accessType` | Yes, if `shares` is used. | Access type for the sharing rule. Valid values are `EDIT`, `MANAGE`, and `VIEW`. | | `shares` → `shareType` | Yes, if `shares` is used. | The sharing type for the sharing rule. Valid values are `Group`, `Organization`, `Role`, `RoleAndSubordinates`, `RoleAndSubordinatesInternal`, `User`, `PortalRole`, `PortalRoleAndSubordinates`, `AllCspUsers`, `AllPrmUsers`, `PartnerUsers`, and `CustomerPortalUser`. | **See Also** - [Edit folder.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-edit-folder-json.md) # Folders Use the Analytics Folders API to perform operations on report and dashboard folders. The Folders API is available in API version 41.0 and later. Resources for the Analytics Folders API are available at `/services/data//folders`. You can query each resource with an `HTTP` method.
Resource Supported HTTP Method Description

Folder Collections

/services/data/<span><latest API version></span>/folders/

POST

GET

Enables creation of report and dashboard folders and subfolders ( POST ).

Gets the list of folders ( GET ).

Folder Operations

/services/data/<span><latest API version></span>/folders/<span><folderid></span>

GET

PATCH

DELETE

Enables renaming ( PATCH ), deleting ( DELETE ), and obtaining information ( GET ) on the report or dashboard folder or subfolder.
Folder Shares

/services/data/<span><latest API version></span>/folders/<span><folderid></span>/shares

GET

PUT

POST

Extracts a list of current folder shares ( GET ), adds new shares ( POST ), or replaces existing shares ( PUT ).

Folder Share by ID

/services/data/<span><latest API version></span>/folders/<span><folderid></span>/shares/

GET

PATCH

DELETE

For a specified share ID, extracts the share information ( GET ), updates the access level on the share ( PATCH ), or deletes the share ( DELETE ).

Folder Share Recipients

/services/data/<span><latest API version></span>/folders/<span><folderid>/</span>share-recipients?shareType=<span><shareType></span>

GET

Returns a list of folder share recipients ( GET ).

Folder Child Operations

/services/data/<span><latest API version></span>/folders/<span><folderid></span>/children/

GET

Returns a list of first-level child folders (subfolders) ( GET ).

# foreach Applies a set of expressions to every row in a dataset. This action is often referred to as _projection_. ## Syntax ```nolang q = foreach q generate expression as alias[, expression as alias ...]; ``` The output column names are specified with the `as` keyword. The output data is ungrouped. ## Using foreach with Ungrouped Data When used with ungrouped data, the `foreach` statement maps the input rows to output rows. The number of rows remains the same. ## Example `a2 = foreach a1 generate carrier as carrier, miles as miles;` ## Using foreach with Grouped Data When used with grouped data, the `foreach` statement behaves differently than it does with ungrouped data. Fields can be directly accessed only when the value is the same for all group members. For example, the fields that were used as the grouping keys have the same value for all group members. Otherwise, use aggregate functions to access the members of a group. The type of the column determines which aggregate functions you can use. For example, if the column type is numeric, you can use the `sum()` function. ## Example `z = foreach y generate day as day, unique(origin) as uorg, count() as n;` ## Using foreach with a case Expression To create logic in a `foreach` statement that chooses between conditional statements, use a `case` expression. ## Projected Field Names Each field name in a projection must be unique and not have the name 'none'. Invalid field names throw an error. For example, the last line in this query is invalid because the same name is used for multiple projected fields: ```nolang l = load "0Fabb000000002qCAA/0Fabb000000002WCAQ"; r = load "0Fcyy000000002qCAA/0Fcyy000000002WCAQ"; l = foreach l generate 'value'/'divisor' as 'value' , category as category; r = foreach r generate 'value'/'divisor' as 'value' , category as category; cg = cogroup l by category right, r by category; cg = foreach cg generate r.category as 'category', sum(r.value) as sumrval, sum(l.value) as sumrval; ``` The following query is also invalid because the projected field name can't be 'none'. ```nolang q = load "Products"; q = group q by all; q = foreach q generate count() as 'none'; q = limit q 2000; ``` ## Examples For examples of projections, see [Calculate Grand Totals and Subtotals with the rollup Modifier and grouping() Function](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-rollup-grouping.md). **See Also** - [Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statements.md) # Forecast Future Data Points with timeseries Use existing data to predict what might happen in the future. ## Example - How Many Tourists Will Visit Next Year? Suppose that you run a chain of retail stores, and the number of tourists in your city affect your sales. Use `timeseries` to predict how many tourists will come to your city next year: ```nolang q = load "TouristData"; q = group q by ('Visit_Year', 'Visit_Month'); q = foreach q generate 'Visit_Year', 'Visit_Month', sum('NumTourist') as 'sum_NumTourist'; -- If your data is missing some dates, use fill() before using timeseries() -- Make sure that the dateCols parameter in fill() matches the dateCols parameter in timerseries() q = fill q by (dateCols=('Visit_Year','Visit_Month', "Y-M")); -- Use timeseries() to predict the number of tourists. q = timeseries q generate 'sum_NumTourist' as Tourists with (length=12, dateCols=('Visit_Year','Visit_Month', "Y-M")); q = foreach q generate 'Visit_Year' + "~~~" + 'Visit_Month' as 'Visit_Year~~~Visit_Month', Tourists; ``` Use a timeline chart and set a predictive line to see the calculated future data. The resulting graph shows the likely number of tourists in the future. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_statement_timeseries_tourist.png) **See Also** - [timeseries](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-timeseries.md) # Format Fields and Field Values with XMD These topics explore some common uses of XMD. Almost all of the XMD functionality is now supported in the UI for CRM Analytics dashboards and lenses. **note:** Data 360 objects (DMOs, DLOs, and CIOs) support a subset of these capabilities: column rename, column value rename, and custom chart colors. For an overview of XMD support across all data source types, see [Extended Metadata (XMD) Overview](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-intro.md). - **[Change Display Labels for Dataset Fields and Values](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-change-labels.md)** When you change display labels for fields and values, the changes affect only the appearance in the UI. The changes don’t alter the underlying data stored in the dataset or the API names of the fields. - **[Hide Dataset Fields from Lens and Dashboard](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-show-dataset-fields.md)** By default, all dataset fields are available in the UI. But you can hide fields so that users can’t select them when building queries and dashboards. - **[Format Measures](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-format-currency.md)** You can apply letters or symbols before or after the numeric value, such as for currency, perform decimal rounding, and add grouping and decimal separators. - **[Multiply Measures by a Fixed Amount](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-multiply-by-fixed-amount.md)** You can multiply the values of a measure or derived measure by a fixed amount. For example, you can use the multiplier to convert a field’s decimal values to percents. - **[Change the Label for the Row Count Measure](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-change-count-measure.md)** When you add a row count measure, it appears as “Count of Rows” by default. You can change this label to whatever you want. - **[Change Chart Colors for Dimension Values](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-change-chart-colors.md)** You can customize the colors of dimension values in a stacked bar, stacked column, or stacked waterfall chart. If you specify one measure and two groups, you can also customize the color for donut, funnel, treemap, stacked pyramid, line, and timeline charts. - **[Add Actions to Dimensions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-add-record-level-actions.md)** Set up record-level actions on a dimension so that dashboard viewers can perform actions directly from a CRM Analytics chart or table. Each action applies to a single Salesforce record, such as creating a task for an opportunity record. You can also create an action to open the Salesforce record or a URL. - **[Change the Default Fields for a Values Table](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-xmd-values-table-set-default-fields.md)** When you create a values table, particular dataset fields are shown by default. When the fields are sorted in alphabetical order, which includes dates, the table shows the first five measures and first five dimensions. You can change the default fields by editing the XMD. - **[Format the Results of a Query with Multiple Datasets](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/guide/bi-dashboards-steps-multidataset-xmd.md)** When a query has multiple datasets, the query results are formatted using the XMD of the first loaded dataset. # Format Measures You can apply letters or symbols before or after the numeric value, such as for currency, perform decimal rounding, and add grouping and decimal separators. **note:** XMD doesn't update formatting for user input or context-driven fields. Formatting can only be applied to a static or preset value. ## Formatting a Measure In this example lens, the values in the Sales column don’t include decimals or currency symbols. ![The values table shows the Sales field values without any formatting.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_format_currency_before.png) To relabel the Sales field and format its values, modify the XMD as indicated in the bold text. ```nolang "measures" : [ { "field": "Sales", "format": { "customFormat": "[\"$#,###,###.##\",1]" }, "label": "Sales (USD)", "showInExplorer": true } ], ``` The field now has the label “Sales (USD)” and its values include a currency symbol and two decimal places. ![The values table shows the Sales field with the new label and formatted values.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_format_currency_after.png) ## Formatting a Derived Measure The following SAQL query contains a derived measure that calculates the average revenue per employee. As shown, the values in this derived field aren’t formatted. ![The values table shows the RevPerEmployee derived field values with no formatting.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_format_derived_measure_query.png) To relabel the RevPerEmployee field and format its values, modify the XMD as indicated in the bold text. ```nolang "derivedMeasures": [ { "field": "RevPerEmployee", "format": { "customFormat": "[\"$#,###.##\",1]" }, "label": "Revenue Per Employee", "showInExplorer": true } ], ``` The field now has the label “Revenue Per Employee” and its values include a currency symbol and a grouping separator. ![The values table shows the RevPerEmployee field with the new label and formatted values.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_format_derived_measure_display.png) ## More Formatting Examples Check out these examples that illustrate how to use symbols to format measures and derived measures. For information about using symbols in the `customFormat` field, see [Measures and Derived Measures in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-measures.md). | Goal | XMD | | ----------------------------------------------------------------------------------------------------------------------------- | ------------------- | | Display 500000 as $500,000 (prefix with "$") | See Example 1 below | | Display 500000 as $500,000 (prefix with "$", include grouping separator) | See Example 2 below | | Display 500000 as $500,000.00 (prefix with "$", include grouping separator, apply 2 decimal places) | See Example 3 below | | Display 500000 as –$500,000.00USD (prefix with "–$", include grouping separator, apply 2 decimal places, suffix with "USD") | See Example 4 below | | Display Canadian currency code as a suffix (include grouping separator, apply 2 decimal places, suffix with "CAD") | See Example 5 below | | Display -1,234.56 as `–$1,234.56` (use a semi-colon delimiter for negatives, `pos;neg`) | See Example 6 below | | Display -1,234.56 as `($1,234.56)` (Optional. Use a semi-colon delimiter, parenthesis for negatives, `pos;(neg)`) | See Example 7 below | ## Example 1: Display 500000 as $500,000 (prefix with "$") ```nolang "measures": [ { "description" : "Amount", "field" : "Amount", "format" : { "customFormat": "[\"$###0\",1]" }, "label" : "Amount", "showInExplorer" : true } ], ``` ## Example 2: Display 500000 as $500,000 (prefix with "$", include grouping separator) ```nolang "derivedMeasures": [ { "description" : "Amount", "field" : "Amount", "format" : { "customFormat": "[\"$###,#00\",1]" }, "label" : "Amount", "showInExplorer" : true } ], ``` ## Example 3: Display 500000 as $500,000.00 (prefix with "$", include grouping separator, apply 2 decimal places) ```nolang "measures": [ { "description" : "Amount", "field" : "Amount", "format" : { "customFormat": "[\"$###,#00.00\",1]" }, "label" : "Amount", "showInExplorer" : true } ], ``` ## Example 4: Display 500000 as -$500,000.00USD (prefix with "-$", include grouping separator, apply 2 decimal places, suffix with "USD") ```nolang "measures": [ { "description" : "Negative dollar amount", "field" : "Amount", "format" : { "customFormat": "[\"-$###,#00.00USD\",1]" }, "label" : "Amount", "showInExplorer" : true } ], ``` ## Example 5: Display Canadian currency code as a suffix (include grouping separator, apply 2 decimal places, suffix with "CAD") ```nolang "measures": [ { "description" : "Amount", "field" : "Amount", "format" : { "customFormat": "[\"#,##0.00CAD\",1]" }, "label" : "Amount", "showInExplorer" : true } ], ``` ## Example 6: Display -1,234.56 as -$1,234.56 (Use a semi-colon delimiter for negatives, `pos;neg`) ```nolang "measures": [ { "description" : "Amount", "field" : "Amount", "format" : { "customFormat": "[\"$#,###.##;-$#,###.##\",1]" }, "label" : "Amount", "showInExplorer" : true } ], ``` ## Example 7: Display -1,234.56 as ($1,234.56) (Optional. Use a semi-colon delimiter, parenthesis for negatives, `pos;(neg)`) ```nolang "measures": [ { "description" : "Amount", "field" : "Amount", "format" : { "customFormat": "[\"$#,###.##;($#,###.##)\",1]" }, "label" : "Amount", "showInExplorer" : true } ], ``` ## Example 8: Display -1,234.56 as $1,234.56- (Optional. Use a semi-colon delimiter, '-' after the second delimiter, `pos;neg;zero`) ```nolang "measures": [ { "description" : "Amount", "field" : "Amount", "format" : { "customFormat": "[\"$#,###.##;$#,###.##;-\",1]" }, "label" : "Amount", "showInExplorer" : true } ], ``` # Format the Results of a Query with Multiple Datasets When a query has multiple datasets, the query results are formatted using the XMD of the first loaded dataset. For example, the Quota dataset is loaded first so its XMD is used to format the projected columns Amount and Percent Attained. ```nolang -- The Quota dataset's XMD is used because it is loaded first quota = load "Quota"; ops = load "Opportunity"; q = cogroup ops by 'Owner.Name', quota by 'Employee'; q = foreach q generate quota.'Employee' as 'Account Owner', sum(ops.'Amount') as 'Amount', trunc(sum(ops.'Amount')/sum(quota.'Quota')*100,2) as 'Percent Attained'; ``` However, the Quota dataset’s XMD doesn't contain the Amount field, so the projected amount is formatted as a number rather than as currency. ![table without formatting](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_dashboard_steps_multidataset_noxml.png) The Opportunity dataset’s XMD contains an Amount field that is formatted as currency. To format the amount as currency, load the Opportunity dataset first. ![table with formatting](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_dashboard_steps_multidataset_xmlapplied.png) # FROM Clause The `FROM` clause defines which table or table function to query. CRM Analytics SQL supports using `FROM` with a single table only. You can’t select from multiple tables. CRM Analytics SQL supports the following table functions. - **[FILL](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-fill.md)** Use the `FILL()` table function to fill in any gaps in date fields. By specifying the date fields to check, `FILL()` creates rows that contain the missing month, day, week, quarter, or year and null data. Use it with `TIMESERIES()` to forecast future results when there are gaps in input data. - **[TIMESERIES](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-timeseries.md)** Use the `TIMESERIES()` table function to predict future values based on existing ones tracked over time. Optionally choose a prediction model, confidence interval, and seasonality among other parameters. # Generate the Access Token and Frontdoor URL for Tableau Next Embedding To complete the authentication process, you must generate an access token and a Frontdoor URL. Use the generated Frontdoor URL as the `authCredential` value when you initialize the SDK. ## Generate the Access Token To generate the access token, use the [OAuth 2.0 Web Server Flow](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_web_server_flow.htm). The web server flow is a two-step flow for obtaining an access token. Step 1 is browser-driven, where the user redirects to Salesforce and step 2 is server-side, where your backend exchanges the code. 1. Authorization request: Your app redirects the user to the Salesforce authorization endpoint, `/services/oauth2/authorize`. After the user authenticates, Salesforce redirects back to the configured callback URL with an authorization code in the query string. 2. Token exchange: Your app sends an HTTP POST request to the Salesforce token endpoint, `/services/oauth2/token`, with the authorization code and the app's `client_id`. Salesforce responds with a JSON payload containing the `access_token` and `instance_url`. Proof Key for Code Exchange (PKCE) is only required if your External Client App (ECA) has the OAuth security policy **Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows** enabled. When using this policy, your app must include a code challenge on the authorization request and code verifier on the token request. For more information, see [Use the OAuth 2.0 Proof Key for Code Exchange (PKCE) Extension](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_pkce.htm). If your ECA uses the OAuth security policy **Require Secret for Web Server Flow**, the POST request to the token endpoint must also include your app's `client_secret` as a form parameter alongside the `client_id`. If you're not using this policy, sending the `client_id` alone is sufficient. These code examples show detailed steps for authorization. The host references your Salesforce org and `CLIENT_ID` and `CLIENT_SECRET` are the values you copied and saved from the ECA OAuth settings. Remember, the consumer key is the `client_id` and the consumer secret the `client_secret`. **note:** These examles are JavaScript and run on Node.js with Express. You can implement the same flow in any server-side language, substituting the equivalent HTTP and crypto primitives in your stack of choice. For example, use Java with Spring Boot, Python with Flask or FastAPI, Go with net/http, Ruby on Rails, or .NET / C#. The endpoint paths, parameters, and request and response shapes are identical regardless of language. ### Shared setup example - the session is required, keeping the token server-side ```javascript import express from 'express'; import session from 'express-session'; import crypto from 'node:crypto'; const { LOGIN_URL, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, APP_ORIGIN, SESSION_SECRET } = process.env; const app = express(); app.use(session({ secret: SESSION_SECRET, resave: false, saveUninitialized: true, cookie: { httpOnly: true, sameSite: 'lax' }, })); // --- PKCE helpers --- const base64url = (buf) => buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); const generatePkce = () => { const verifier = base64url(crypto.randomBytes(64)); const challenge = base64url(crypto.createHash('sha256').update(verifier).digest()); return { verifier, challenge }; }; ``` ### Step 1: Authorization request example ```javascript app.get('/login', (req, res) => { const { verifier, challenge } = generatePkce(); req.session.codeVerifier = verifier; // Per-session `state` for CSRF / login-mix-up protection. PKCE secures the code // exchange; `state` is a separate defense on the callback — use both. const state = base64url(crypto.randomBytes(32)); req.session.oauthState = state; const params = new URLSearchParams({ response_type: 'code', client_id: CLIENT_ID, redirect_uri: REDIRECT_URI, scope: 'api refresh_token lightning web', code_challenge: challenge, code_challenge_method: 'S256', state, }); res.redirect(`${LOGIN_URL}/services/oauth2/authorize?${params}`); }); ``` ### Step 2: Token exchange example, keeping the token server-side ```javascript aapp.get('/getAccessToken', async (req, res) => { const { code, state, error, error_description } = req.query; if (error) return res.status(400).send(`OAuth error: ${error_description || error}`); // Reject the callback unless `state` matches the value stored in Step 1. if (!state || state !== req.session.oauthState) { return res.status(400).send('Invalid or missing OAuth state'); } delete req.session.oauthState; // single-use const { codeVerifier } = req.session; if (!code || !codeVerifier) return res.status(400).send('Missing code or PKCE verifier'); const params = new URLSearchParams({ grant_type: 'authorization_code', client_id: CLIENT_ID, redirect_uri: REDIRECT_URI, code: String(code), code_verifier: String(codeVerifier), }); if (CLIENT_SECRET) params.append('client_secret', CLIENT_SECRET); const response = await fetch(`${LOGIN_URL}/services/oauth2/token`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: params.toString(), }); const data = await response.json(); if (!response.ok || data.error) { return res .status(response.status || 500) .send(`Token exchange failed: ${data.error_description || data.error}`); } // Keep credentials server-side. Do NOT send them to the browser. req.session.accessToken = data.access_token; req.session.instanceUrl = data.instance_url; req.session.refreshToken = data.refresh_token; // present if the refresh_token scope was granted res.redirect(APP_ORIGIN); // send the user back to your app; it then calls /getFrontdoorURL }); ``` ## Generate a Frontdoor URL for Embedding Use Frontdoor URLs to bridge into UI sessions, giving your users uninterrupted access to Salesforce and other apps. The Frontdoor URL uses an existing session to log users into a new UI automatically without making them enter their credentials again. For Tableau Next embedding, only the embedded components need and use the Frontdoor URL. **note:** Frontdoor URLs are short-lived. For session refresh, you must generate a new Frontdoor URL. ### Generate the Frontdoor URL example ```javascript app.get('/getFrontdoorURL', async (req, res) => { if (!req.session.accessToken || !req.session.instanceUrl) { return res.status(401).json({ error: 'Not authenticated. Visit /login first.' }); } const response = await fetch(`${req.session.instanceUrl}/services/oauth2/singleaccess`, { method: 'POST', headers: { accept: 'application/json', authorization: `Bearer ${req.session.accessToken}`, 'content-type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams(), }); if (!response.ok) { return res .status(response.status) .json({ error: `Could not generate FrontDoor URL (${response.status}). Re-authenticate at /login.` }); } const data = await response.json(); // The ONLY value that reaches the browser. Pass it to the SDK as `authCredential`. res.json({ frontdoorUrl: data.frontdoor_uri }); }); ``` For information on how to use the UI Bridge API to generate Frontdoor URLs, see [Generate a Frontdoor URL to Bridge into UI Sessions](https://help.salesforce.com/s/articleView?id=xcloud.frontdoor_singleaccess.htm&type=5). ## Authentication Management - Don't hard code OAuth tokens or Frontdoor URLs in your client-side code. - Pass credentials to the browser only when strictly necessary. Malicious actors can scrape credentials from the browser. ## Session Management and Logout The SDK provides a `logout()` method to terminate the Salesforce session. **important:** Calling `logout()` tears down the SDK-managed embedded session(s), for the orgs you pass in, or all SDK-initialized orgs if you call it with no arguments. It doesn't sign the user out of unrelated Salesforce sessions in the same browser. For more information, see [logout()](/docs//analytics/sdk/references/sdk-js-v2/logout.html). # Get a List of Report Types Return a list of analytics notifications using a GET request. Use a GET request on the [Report Type List](https://developer.salesforce.com/docs/analytics/reference/reporttypes/analytics-api-reporttypes-reference-list.md) resource to return a list of report types. ## Example Usage `/services/data/v39.0/analytics/reportTypes` ## Example Response Body ```nolang [ { "label" : "Accounts & Contacts", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AccountList", "label" : "Accounts", "type" : "AccountList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContactList", "label" : "Contacts & Accounts", "type" : "ContactList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AccountPartner", "label" : "Accounts with Partners", "type" : "AccountPartner" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AccountTeam", "label" : "Account with Account Teams", "type" : "AccountTeam" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AccountContactRole", "label" : "Accounts with Contact Roles", "type" : "AccountContactRole" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AccountAsset", "label" : "Accounts with Assets", "type" : "AccountAsset" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContactAsset", "label" : "Contacts with Assets", "type" : "ContactAsset" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AccountAuditHistory", "label" : "Account History", "type" : "AccountAuditHistory" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContactAuditHistory", "label" : "Contact History", "type" : "ContactAuditHistory" } ] }, { "label" : "Opportunities", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/Opportunity", "label" : "Opportunities", "type" : "Opportunity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityProduct", "label" : "Opportunities with Products", "type" : "OpportunityProduct" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityContact", "label" : "Opportunities with Contact Roles", "type" : "OpportunityContact" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityPartner", "label" : "Opportunities with Partners", "type" : "OpportunityPartner" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityCompetitor", "label" : "Opportunities with Competitors", "type" : "OpportunityCompetitor" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityHistory", "label" : "Opportunity History", "type" : "OpportunityHistory" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityFieldAuditHistory", "label" : "Opportunity Field History", "type" : "OpportunityFieldAuditHistory" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityTrend", "label" : "Opportunity Trends", "type" : "OpportunityTrend" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityContactProduct", "label" : "Opportunities with Contact Roles and Products", "type" : "OpportunityContactProduct" } ] }, { "label" : "Customer Support Reports", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseList", "label" : "Cases", "type" : "CaseList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseHistory", "label" : "Case Lifecycle", "type" : "CaseHistory" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseContactRole", "label" : "Cases with Contact Roles", "type" : "CaseContactRole" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseAsset", "label" : "Cases with Assets", "type" : "CaseAsset" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseSolution", "label" : "Cases with Solutions", "type" : "CaseSolution" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseAuditHistory", "label" : "Case History", "type" : "CaseAuditHistory" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/SolutionList", "label" : "Solutions", "type" : "SolutionList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/SolutionCategory", "label" : "Solution Categories", "type" : "SolutionCategory" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/SolutionAuditHistory", "label" : "Solution History", "type" : "SolutionAuditHistory" } ] }, { "label" : "Leads", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/LeadList", "label" : "Leads", "type" : "LeadList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityLead", "label" : "Leads with converted lead information", "type" : "OpportunityLead" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/LeadAuditHistory", "label" : "Lead History", "type" : "LeadAuditHistory" } ] }, { "label" : "Activities", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/Activity", "label" : "Tasks and Events", "type" : "Activity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/EventAttendee", "label" : "Events with Invitees", "type" : "EventAttendee" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/EmailStatus", "label" : "HTML Email Status", "type" : "EmailStatus" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AccountActivity", "label" : "Activities with Accounts", "type" : "AccountActivity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContactActivity", "label" : "Activities with Contacts", "type" : "ContactActivity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityActivity", "label" : "Activities with Opportunities", "type" : "OpportunityActivity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/LeadActivity", "label" : "Activities with Leads", "type" : "LeadActivity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseActivity", "label" : "Activities with Cases", "type" : "CaseActivity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/SolutionActivity", "label" : "Activities with Solutions", "type" : "SolutionActivity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractActivity", "label" : "Activities with Contracts", "type" : "ContractActivity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ProductActivity", "label" : "Activities with Products", "type" : "ProductActivity" } ] }, { "label" : "Contracts and Orders", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractList", "label" : "Contracts", "type" : "ContractList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractAuditHistory", "label" : "Contract History", "type" : "ContractAuditHistory" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractOrder", "label" : "Contracts with Orders", "type" : "ContractOrder" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractOrderItem", "label" : "Contracts with Orders and Products", "type" : "ContractOrderItem" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractContactRole", "label" : "Contracts with Contact Roles", "type" : "ContractContactRole" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OrderList", "label" : "Orders", "type" : "OrderList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OrderItemList", "label" : "Orders with Products", "type" : "OrderItemList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/OrderAuditHistory", "label" : "Order History", "type" : "OrderAuditHistory" } ] }, { "label" : "Price Books, Products and Assets", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ProductList", "label" : "Products", "type" : "ProductList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ProductOpportunity", "label" : "Products with Opportunities", "type" : "ProductOpportunity" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/PricebookProduct", "label" : "Price Books with Products", "type" : "PricebookProduct" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ProductAsset", "label" : "Products with Assets", "type" : "ProductAsset" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AssetWithProduct", "label" : "Assets", "type" : "AssetWithProduct" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/AssetCase", "label" : "Assets with Cases", "type" : "AssetCase" } ] }, { "label" : "Administrative Reports", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/User", "label" : "Users", "type" : "User" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/ReportList", "label" : "Reports", "type" : "ReportList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/DocumentList", "label" : "Documents", "type" : "DocumentList" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/LoginIpEmail", "label" : "New Login Locations", "type" : "LoginIpEmail" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/TwoFactorMethodsInfo", "label" : "Identity Verification Methods", "type" : "TwoFactorMethodsInfo" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CollabGroup", "label" : "Collaboration Group Report", "type" : "CollabGroup" }, { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/CollabGroupFeedPosts", "label" : "Collaboration Group Feed Posts Report", "type" : "CollabGroupFeedPosts" } ] }, { "label" : "File and Content Reports", "reportTypes" : [ { "describeUrl" : "/services/data/v39.0/analytics/reportTypes/File", "label" : "File and Content Report", "type" : "File" } ] } ] ``` # Get Analytics Notifications Return a list of analytics notifications using a GET request. Use a GET request on the [Analytics Notification List](https://developer.salesforce.com/docs/analytics/reference/notifications/analytics-api-notifications-reference-list.md) resource to return a list of analytics notifications. ## Example Usage `/services/data/v38.0/analytics/notifications?source=lightningReportSubscribe` |Parameter|Description| |---------|-----------| |`source`|Required for `GET` calls. Specifies what type of analytics notification to return. Valid values are:
  • `lightningDashboardSubscribe` — dashboard subscriptions
  • `lightningReportSubscribe` — report subscriptions
  • `waveNotification` — Analytics notifications
| |`ownerId`|Optional for `GET` calls. Allows users with Manage Analytics Notifications permission to get notifications for another user with the specified `ownerId`.| |`recordId`|Optional. Return notifications for a single record. Valid values are:
  • `reportId`— Unique report ID
  • `lensId`— Unique Analytics lens ID
| ## Example Response Body ```nolang [ { "active" : true, "createdDate" : "2016-08-08T04:14:12Z", "deactivateOnTrigger" : false, "id" : "0AuR00000004CYpKAM", "lastModifiedDate" : "2016-08-08T04:14:12Z", "name" : "Notification1", "recordId" : "00OR0000000P7EgMAK", "schedule" : { "details" : { "time" : 3 }, "frequency" : "daily" }, "source" : "lightningReportSubscribe", "thresholds" : [ { "actions" : [ { "configuration" : { "recipients" : [ ] }, "type" : "sendEmail" } ], "conditions" : null, "type" : "always" } ] }, { "active" : true, "createdDate" : "2016-08-10T22:22:17Z", "deactivateOnTrigger" : false, "id" : "0AuR000000000KSKAY", "lastModifiedDate" : "2016-08-11T23:16:01Z", "name" : "Notification2", "recordId" : "00OR0000000PCHYMA4", "schedule" : { "details" : { "daysOfMonth" : [ 1, 2, 4 ], "time" : 22 }, "frequency" : "monthly", "frequencyType" : "specific" }, "source" : "lightningReportSubscribe", "thresholds" : [ { "actions" : [ { "configuration" : { "recipients" : [ ] }, "type" : "sendEmail" } ], "conditions" : null, "type" : "always" } ] }, { "active" : true, "createdDate" : "2016-08-12T04:01:50Z", "deactivateOnTrigger" : false, "id" : "0AuR000000000KcKAI", "lastModifiedDate" : "2016-08-12T04:16:34Z", "name" : "Notification3", "recordId" : "00OR0000000PBXEMA4", "schedule" : { "details" : { "dayInWeek" : "mon", "time" : 22, "weekInMonth" : "third" }, "frequency" : "monthly", "frequencyType" : "relative" }, "source" : "lightningReportSubscribe", "thresholds" : [ { "actions" : [ { "configuration" : { "recipients" : [ ] }, "type" : "sendEmail" } ], "conditions" : null, "type" : "always" } ] } ] ``` # Get and Set the Dashboard State This use case implements one Aura component to illustrate the `getState` and `setState` methods in a basic working example. This component contains two `wave:waveDashboard` components, two buttons, and a text box to display the dashboard state for reference. The buttons trigger the calls to `getState` and `setState` methods, which are implemented in the Aura controller code. ## Example: Component Code Create a simple custom Aura Component with the name `GetSetStateExample`. For more information on how to create Aura components, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/intro_components.htm). The `dashboardDevName` attribute is the fully qualified developer name of the dashboard that you want to use. In production, this value is determined at runtime by discovering the CRM Analytics dashboard developer name. In this example, it’s hard-coded to focus on the state methods. For testing, enter a CRM Analytics dashboard developer name from your test org to replace the `dashboardDevName` default value. Use a dashboard with at least one filter or selection widget so the dashboard state can change with user interaction. The `lightning:textarea` displays the dashboard state as received by the `getState` call. This state is the same state that’s passed into the `setState` method. This text enables you to inspect the state so that you can experiment and learn as you interact with the `dashboard_1` component. The two `wave:waveDashboard` components are identical, except for the `aura:id`. The first dashboard, which is used to get the state, has an `aura:id` of `dashboard_1`. The second dashboard, which is used to set the state, has an `aura:id` of `dashboard_2`. ```xml
``` ## Example: Controller Code Create a controller for your custom component with the name `GetSetStateExampleController`. The controller code implements the state methods. When the buttons are clicked, each click executes the controller methods. In this example, `console.warn` calls are used to display what the methods are doing in a debugger. The dashboard state is represented as a JSON object. This example uses the JSON object methods to parse the state into and out of the method payloads and to stringify the JSON for display. The `getState` function finds `dashboard_1` and calls the `getState` method of that dashboard. In the `callback` function, the dashboard state is stored in the component `dashboardState` attribute for display in the text area and for use by the `setState` function. The `setState` function gets the dashboard state from the `dashboardState` attribute, parses it back from a string into JSON, and sets it as the `config` parameter. It finds `dashboard_2` and calls the `setState` method of the dashboard with the `config` parameter. ```javascript ({ getState: function (component, event, helper) { var dashboard = component.find("dashboard_1"); var config = {}; dashboard.getState(config, function (result, error) { if (error) { console.warn("getState error: ", error); } if (result) { let state = JSON.parse(JSON.stringify(result.payload)); console.warn("getState state: ", state); let json = JSON.stringify(state, null, 2); console.warn("getState json: ", json); component.set("v.dashboardState", json); } }); }, setState: function (component, event, helper) { var json = component.get("v.dashboardState"); console.warn("setState json: ", json); var config = JSON.parse(json); var dashboard = component.find("dashboard_2"); dashboard.setState(config); console.warn("setState Done"); }, }); ``` ## Test the Custom Component 1. Create an App Page via the Lightning App Builder with the name `Dashboard State Test`. For detailed steps on creating your page, see [Create an App Home Page with the Lightning App Builder](https://help.salesforce.com/articleView?id=lightning_app_builder_create_app_page.htm&type=5) in Salesforce Help. 2. Verify that your `GetSetStateExample` component is in the Components menu, under the Custom heading. 3. Drag the `GetSetStateExample` component onto the page, and save your work. 4. Activate your page for visibility in Lightning Experience. For activation details, see [Activate Your Lightning App Page](https://help.salesforce.com/articleView?id=lightning_page_getting_into_salesforce1.htm&type=5) in Salesforce Help. 5. Load your new `Dashboard State Test` page. On the initial load, both dashboards appear identical. ![Dashboard state component with identical dashboards.](https://developer.salesforce.com/docs/media/dashboard-component/bi_dbcomp_initial_load.png) 6. Click **getState**. Notice that the first dashboard component’s state JSON loads in the Dashboard State text area. 7. Change the state of the first dashboard by making a selection or updating the filter. Now the first dashboard looks different than the second dashboard. ![Dashboard state component with different dashboards.](https://developer.salesforce.com/docs/media/dashboard-component/bi_dbcomp_state_change_1.png) 8. To retrieve the updated dashboard state, click **getState** again. 9. To pass the state of the first dashboard to the second dashboard, click **setState**. The second dashboard updates, and the dashboards are identical again. ![Dashboard state component with identical dashboard state again.](https://developer.salesforce.com/docs/media/dashboard-component/bi_dbcomp_state_change_2.png) For debugging or to see what the controller functions are doing, open the browser console. Each button click generates warning messages that are logged to the console. # Get Dashboard Metadata Get details about dashboard metadata using a GET request. Use a GET request on the [Dashboard Describe](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-describe-resource.md) resource to get metadata for the specified dashboard, including dashboard components, filters, layout, and the running user. ## Example Usage ```nolang /services/data/v37.0/analytics/dashboards/01ZR00000004SknMAE/describe ``` ## Example Response Body ```nolang { "canChangeRunningUser" : true, "components" : [ { "componentData" : 0, "footer" : null, "header" : null, "id" : "01aR00000005kCmIAI", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : true, "filterColumns" : [ { "label" : "Closed", "name" : "CLOSED" }, { "label" : "Account Type", "name" : "ACCOUNT_TYPE" }, { "label" : "Annual Revenue", "name" : "SALES" } ], "groupings" : [ { "name" : "STAGE_NAME" } ], "maxRows" : null, "sort" : { "column" : "STAGE_NAME", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "axisRange" : { "max" : null, "min" : null, "rangeType" : "auto" }, "groupByType" : "cumulative", "legendPosition" : "Bottom", "showValues" : false }, "visualizationType" : "Line" }, "reportId" : "00OR0000000JizXMAS", "title" : null, "type" : "Report" }, { "componentData" : 1, "footer" : null, "header" : null, "id" : "01aR00000005awVIAQ", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : true, "filterColumns" : [ { "label" : "Closed", "name" : "CLOSED" }, { "label" : "Account Type", "name" : "ACCOUNT_TYPE" }, { "label" : "Annual Revenue", "name" : "SALES" } ], "groupings" : [ { "name" : "STAGE_NAME" } ], "maxRows" : null, "sort" : { "column" : "STAGE_NAME", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "combineSmallGroups" : true, "legendPosition" : "Bottom", "showPercentages" : false, "showValues" : true }, "visualizationType" : "Funnel" }, "reportId" : "00OR0000000OFXeMAO", "title" : null, "type" : "Report" }, { "componentData" : 2, "footer" : null, "header" : null, "id" : "01aR00000005awTIAQ", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : true, "filterColumns" : [ { "label" : "Closed", "name" : "CLOSED" }, { "label" : "Account Type", "name" : "ACCOUNT_TYPE" }, { "label" : "Annual Revenue", "name" : "SALES" } ], "groupings" : null, "maxRows" : null, "sort" : null, "useReportChart" : false, "visualizationProperties" : { "breakPoints" : [ { "aggregateName" : "s!AMOUNT", "breaks" : [ { "color" : "c25454", "lowerBound" : 100000, "upperBound" : 300000 }, { "color" : "c2c254", "lowerBound" : 300000, "upperBound" : 800000 }, { "color" : "54c254", "lowerBound" : 800000, "upperBound" : 1000000 } ] } ], "showPercentages" : false, "showTotal" : false }, "visualizationType" : "Gauge" }, "reportId" : "00OR0000000JizXMAS", "title" : null, "type" : "Report" }, { "componentData" : 3, "footer" : null, "header" : null, "id" : "01aR00000005kCnIAI", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" }, { "name" : "a!AMOUNT" } ], "autoSelectColumns" : false, "filterColumns" : [ { "label" : "Closed", "name" : "CLOSED" }, { "label" : "Account Type", "name" : "ACCOUNT_TYPE" }, { "label" : "Annual Revenue", "name" : "SALES" } ], "groupings" : [ { "name" : "STAGE_NAME" }, { "name" : "TYPE" } ], "maxRows" : null, "sort" : { "column" : "STAGE_NAME", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "axisRange" : { "max" : null, "min" : null, "rangeType" : "auto" }, "groupByType" : "grouped", "legendPosition" : "Bottom" }, "visualizationType" : "Scatter" }, "reportId" : "00OR0000000JizXMAS", "title" : null, "type" : "Report" }, { "componentData" : 4, "footer" : null, "header" : "My Table", "id" : "01aR00000005awUIAQ", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : false, "filterColumns" : [ { "label" : "Closed", "name" : "CLOSED" }, { "label" : "Account Type", "name" : "ACCOUNT_TYPE" }, { "label" : "Annual Revenue", "name" : "SALES" } ], "groupings" : [ { "name" : "INDUSTRY" }, { "name" : "CLOSE_DATE" } ], "maxRows" : null, "sort" : { "column" : "INDUSTRY", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "breakPoints" : [ { "aggregateName" : "s!AMOUNT", "breaks" : [ { "color" : "c25454", "lowerBound" : null, "upperBound" : null }, { "color" : "c2c254", "lowerBound" : null, "upperBound" : null }, { "color" : "54c254", "lowerBound" : null, "upperBound" : null } ] } ], "tableColumns" : [ { "column" : "INDUSTRY", "isPercent" : false, "scale" : null, "showTotal" : false, "type" : "grouping" }, { "column" : "CLOSE_DATE", "isPercent" : false, "scale" : null, "showTotal" : false, "type" : "grouping" }, { "column" : "s!AMOUNT", "isPercent" : false, "scale" : null, "showTotal" : true, "type" : "aggregate" } ] }, "visualizationType" : "Table" }, "reportId" : "00OR0000000OgsOMAS", "title" : "My Table", "type" : "Report" }, { "componentData" : 5, "footer" : null, "header" : null, "id" : "01aR00000005kCoIAI", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : false, "filterColumns" : [ { "label" : "Closed", "name" : "CLOSED" }, { "label" : "Account Type", "name" : "ACCOUNT_TYPE" }, { "label" : "Annual Revenue", "name" : "SALES" } ], "groupings" : [ { "name" : "STAGE_NAME" }, { "name" : "TYPE" } ], "maxRows" : null, "sort" : { "column" : "STAGE_NAME", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "aggregateVisualizationInfos" : [ { "axis" : "Y2", "visualizationType" : "Column" } ], "axisRange" : { "max" : null, "min" : null, "rangeType" : "auto" }, "groupByType" : "grouped", "legendPosition" : "Bottom", "showValues" : false }, "visualizationType" : "Column" }, "reportId" : "00OR0000000JizXMAS", "title" : null, "type" : "Report" }, { "componentData" : 6, "footer" : null, "header" : null, "id" : "01aR00000005kCpIAI", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" }, { "name" : "a!AMOUNT" } ], "autoSelectColumns" : false, "filterColumns" : [ { "label" : "Closed", "name" : "CLOSED" }, { "label" : "Account Type", "name" : "ACCOUNT_TYPE" }, { "label" : "Annual Revenue", "name" : "SALES" } ], "groupings" : [ { "name" : "STAGE_NAME" } ], "maxRows" : null, "sort" : { "column" : "STAGE_NAME", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "axisRange" : { "max" : null, "min" : null, "rangeType" : "auto" }, "groupByType" : "none", "legendPosition" : "Bottom", "showValues" : false }, "visualizationType" : "Bar" }, "reportId" : "00OR0000000JizXMAS", "title" : null, "type" : "Report" } ], "description" : null, "developerName" : "Filtered_Dashboard", "filters" : [ { "errorMessage" : null, "id" : "0IBR00000004CElOAM", "name" : "Closed", "options" : [ { "alias" : "Open", "endValue" : null, "id" : "0ICR00000004CG4OAM", "operation" : "equals", "startValue" : null, "value" : "True" }, { "alias" : "Closed", "endValue" : null, "id" : "0ICR00000004CG5OAM", "operation" : "equals", "startValue" : null, "value" : "False" } ], "selectedOption" : null }, { "errorMessage" : null, "id" : "0IBR00000004CEmOAM", "name" : "Account Type", "options" : [ { "alias" : null, "endValue" : null, "id" : "0ICR00000004CG6OAM", "operation" : "equals", "startValue" : null, "value" : "Analyst" }, { "alias" : null, "endValue" : null, "id" : "0ICR00000004CG7OAM", "operation" : "equals", "startValue" : null, "value" : "Competitor" }, { "alias" : null, "endValue" : null, "id" : "0ICR00000004CG8OAM", "operation" : "equals", "startValue" : null, "value" : "Press,Prospect,Reseller" }, { "alias" : null, "endValue" : null, "id" : "0ICR00000004CG9OAM", "operation" : "notEqual", "startValue" : null, "value" : "Other" }, { "alias" : "Outsiders", "endValue" : null, "id" : "0ICR00000004CGAOA2", "operation" : "lessOrEqual", "startValue" : null, "value" : "Integrator,Partner,Prospect" } ], "selectedOption" : null }, { "errorMessage" : null, "id" : "0IBR0000000007cOAA", "name" : "Annual Revenue", "options" : [ { "alias" : null, "endValue" : null, "id" : "0ICR000000000A5OAI", "operation" : "lessThan", "startValue" : null, "value" : "\"400,000\"" } ], "selectedOption" : null } ], "folderId" : "00lR0000000DnRZIA0", "id" : "01ZR00000004SknMAE", "layout" : { "columns" : [ { "components" : [ 0, 1, 2 ] }, { "components" : [ 3, 4 ] }, { "components" : [ 5, 6 ] } ], "gridLayout" : false }, "name" : "Filtered Dashboard", "runningUser" : { "displayName" : "Vandelay Art", "id" : "005R0000000Hv5rIAC" } } ``` # Get Dashboard Results You can get dashboard metadata, data, and status by sending a GET request to the Dashboard Results resource. Use a GET request to the [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) resource to retrieve metadata, data, and status for a dashboard and its components. The results response contains: - Metadata: information about the dashboard as a whole, including the dashboard ID, name, component metadata, and any dashboard filters. - Data: underlying report data for each component, filtered by the optional filter parameters. For more information about filtering, see [Filter Dashboard Results](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-filter-results.md). - Status: data and refresh status for each component of the dashboard. The data status can be `NODATA`, `DATA`, or `ERROR`. If an error occurs, the component status will contain additional properties with the error code, message, and severity. The refresh status can be `IDLE`, if components are finished running, or `RUNNING`, if components are still being refreshed. ## Example Usage ```nolang /services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE ``` ## Example Response Body ```nolang { "componentData" : [ { "componentId" : "01aD0000000a36LIAQ", "reportResult" : { "attributes" : null, "allData" : true, "factMap" : { "T!T" : { "aggregates" : [ { "label" : "USD 67,043,365.50", "value" : 67043365.50166918337345123291015625 } ] }, "0!T" : { "aggregates" : [ { "label" : "USD 10,083.33", "value" : 10083.333333333333939663134515285491943359375 } ] }, "1!T" : { "aggregates" : [ { "label" : "USD 25,016,768.67", "value" : 25016768.670066006481647491455078125 } ] }, "2!T" : { "aggregates" : [ { "label" : "USD 42,016,513.50", "value" : 42016513.49826984107494354248046875 } ] } }, "groupingsAcross" : null, "groupingsDown" : { "groupings" : [ { "groupings" : [ ], "key" : "0", "label" : "-", "value" : null }, { "groupings" : [ ], "key" : "1", "label" : "Existing Business", "value" : "Existing Business" }, { "groupings" : [ ], "key" : "2", "label" : "New Business", "value" : "New Business" } ] }, "hasDetailRows" : false, "reportExtendedMetadata" : { "aggregateColumnInfo" : { "s!AMOUNT" : { "acrossGroupingContext" : null, "dataType" : "currency", "downGroupingContext" : null, "label" : "Sum of Amount" } }, "detailColumnInfo" : { }, "groupingColumnInfo" : { "TYPE" : { "dataType" : "picklist", "groupingLevel" : 0, "label" : "Type" } } }, "reportMetadata" : { "aggregates" : [ "s!AMOUNT" ], "chart" : null, "currency" : "USD", "description" : null, "detailColumns" : [ ], "developerName" : "Simple_Test", "division" : null, "folderId" : "00lR0000000M8IiIAK", "groupingsAcross" : [ ], "groupingsDown" : [ { "dateGranularity" : "None", "name" : "TYPE", "sortAggregate" : null, "sortOrder" : "Asc" } ], "hasDetailRows" : false, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OD0000001g2nWMAQ", "name" : "Simple Test", "reportBooleanFilter" : null, "reportFilters" : [ ], "reportFormat" : "SUMMARY", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "CUSTOM", "endDate" : null, "startDate" : null }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ] } }, "status" : { "dataStatus" : "DATA", "errorCode" : null, "errorMessage" : null, "errorSeverity" : null, "refreshDate" : "2014-04-09T00:28:16.000+0000", "refreshStatus" : "IDLE" } } ], "dashboardMetadata" : { "attributes" : { "dashboardId" : "01ZD00000007S89MAE", "dashboardName" : "Simple Dashboard", "statusUrl" : "/services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE/status", "type" : "Dashboard" }, "canChangeRunningUser" : false, "components" : [ { "componentData" : 0, "footer" : null, "header" : null, "id" : "01aD0000000a36LIAQ", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : false, "groupings" : null, "maxRows" : null, "sort" : { "column" : "TYPE", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "breakPoints" : [ { "aggregateName" : "s!AMOUNT", "breaks" : [ { "color" : "000000", "lowerBound" : null, "upperBound" : -1 }, { "color" : "000000", "lowerBound" : -1, "upperBound" : 0 }, { "color" : "000000", "lowerBound" : 0, "upperBound" : null } ] } ], "metricLabel" : null }, "visualizationType" : "Metric" }, "reportId" : "00OD0000001g2nWMAQ", "title" : null, "type" : "Report" } ], "description" : null, "developerName" : "Simple_Dashboard", "filters" : [ { "name" : "Amount", "options" : [ { "alias" : null, "endValue" : null, "id" : "0ICD00000004CBiOAM", "operation" : "greaterThan", "startValue" : null, "value" : "USD 2000000" } ], "selectedOption" : null } ], "folderId" : "00lR0000000DrojIAC", "id" : "01ZD00000007S89MAE", "layout" : { "columns" : [ { "components" : [ 0 ] } ] }, "name" : "Simple Dashboard", "runningUser" : { "displayName" : "Allison Wheeler", "id" : "005D00000016V2qIAE" } } } ``` **See Also** - [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) # Get Dashboard Status You can get the dashboard status by sending a GET request to the Dashboard Status resource. Use the [Dashboard Status](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-status-resource.md) resource to retrieve a status for each component of the dashboard. The components are listed in the order in which they were refreshed. The request returns `IDLE` if a component is not currently being refreshed, and `RUNNING` if a component is currently being refreshed. ## Example Usage To retrieve the status for a dashboard with an ID of 01ZD00000007QevMAE, you could make the following request: ```nolang /services/data/v31.0/analytics/dashboards/01ZD00000007QevMAE/status ``` ## Example Response Body The response contains the status for each component, along with the refresh date and time: ```nolang { "componentStatus" : [ { "componentId" : "01aD0000000J7M7", "refreshDate" : "2014-03-10T17:26:07.000+0000", "refreshStatus" : "IDLE" }, { "componentId" : "01aD0000000J7M9", "refreshDate" : "2014-03-10T17:26:08.000+0000", "refreshStatus" : "IDLE" }, { "componentId" : "01aD0000000J7MB", "refreshDate" : "2014-03-10T17:26:09.000+0000", "refreshStatus" : "IDLE" } ] } ``` **See Also** - [Dashboard Status](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-status-resource.md) # Get List of Recently Used Dashboards You can get a list of recently used dashboards by using the Dashboard resource. Use a GET request on the [Dashboard List](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-list-resource.md) resource to retrieve a list of recently used dashboards. The list is sorted by the date when the dashboard was last refreshed. ## Example Usage ```nolang /services/data/v35.0/analytics/dashboards ``` ## Example Response Body In this case, the Dashboard resource returns information for two dashboards. Each URL handle stores the status or results for the dashboard. ```nolang [ { "id" : "01ZD00000007QeuMAE", "name" : "Adoption Dashboard", "statusUrl" : "/services/data/v35.0/analytics/dashboards/01ZD00000007QeuMAE/status", "url" : "/services/data/v35.0/analytics/dashboards/01ZD00000007QeuMAE" }, { "id" : "01ZD00000007QevMAE", "name" : "Global Sales Dashboard", "statusUrl" : "/services/data/v35.0/analytics/dashboards/01ZD00000007QevMAE/status", "url" : "/services/data/v35.0/analytics/dashboards/01ZD00000007QevMAE" } ] ``` **See Also** - [Dashboard List](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-list-resource.md) # Get Report Data without Saving Changes to or Creating a Report Run a report without creating a report or changing an existing one by making a POST request to the `query` resource. Get report data without filling up your org with unnecessary reports. ## Example Get report data using the `query` resource. ```nolang /services/data/v37.0/analytics/reports/query ``` Include report criteria as `reportMetadata` in the POST request body. This POST request gets data about Opportunities: ```nolang { "reportMetadata" : { "aggregates" : [ "RowCount" ], "chart" : null, "crossFilters" : [ ], "currency" : null, "description" : null, "detailColumns" : [ "OPPORTUNITY_NAME", "TYPE", "LEAD_SOURCE", "AMOUNT", "CLOSE_DATE", "NEXT_STEP", "STAGE_NAME", "PROBABILITY", "FISCAL_QUARTER", "AGE", "CREATED_DATE", "FULL_NAME", "ROLLUP_DESCRIPTION", "ACCOUNT_NAME" ], "developerName" : "OpportunityReport", "division" : null, "folderId" : "00DD000000086ujMAA", "groupingsAcross" : [ ], "groupingsDown" : [ ], "hasDetailRows" : true, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OD0000001leVCMAY", "name" : "Matrix", "reportBooleanFilter" : null, "reportFilters" : [ ], "reportFormat" : "MATRIX", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "CUSTOM", "endDate" : null, "startDate" : null }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ] } } ``` The response to the POST request returns report data, but doesn’t create or save a report. **important:** - Use a GET request on `describeUrl` to retrieve report metadata. For details, see [Describe](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md). - Use a GET request on `instancesUrl` to list previously run report instances. Use a POST request to run the report asynchronously. For details, see [Instances](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-instances-resource.md). ```nolang { "attributes" : { "describeUrl" : "/services/data/v37.0/analytics/reports/null/describe", "instancesUrl" : "/services/data/v37.0/analytics/reports/null/instances", "reportId" : null, "reportName" : "Matrix", "type" : "Report" }, "allData" : true, "factMap" : { "T!T" : { "aggregates" : [ { "label" : "9", "value" : 9 } ], "rows" : [ { "dataCells" : [ { "label" : "salesforce.com - 5000 Widgets", "value" : "006D000000CzmqYIAR" }, { "label" : "New Business", "value" : "New Business" }, { "label" : "Advertisement", "value" : "Advertisement" }, { "label" : "$500,000.00", "value" : { "amount" : 500000, "currency" : null } }, { "label" : "9/19/2013", "value" : "2013-09-19" }, { "label" : "Closed!", "value" : "Closed!" }, { "label" : "Closed Won", "value" : "Closed Won" }, { "label" : "100%", "value" : 100 }, { "label" : "Q2-2007", "value" : "Q2-2007" }, { "label" : "0", "value" : 0 }, { "label" : "1/4/2016", "value" : "2016-01-04" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "Global Media", "value" : "001D000000KtTTqIAN" } ] }, { "dataCells" : [ { "label" : "salesforce.com - 500 Widgets", "value" : "006D000000CzmqZIAR" }, { "label" : "Existing Business", "value" : "Existing Business" }, { "label" : "Advertisement", "value" : "Advertisement" }, { "label" : "$50,000.00", "value" : { "amount" : 50000, "currency" : null } }, { "label" : "9/19/2013", "value" : "2013-09-19" }, { "label" : "Closed!", "value" : "Closed!" }, { "label" : "Closed Won", "value" : "Closed Won" }, { "label" : "100%", "value" : 100 }, { "label" : "Q2-2007", "value" : "Q2-2007" }, { "label" : "0", "value" : 0 }, { "label" : "1/4/2016", "value" : "2016-01-04" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "Global Media", "value" : "001D000000KtTTqIAN" } ] }, { "dataCells" : [ { "label" : "Acme - 1,200 Widgets", "value" : "006D000000CzmqbIAB" }, { "label" : "Existing Business", "value" : "Existing Business" }, { "label" : "Trade Show", "value" : "Trade Show" }, { "label" : "$140,000.00", "value" : { "amount" : 140000, "currency" : null } }, { "label" : "10/22/2013", "value" : "2013-10-22" }, { "label" : "Need estimate", "value" : "Need estimate" }, { "label" : "Value Proposition", "value" : "Value Proposition" }, { "label" : "50%", "value" : 50 }, { "label" : "Q2-2007", "value" : "Q2-2007" }, { "label" : "134", "value" : 134 }, { "label" : "1/4/2016", "value" : "2016-01-04" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "Acme", "value" : "001D000000KtTTrIAN" } ] }, { "dataCells" : [ { "label" : "salesforce.com - 1,000 Widgets", "value" : "006D000000CzmqeIAB" }, { "label" : "New Business", "value" : "New Business" }, { "label" : "Advertisement", "value" : "Advertisement" }, { "label" : "$100,000.00", "value" : { "amount" : 100000, "currency" : null } }, { "label" : "10/22/2013", "value" : "2013-10-22" }, { "label" : "Close the deal!", "value" : "Close the deal!" }, { "label" : "Negotiation/Review", "value" : "Negotiation/Review" }, { "label" : "90%", "value" : 90 }, { "label" : "Q2-2007", "value" : "Q2-2007" }, { "label" : "134", "value" : 134 }, { "label" : "1/4/2016", "value" : "2016-01-04" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "salesforce.com", "value" : "001D000000KtTTsIAN" } ] }, { "dataCells" : [ { "label" : "Global Media - 400 Widgets", "value" : "006D000000CzmqaIAB" }, { "label" : "New Business", "value" : "New Business" }, { "label" : "Partner", "value" : "Partner" }, { "label" : "$40,000.00", "value" : { "amount" : 40000, "currency" : null } }, { "label" : "11/20/2013", "value" : "2013-11-20" }, { "label" : "-", "value" : null }, { "label" : "Id. Decision Makers", "value" : "Id. Decision Makers" }, { "label" : "60%", "value" : 60 }, { "label" : "Q3-2007", "value" : "Q3-2007" }, { "label" : "134", "value" : 134 }, { "label" : "1/4/2016", "value" : "2016-01-04" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "Global Media", "value" : "001D000000KtTTqIAN" } ] }, { "dataCells" : [ { "label" : "Acme - 600 Widgets", "value" : "006D000000CzmqcIAB" }, { "label" : "New Business", "value" : "New Business" }, { "label" : "Trade Show", "value" : "Trade Show" }, { "label" : "$70,000.00", "value" : { "amount" : 70000, "currency" : null } }, { "label" : "12/18/2013", "value" : "2013-12-18" }, { "label" : "Need estimate", "value" : "Need estimate" }, { "label" : "Needs Analysis", "value" : "Needs Analysis" }, { "label" : "20%", "value" : 20 }, { "label" : "Q3-2007", "value" : "Q3-2007" }, { "label" : "134", "value" : 134 }, { "label" : "1/4/2016", "value" : "2016-01-04" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "Acme", "value" : "001D000000KtTTrIAN" } ] }, { "dataCells" : [ { "label" : "salesforce.com - 2,000 Widgets", "value" : "006D000000CzmqfIAB" }, { "label" : "Existing Business", "value" : "Existing Business" }, { "label" : "Partner", "value" : "Partner" }, { "label" : "$20,000.00", "value" : { "amount" : 20000, "currency" : null } }, { "label" : "12/20/2013", "value" : "2013-12-20" }, { "label" : "Meet at Widget Conference", "value" : "Meet at Widget Conference" }, { "label" : "Value Proposition", "value" : "Value Proposition" }, { "label" : "50%", "value" : 50 }, { "label" : "Q3-2007", "value" : "Q3-2007" }, { "label" : "134", "value" : 134 }, { "label" : "1/4/2016", "value" : "2016-01-04" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "salesforce.com", "value" : "001D000000KtTTsIAN" } ] }, { "dataCells" : [ { "label" : "Acme - 200 Widgets", "value" : "006D000000CzmqdIAB" }, { "label" : "Existing Business", "value" : "Existing Business" }, { "label" : "Word of mouth", "value" : "Word of mouth" }, { "label" : "$20,000.00", "value" : { "amount" : 20000, "currency" : null } }, { "label" : "2/20/2014", "value" : "2014-02-20" }, { "label" : "Need estimate", "value" : "Need estimate" }, { "label" : "Prospecting", "value" : "Prospecting" }, { "label" : "10%", "value" : 10 }, { "label" : "Q4-2007", "value" : "Q4-2007" }, { "label" : "134", "value" : 134 }, { "label" : "1/4/2016", "value" : "2016-01-04" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "Acme", "value" : "001D000000KtTTrIAN" } ] }, { "dataCells" : [ { "label" : "Fred", "value" : "006D000000Czq0uIAB" }, { "label" : "-", "value" : null }, { "label" : "-", "value" : null }, { "label" : "-", "value" : null }, { "label" : "2/26/2016", "value" : "2016-02-26" }, { "label" : "-", "value" : null }, { "label" : "Id. Decision Makers", "value" : "Id. Decision Makers" }, { "label" : "60%", "value" : 60 }, { "label" : "Q1-2016", "value" : "Q1-2016" }, { "label" : "85", "value" : 85 }, { "label" : "2/22/2016", "value" : "2016-02-22" }, { "label" : "Fred Williamson", "value" : "005D0000001bV42IAE" }, { "label" : "-", "value" : null }, { "label" : "Fred", "value" : "001D000000KtqzeIAB" } ] } ] } }, "groupingsAcross" : { "groupings" : [ ] }, "groupingsDown" : { "groupings" : [ ] }, "hasDetailRows" : true, "reportExtendedMetadata" : { "aggregateColumnInfo" : { "RowCount" : { "dataType" : "int", "label" : "Record Count" } }, "detailColumnInfo" : { "OPPORTUNITY_NAME" : { "dataType" : "string", "label" : "Opportunity Name" }, "TYPE" : { "dataType" : "picklist", "label" : "Type" }, "LEAD_SOURCE" : { "dataType" : "picklist", "label" : "Lead Source" }, "AMOUNT" : { "dataType" : "currency", "label" : "Amount" }, "CLOSE_DATE" : { "dataType" : "date", "label" : "Close Date" }, "NEXT_STEP" : { "dataType" : "string", "label" : "Next Step" }, "STAGE_NAME" : { "dataType" : "picklist", "label" : "Stage" }, "PROBABILITY" : { "dataType" : "percent", "label" : "Probability (%)" }, "FISCAL_QUARTER" : { "dataType" : "string", "label" : "Fiscal Period" }, "AGE" : { "dataType" : "int", "label" : "Age" }, "CREATED_DATE" : { "dataType" : "datetime", "label" : "Created Date" }, "FULL_NAME" : { "dataType" : "string", "label" : "Opportunity Owner" }, "ROLLUP_DESCRIPTION" : { "dataType" : "string", "label" : "Owner Role" }, "ACCOUNT_NAME" : { "dataType" : "string", "label" : "Account Name" } }, "groupingColumnInfo" : { } }, "reportMetadata" : { "aggregates" : [ "RowCount" ], "chart" : null, "crossFilters" : [ ], "currency" : null, "description" : null, "detailColumns" : [ "OPPORTUNITY_NAME", "TYPE", "LEAD_SOURCE", "AMOUNT", "CLOSE_DATE", "NEXT_STEP", "STAGE_NAME", "PROBABILITY", "FISCAL_QUARTER", "AGE", "CREATED_DATE", "FULL_NAME", "ROLLUP_DESCRIPTION", "ACCOUNT_NAME" ], "developerName" : null, "division" : null, "folderId" : "00DD000000086ujMAA", "groupingsAcross" : [ ], "groupingsDown" : [ ], "hasDetailRows" : true, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : null, "name" : "Matrix", "reportBooleanFilter" : null, "reportFilters" : [ ], "reportFormat" : "TABULAR", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "CUSTOM", "endDate" : null, "startDate" : null }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ] } } ``` # Get Report Metadata Report metadata gives information about a report and its report type. It includes information on fields used in the report for filters, groupings, detailed data, and summaries. You can use the metadata to do several things. - Find out what fields in the report type you can filter on and by what values. - Build custom chart visualizations using the metadata information on fields, groupings, detailed data, and summaries. - Change filters in the report metadata during a report run. To get report metadata, send a GET request to the Describe resource. ## Example This GET request, `/services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/describe`, to the Describe resource returns metadata for a matrix report. This includes a bucket field, groupings, summaries, and a custom summary formula. ```nolang { "reportTypeMetadata": { "categories": [ { "label": "Opportunity Information", "columns": { "CREATED": { "filterValues": [], "label": "Created By", "dataType": "string", "filterable": true }, ... "TYPE": { "filterValues": [ { "name": "Add-On Business", "label": "Add-On Business" }, { "name": "New Business", "label": "New Business" }, { "name": "Services", "label": "Services" } ], "label": "Type", "dataType": "picklist", "filterable": true }, } ... }, "reportExtendedMetadata": { "detailColumnInfo": { "OPPORTUNITY_NAME": { "label": "Opportunity Name", "dataType": "string" }, "PROBABILITY": { "label": "Probability (%)", "dataType": "percent" }, "EXP_AMOUNT": { "label": "Expected Revenue", "dataType": "currency" }, "NEXT_STEP": { "label": "Next Step", "dataType": "string" }, "BucketField_34840671": { "label": "Industry", "dataType": "string" } }, "aggregateColumnInfo": { "RowCount": { "label": "Record Count", "dataType": "int", "downGroupingContext": null, "acrossGroupingContext": null }, "FORMULA1": { "label": "formula1", "dataType": "double", "downGroupingContext": "ALL_SUMMARY_LEVELS", "acrossGroupingContext": "ALL_SUMMARY_LEVELS" }, "s!EXP_AMOUNT": { "label": "Sum of Expected Revenue", "dataType": "currency", "downGroupingContext": null, "acrossGroupingContext": null } }, "groupingColumnInfo": { "CLOSE_DATE": { "label": "Close Date", "dataType": "date", "groupingLevel": 1 }, "STAGE_NAME": { "label": "Stage", "dataType": "picklist", "groupingLevel": 0 }, "ACCOUNT_NAME": { "label": "Account Name", "dataType": "string", "groupingLevel": 0 }, "ACCOUNT_LAST_ACTIVITY": { "label": "Account: Last Activity", "dataType": "date", "groupingLevel": 1 } } }, "reportMetadata": { "name": "Stuck Opportunities", "id": "00OD0000001ZbP7MAK", "currency": null, "developerName": "StuckOpportunities", "groupingsDown": [ { "name": "ACCOUNT_NAME", "sortOrder": "Asc", "dateGranularity": "None" }, { "name": "CLOSE_DATE", "sortOrder": "Desc", "dateGranularity": "FiscalQuarter" } ], "groupingsAcross": [ { "name": "STAGE_NAME", "sortOrder": "Desc", "dateGranularity": "None" }, { "name": "ACCOUNT_LAST_ACTIVITY", "sortOrder": "Asc", "dateGranularity": "Week" } ], "reportType": { "type": "Opportunity", "label": "Opportunities" }, "aggregates": [ "s!EXP_AMOUNT", "FORMULA1", "RowCount" ], "reportFormat": "MATRIX", "reportBooleanFilter": null, "reportFilters": [ { "value": "Closed Won,Closed Lost", "column": "STAGE_NAME", "operator": "notEqual" }, { "value": "50", "column": "PROBABILITY", "operator": "greaterThan" } ], "detailColumns": [ "OPPORTUNITY_NAME", "PROBABILITY", "EXP_AMOUNT", "NEXT_STEP", "BucketField_34840671" ] } } ``` **See Also** - [Describe](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md) # Get Started with CRM Analytics Dashboard Components There are multiple versions of the CRM Analytics Dashboard component, two Lightning web components, `wave-wave-dashboard-lwc`and `wave-community-dashboard`, and the Aura component `wave:waveDashboard`. This guide provides references for all components. The Lightning web components are available in Spring ’24 and provide seamless integration into Lightning Experience and Experience Cloud pages. They don’t have the full functionality that the Aura component has. The Aura component is still supported for existing customer implementations. It provides more attributes and methods for `getState` and `setState`. **See Also** - [Lightning Web Component for Analytics Dashboards](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-overview.md) - [Aura Component for Analytics Dashboards](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-aura-overview.md) # Get Started with Dashboard Interactions With interactions you can work with different components in a dashboard. You control the interactions by binding queries to each other. There are two types of interactions: selection interaction and results interaction. The selection or results of one query triggers updates in other queries in the dashboard. Interactions are also referred to as bindings. **tip:** Before you create interactions to make widgets interactive, consider faceting. Facets are the simplest and most common way to specify interactions between widgets. When faceted, selections made in one widget automatically filter all other widgets using queries from the same dataset. Faceting is easy to set up, but it's limited. It can only filter other queries and works only on queries from the same dataset. To create interactions outside this scope, use interactions. For more information about faceting, see [Making Widgets Interactive Using Facets and Bindings](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboard_widgets_interactive.htm) in Salesforce Help. ## Overview This guide provides syntax reference for interactions along with multiple examples and use cases. - To view information about how to specify syntax for interactions, see [Interaction Syntax in the Dashboard](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-syntax-wave-designer.md). - To view examples and use cases for interactions, click any of the _Use Case_ links under the _Guides_ heading in the left menu. Interactions are created in Analytics Studio while you're editing your dashboard queries. For more information on how to edit dashboards in Analytics Studio, see [Manage Queries for Widgets](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboard_steps_create.htm) and [Create Interactions with Clicks](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboard_create_interactions_bindings.htm) in Salesforce Help. Interactions provide flexibility in creating dashboards. Dashboard widgets and steps are defined in the dashboard editor. You can overwrite these parameters with an interaction to pass in a dynamic value. Then you can use interactions to dynamically parameterize the grouping, measure, limit, filter, or order of a query, or to change the color or label in a widget. To get hands-on with interactions, check out the CRM Analytics Learning Adventure app available in Analytics Studio. The app walks you through best-practice interaction examples for building powerful, dynamic apps. For more information, see [Learn CRM Analytics with In App Examples](https://help.salesforce.com/s/articleView?id=analytics.bi_learning_adventure_app.htm). ## Selection Interaction Selection interaction is a method used to update a query based on the selection in another query. Selection interactions are evaluated each time the user selects something in a widget. For example, you have the following dashboard. ![No selection made in the dashboard.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_selection_filter_noSelection.png) A selection in the Industry Filter widget filters the results in the # of Deals by Industry chart. ![The Consumer and Fin Svcs options are selected, filtering the chart.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_selection_filter_2Selections.png) A selection interaction can be used to: - Specify interactions between widgets that use queries from different datasets. - In addition to filters, specify the measures, groupings, and other aspects of a query. - Set widget display properties for some widget types (number and chart only). **note:** Interactions on widget titles, subtitles, and dynamic ref lines are ignored when you open the widget in an explorer lens. ## Results Interaction Results interaction is a method used to update a query based on the results of another query. A results interaction is typically used to: - Define intermediate results for a complex calculation. For example, to calculate the total opportunity amount for the top-five products, use one query to calculate the top-five products. Then use those results to filter another query that calculates the total number of open cases for each product. - Set an initial filter selection for a dashboard based on a characteristic of the logged-in user, such as their country. - Dynamically change the display of a widget based on the results of a query. For example, you can configure a number widget to show different colors based on the value of the measure. (In dashboard designer only.) ## Additional Information # Get Started with Tableau Next Development As Salesforce’s end-to-end, agentic analytics experience, Tableau Next integrates the #1 analytics platform with Agentforce’s context-aware AI and the Data 360 semantic layer that unifies business knowledge across your organization. Designed to be composable and API-first, Tableau Next empowers you to create, share, and reuse analytics assets seamlessly. Build and deliver personalized, contextual, and actionable insights for every user, backed by Salesforce’s enterprise-grade performance, security, and scalability. Tableau Next is built on top of Data 360. To get familiar with Data 360 development, see the [Data 360 Developer Guide](https://developer.salesforce.com/docs/data/data-cloud-dev/guide/dc-get-started.html). ## Setup Tableau Next To get started with Tableau Next, use the [Tableau Next Setup Guide](https://help.tableau.com/current/online/en-us/tableau_next_setup_guide.htm). This is a quickstart guide to Tableau Next set up for someone with no Salesforce experience or who hasn't created a Salesforce org. If you have experience, jump to step 2 to configure Data 360 and turn on Tableau Next. ## Developer Environments - **How do I set up a scratch org for Data 360?** Information on setting up a scratch org is available in the [Workflow for Tableau Next Scratch Orgs](https://developer.salesforce.com/docs/analytics/tableau-next-isv-dev/guide/tn-scratch-org-workflow.md) topic. - **How do I set up a development environment for Data 360?** The development environment that you set up depends on whether you want to sell the app or agent you create. It also depends on whether you want to use a sandbox or scratch org environment. For more information, see [Tableau Next Development Environments](https://developer.salesforce.com/docs/analytics/tableau-next-isv-dev/guide/tn-development-environment.md). # Get Started with the App Template Framework ## Tableau Next Template Builder Create a Tableau Next workspace with insights and data assets, generate a template with the template builder to package your workspace as an app, and then deploy your app template across Salesforce orgs. For more information on using the Tableau Next template builder, see [Build App Templates from Your Tableau Next Workspace (Beta)](https://help.salesforce.com/s/articleView?id=analytics.tua_build_app_template.htm). ## Tools These are recommended developer tools for working with apps and templates. ### Salesforce CLI - Orchestrator Plugin The Salesforce CLI plugin for working with orchestrated apps, templates, assets, and services. To install, run `sf plugins install @salesforce/plugin-orchestrator@latest` For reference, see [Salesforce Orchestrator Commands](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/orchestrator_commands.md). ### Visual Studio Code While `orchestrator` commands can be run from the command line, you can also run them from the VS Code command palette. ### ATF Connect Rest API Directly access the `app-framework` Rest APIs to create and manage templates, apps, assets, chains, tasks, variables, and rules. For reference, see [App Framework Connect REST API](https://https://developer.salesforce.com/docs/analytics/app-template-framework/references/atf-ref) For information on how to set up authentication for using the APIs, see [Authentication](https://developer.salesforce.com/docs/analytics/tableau-next-rest-api/guide/authentication.html) in the Tableau Next REST API developer guide. ## Prerequisites To work with the App Template Framework, you must have these prerequisites ### Org Requirements Your org must have Data 360, Semantic Layer, and Tableau Next enabled. ### Licenses and Permission Sets Links to current licenses and user permission sets are provided. For app template framework development work, it's recommended that your user has user permission sets with admin-level permissions for each feature set. **Data 360** - [Data 360 Licenses](https://help.salesforce.com/s/articleView?id=data.c360_a_dc_editions.htm) - [Data 360 Standard Permission Set](https://help.salesforce.com/s/articleView?id=data.c360_a_userpermissions.htm) **Tableau Semantics** - [Tableau Semantics Licenses and Permissions](https://help.salesforce.com/s/articleView?id=data.c360_a_sl_licenses_and_permissions.htm) **Tableau Next** - [Tableau Next Permission Sets and Licenses](https://help.salesforce.com/s/articleView?id=analytics.tua_admin_permsets_licenses.htm) ## Architecture ![An overview of the App Template Framework architecture.](https://developer.salesforce.com/docs/media/atf/atf_architecture_diagram.png '{"class": "image-lg"}') # Get Started with the Tableau Next Embedding SDK ## Overview Tableau Next embedded analytics brings Salesforce’s interactive and analytical capabilities to your apps quickly. Tableau Next integrates with your existing technologies with Salesforce authentication and platform security, bringing insights into your flow of work and reducing context switching for your users. ![Tableau Next insights embedded in an external web app](https://developer.salesforce.com/docs/media/sdk/embedded_overview.png '{"class": "image-lg"}') Use the Tableau Next Embedding SDK to integrate Tableau Next insights into your own web apps. The SDK provides modern, secure methods of authentication so that users can interact with Tableau Next features from your web app. Tableau Next embedding provides access to the Tableau Agent, dashboard, visualization, and metrics Lightning web components, bringing Salesforce platform functionality to your web app. These components can be programmatically controlled in your web app through the use of filters and event listeners, enabling interactive functionality. **important:** Starting in July '26, you must use v2.0. The back-end Lightning Out support has upgraded and v1.0 and v1.1 are no longer supported. ## Getting Started Create your Tableau Next dashboards, visualizations, or metrics in Salesforce. To learn all about creating Tableau Next insights, refer to [Salesforce Help](https://help.salesforce.com/s/articleView?id=analytics.tua.htm&type=5). This guide covers: 1. Setting up a Salesforce External Client App (ECA) to provide authentication for the Tableau Next components in your web app and other admin tasks for users and settings. 2. Generating a Frontdoor URL for app authentication. 3. Installing the Embedding SDK. 4. Add the Embedding SDK to your web app. 5. Embedding your Tableau Next components in your web app. 6. Embedding the Tableau Agent component in your web app. 7. Multiple Salesforce orgs and logout functionality. After you embed your components, test your web app and share it with your users. **important:** The users for your web app must exist as users in your Salesforce org and have the correct permissions to view the Tableau Next insights rendered by the embedded components. ## System Requirements Users have access via a Tableau+ license or Tableau Next Creator license. - Ensure your Salesforce org has the Tableau+ or Tableau Next Creator license and that Tableau Next is enabled. - Verify the Tableau Next admin page is accessible for assigning user permissions, and creating an ECA for your authorization flow. - Identify the users that own any Tableau Next assets you want to embed and request access to those assets. - Identify the Tableau Next admin with access to configure the ECA and set up the [Content Security Policy (CSP)](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/content-security-policy-intro.html). ## AI-Assisted Onboarding The SDK package includes `SKILL.md`, an onboarding skill written for AI coding assistants. Provide this skill to your AI assistant to go from an empty org to a rendered Tableau Next embedded component in your app. The onboarding skill covers the whole integration: - **Backend (Salesforce setup)**: create the ECA, set the OAuth callback and trusted domains for iframes, generate an access token, and build the Frontdoor URL the SDK uses as `authCredential`. - **Frontend**: initialize the SDK and embed any component (dashboard, metric, visualization, or analytics agent) using Lightning Out 2.0. - **Two authentication flows**: - Interactive Authorization Code + PKCE: viewers sign in through Salesforce. - JWT Bearer: server-to-server with no login screen, for headless or back-office apps. - **Any language or framework**: the server-side token broker is specified as a language-neutral contract (endpoints and behavior), so the onboarding skill can scaffold the backend in any language and the frontend in any framework. Runnable reference implementations are included. The onboarding skill is bundled in the `npm` package. You can also read it [here](https://unpkg.com/@salesforce/analytics-embedding-sdk/SKILL.md). To use the onboarding skill, provide the file or the URL to your AI coding assistant and ask it to set up Tableau Next embedding for your stack. # getState Method Use the `getState` method to retrieve the current state of the rendered Aura component for CRM Analytics dashboards. ## Arguments | Argument Name | Description | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `config` | The configuration for the `getState` call. This value is a JSON object that sets parameters for the call. For `getState`, the `config` is `{}`. | | `callback` | The callback function to handle the `getState` payload response. See the next section for a basic `callback` example. | ## Payload | Payload attributes | Description | | ------------------ | --------------------------------------------------------------------------------------------- | | `pageId` | The current `pageId` of the dashboard. | | `state` | The dashboard state. The state contains `datasets`, `sObjects`, `sourceObjects`, and `steps`. | ## Example Add your implementation of the `getState` call into the controller.js for your Aura component. ```javascript ({ getState: function (component, event, helper) { var dashboard = component.find("myDashboard"); var config = {}; dashboard.getState(config, function (result, error) { if (error) { console.warn("getState error: ", error); } if (result) { component.set("v.dashboardState", JSON.stringify(result, null, 4)); } }); }, }); ``` In this example, the `callback` function handles success and error responses by setting component attributes with the response result. The `getState` result is passed to the component’s `dashboardState` attribute as a JSON string. The callback result contains the payload with the `pageId` and the `state` attributes. Here’s a sample callback result. ```json { "payload": { "pageId": "#xxx##xx-x###-##xx-#x##-##x##x#x##x#", "state": { "datasets": {}, "sObjects": {}, "steps": { "Step_1": { "values": [], "metadata": { "groups": ["Field1__c"] } } } } } } ``` **See Also** - [`setState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-setstatemethod.md) - [`refresh` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-refreshmethod.md) # Getting Started with Lightning Web Components Before continuing with this guide, we recommend you familiarize yourself with Lightning Web Components. There are many resources to help you get started, such as: - [Introducing Lightning Web Components](https://developer.salesforce.com/docs/component-library/documentation/en/lwc): The official Lightning Web Components Developer Guide and reference - [Build Lightning Web Components](https://trailhead.salesforce.com/en/content/learn/trails/build-lightning-web-components): A Trailhead trail with QuickStart, basics, building, testing, and using events - [Lightning Web Components - Episode 1: An Introduction](https://www.youtube.com/watch?v=FBKlTPcb614): A video series on Lightning Web Components - [Lightning Web Components Open Source](https://lwc.dev/): Documentation on the Lightning Web Components open-source UI framework When you’re comfortable with the basics and have your development environment set up, continue to the [ Hello World Component Example](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-overview.md). **note:** If you create a Lightning Web Component that uses Lightning events, the events work when your CRM Analytics dashboard is embedded in Salesforce pages, but not from Analytics Studio. Analytics Studio is a separate Lightning app. **See Also** - [Setup Instructions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-setup-instructions.md) # Getting Started with Tableau Next REST API Welcome to the Tableau Next REST API. This guide will help you get started with using our API to programmatically manage and configure Tableau Next elements. ## Overview The Tableau Next REST API allows you to programmatically: - Create and update visualizations and workspaces. - Get, update, and run subscription digests. - Download asset images and metadata. - Add and update followers for assets and collections of assets and query followed assets and followers for assets. - Get and update user access to assets. ## Set Up Tableau Next To use the Tableau Next REST APIs, ensure Tableau Next is provisioned and set up in your org. You also need a Salesforce user account with a Tableau Next Creator license and a Tableau Next Admin or Tableau Next Platform Analyst permission set. For more information on setup and licenses, see [Set Up Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_admin.htm) and [Tableau Next Permission Sets and Licenses](https://help.salesforce.com/s/articleView?id=analytics.tua_admin_permsets_licenses.htm) in Salesforce Help. ## Prerequisites Before you begin, ensure you have: - Basic understanding of REST APIs and HTTP requests - Your API credentials (see [Authentication](https://developer.salesforce.com/docs/analytics/tableau-next-rest-api/guide/authentication.md)) - A REST API client (like cURL, Postman, or your preferred programming language) ## Making Your First Request 1. First, authenticate with the API (see [Authentication](https://developer.salesforce.com/docs/analytics/tableau-next-rest-api/guide/authentication.md)) 2. Try a simple GET request to check your connection: ```bash curl -X GET https:///services/data/v64.0/tableau/visualizations \ -H "Authorization: Bearer YOUR_JWT_TOKEN" ``` ## Learn more about Connect REST APIs The Tableau Next Connect REST API is based on the Connect REST API and follows its conventions. For more information about the Connect REST API, set the [Connect Rest API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/intro_working_with_chatter_connect.htm) # grain Step Type Properties Use the `grain` step type for a values table. Values tables have no groupings, just a list of dataset fields to display as columns in the table. | Field Name | Description | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `datasets` | An array of datasets used by this step. Specify the alias of each dataset. If the `pigql` attribute references a dataset that's not specified here, the dashboard doesn't render. A `grain` step can only have one dataset. | | `isFacet` | Enables this step to facet and be faceted by other steps. Faceting is when a selection in a widget filters other steps in the dashboard. | | `isGlobal` | This applies to global filters created before Winter '18 only. Newer global filters, those created in the global filter panel widget, don't require a step. Default is false. You can apply this property only on steps that are connected to a global filter widget—all other steps ignore this property. A global filter filters other steps in the dashboard that have `useGlobal` set to `true` and reference the same dataset. | | `label` | Step label, which is primarily used for display in the dashboard designer user interface. | | `query` | The query used to retrieve results from a dataset. The query can be in compact form only. | | `type` | Step type. Set to `grain`. | | `useGlobal` | Indicates whether to apply global filters to this step (`true`) or not (`false`). | | `visualizationParameters` | Visualization details about the step. For more information, see [visualizationParameters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-visualizationparameters-properties.md). | The `query` can contain the following properties: - `filters` — The filter conditions to apply to the data. - `values` — List of dataset fields to show as table columns. - `limit` — The maximum number of results that the step can return. When you create a `grain` step, by default, Analytics sets `limit` to 100. To return more results, set the `limit` attribute accordingly. The higher you increase the limit, the longer the query takes. When a limit isn't set, CRM Analytics returns up to 10,000 results. Limit only impacts the number of records returned for display. The limit doesn't impact calculations across all records in the dataset. For instance, a query groups by Account Name and there are one million Account Names in a dataset. When the limit is 20, CRM Analytics returns 20 records for display. But the summary row provides a total for the one million records. Example `query`: ```nolang "steps": { "lens_1": { "type": "grain", "visualizationParameters": { "visualizationType": "valuestable", "options": {} }, "query": { "values": [ "Case.IsEscalated", "AccountId", "StageName", "ForecastCategory", "IsClosed", "Amount" ], "limit": 500 }, "isFacet": true, "useGlobal": true, "isGlobal": false, "label": "", "datasets": [ { "name": "ServiceOpportunity16", "url": "/services/data/v39.0/wave/datasets/0FbB00000000kOSKAY", "id": "0FbB00000000kOSKAY" } ] } }, ``` For more information SAQL queries, see the [Analytics SAQL Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_saql.meta/bi_dev_guide_saql/bi_saql_intro.htm). ## Example: grain Step ```nolang "lens_1": { "type": "grain", "visualizationParameters": { "visualizationType": "valuestable", "options": { "totals": true } }, "query": { "filters": [ [ "Amount", [[ 1000000, 7780844 ]], ">=<=" ] ], "values": [ "AccountId", "ForecastCategory", "CloseDate", "Amount", "Account.Name", "StageName" ] }, "isFacet": true, "useGlobal": true, "isGlobal": false, "label": "", "datasets": [ { "name": "ServiceOpportunity3", "url": "/services/data/v39.0/wave/datasets/0FbR0000000012uKAA", "id": "0FbR0000000012uKAA" } ] } ``` # gridLayouts JSON The `gridLayouts` section defines all layouts built for the dashboard. For more information about layouts for CRM Analytics dashboards, see [Generate Unique Dashboard Layouts for Different Devices](https://help.salesforce.com/apex/HTViewHelpDoc?id=bi_dashboard_layout_select_flex.htm). . ## Example ```nolang "gridLayouts": [ { "name": "Default", "numColumns": 9, "pages": [ { "label": "Page 1", "name": "41f040d6-48a6-4dc7-9166-eb985df7e9d8", "widgets": [ { "colspan": 9, "column": 0, "name": "filterpanel_1", "row": 0, "rowspan": 3, "widgetStyle": { "borderEdges": [] } }, { "colspan": 9, "column": 0, "name": "chart_1", "row": 3, "rowspan": 5, "widgetStyle": { "borderEdges": [] } }, { "colspan": 2, "column": 0, "name": "link_1", "row": 8, "rowspan": 1, "widgetStyle": { "borderEdges": [] } } ] }, { "label": "Page 2", "name": "ac750443-1729-47fb-8d60-a35703076bf7", "widgets": [ { "colspan": 9, "column": 0, "name": "filterpanel_1", "row": 0, "rowspan": 3, "widgetStyle": { "borderEdges": [] } }, { "colspan": 9, "column": 0, "name": "table_1", "row": 3, "rowspan": 7, "widgetStyle": { "borderEdges": [] } } ] } ], "rowHeight": "normal", "selectors": [], "style": { "alignmentX": "left", "alignmentY": "top", "backgroundColor": "#44A2F5", "cellSpacingX": 4, "cellSpacingY": 4, "fit": "original", "gutterColor": "#A3B8CC" }, "version": 1 }, { "name": "Mobile", "numColumns": 2, "pages": [ { "label": "Page 1", "name": "41f040d6-48a6-4dc7-9166-eb985df7e9d8", "widgets": [ { "colspan": 2, "column": 0, "name": "filterpanel_1", "row": 0, "rowspan": 2, "widgetStyle": { "borderEdges": [] } }, { "colspan": 2, "column": 0, "name": "chart_1", "row": 2, "rowspan": 10, "widgetStyle": { "borderEdges": [] } } ] } ], "rowHeight": "normal", "selectors": [ "maxWidth(599)" ], "style": { "alignmentX": "left", "alignmentY": "top", "backgroundColor": "#2EC2BA", "cellSpacingX": 4, "cellSpacingY": 4, "fit": "original", "gutterColor": "#091A3E" }, "version": 1 } ] ``` - **[gridLayouts Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-gridlayoutproperties.md)** The `gridLayouts` key defines all layouts for the dashboard. It contains a separate node for each layout. Each layout has properties that provide information about the devices that can use the layout and the placement of each widget in the layout. It also contains dashboard properties, like cell spacing in the grid and the dashboard's background color or image. # gridLayouts Properties The `gridLayouts` key defines all layouts for the dashboard. It contains a separate node for each layout. Each layout has properties that provide information about the devices that can use the layout and the placement of each widget in the layout. It also contains dashboard properties, like cell spacing in the grid and the dashboard's background color or image. | Property Name | Type | Details | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `name` | String | Name of the layout. Included in the Dashboard Designer's user interface. | | `maxWidth` |   | Maximum width (in pixels) that the dashboard can use. If needed, CRM Analytics rearranges the existing dashboard widgets based on this setting in the layout. | | `numColumns` | Integer | The number of columns in the designer grid for this layout. Included in the Dashboard Designer's user interface. | | `pages` | Array | Contains properties that specify the name and ID of the page, and determine the placement of each widget in the dashboard layout. Not included in the Dashboard Designer's user interface. | | `rowHeight` | String | The height of each row in the designer grid for this layout. Valid values are `fine` and `normal` (default). Included in the Dashboard Designer's user interface. | | `selectors` | Array | Device requirements that help CRM Analytics choose the optimal layout for the device accessing the dashboard. Included in the Dashboard Designer's user interface. | | `style` | Array | Properties about the designer grid, including columns, rows, cell spacing, and background. Included in the Dashboard Designer's user interface. | - **[pages Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-gridlayout-widgets-pages-properties.md)** The `pages` key contains properties that determine the placement of each widget in the dashboard layout. Currently, the Dashboard Designer supports only one page for each layout. - **[selectors Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-gridlayout-widgets-selector-properties.md)** The `selectors` key contains layout properties that specify the layout name, designer grid settings, background settings, and requirements for devices that can use this layout. - **[style Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-gridlayout-widgets-style-properties.md)** The `style` key contains the dashboard properties, like cell spacing in the grid, as well as the dashboard's background color or image. # Group by a Custom Fiscal Year Here’s how to group by a custom fiscal year. ## Example ```nolang q = load "opportunities"; q = group q by 'CreatedDate_Year_Fiscal'; q = foreach q generate 'CreatedDate_Year_Fiscal' as 'Fiscal Year', count() as 'count'; q = order q by 'CreatedDate_Year_Fiscal' asc; q = limit q 2000; ``` The query returns: | Fiscal Year | Count | | ----------- | ----- | | 2017 | 2 | | 2018 | 1 | | 2019 | 1 | | 2020 | 1 | | 2021 | 1 | | 2022 | 1 | # GROUP BY Clause The `GROUP BY` clause organizes the rows returned from a `SELECT` statement into groups. Within each group, you can apply an aggregate function, like `count()` or `sum()` to get the number of items or sum, respectively. In this example, the `SELECT` query counts the number of rows for each category and groups the counts by category. ```nolang SELECT Category, COUNT(*) AS "cnt" FROM "Superstore" GROUP BY Category; ``` | Category | cnt | | --------------- | ----- | | Furniture | 2,121 | | Office Supplies | 6,026 | | Technology | 1,847 | You can also group by multiple columns. This query generates the group of cities that contain stores in each category. The count column shows how many stores there are in each city. ```nolang SELECT Category, City, count(*) as cnt FROM "Superstore" GROUP BY Category, City ``` Here are the first ten results. | Category | City | cnt | | --------- | ------------ | --- | | Furniture | Akron | 2 | |   | Alexandria | 3 | |   | Allen | 1 | |   | Allentown | 1 | |   | Amarillo | 4 | |   | Anaheim | 8 | |   | Andover | 1 | |   | Apopka | 1 | |   | Apple Valley | 2 | **note:** Grouping by ordinal number is not supported. You can't refer to a results column or an expression created by input values by its index value. To shorten a lengthy expression in your query, use an alias. For example, this query throws an error. ```nolang SELECT Category, City, count(*) as cnt FROM "Superstore" GROUP BY 1, 2 ``` # Group By Date You can group the result of your SAQL query by `DateTime` and `DateOnly` fields. ```nolang q = group q by 'CloseDate'; ``` `CloseDate` can be `DateTime` or `DateOnly`. You can also group by date parts. For example, you can group orders by year and then month. ```nolang q = group q by year('OrderDate'), month('OrderDate'); ``` You can use the `DateTime` or `DateOnly` field to cogroup two datasets. For example, you can group two datasets by year. ```nolang a = load dataset1; b = load dataset2; c = group a by year('CloseDate'), b by year('CloseDate'); e = foreach c generate year(a.'CloseDate') as 'CloseDate A', year(b.'CloseDate') as 'Close Date B', sum(a.Amount) as 'Sum of Amount'; ``` # Group By Date Part To group by date part, use the `GROUP BY` clause and the `EXTRACT()` function. Pass `EXTRACT()` the date parts to isolate. ```nolang SELECT EXTRACT(YEAR FROM CloseDate) AS CloseDate_Year, EXTRACT(MONTH FROM CloseDate) AS CloseDate_Month, count(*) AS cnt FROM "OpportunityFiscalEMTimezoned" GROUP BY EXTRACT(YEAR FROM CloseDate), EXTRACT(MONTH FROM CloseDate) LIMIT 10; ``` The results are grouped by year and month parts of the CloseDate field. | CloseDate_Year | CloseDate_Month | cnt | | -------------- | --------------- | --- | | 2014 | 12 | 1 | | 2015 | 1 | 3 | | 2015 | 2 | 1 | | 2015 | 3 | 2 | | 2015 | 4 | 2 | | 2015 | 5 | 2 | | 2015 | 6 | 1 | | 2015 | 8 | 1 | | 2015 | 10 | 1 | | 2015 | 11 | 1 | # GROUP BY ROLLUP `ROLLUP` is a sub-clause of `GROUP BY` that creates and displays aggregations of column data. The results output of `ROLLUP` is based on column order in your query. `ROLLUP` supports the following aggregate functions. - Average - Count - Min - Max - Sum This example first groups the results by category and sub-category, and runs `Sum(Profit)`, an aggregate function on each resulting row. By modifying the`GROUP BY` clause with `ROLLUP`, the query "rolls up" the results into subtotals and grand totals. ```nolang SELECT Category, Sub_Category, Sum(Profit) as TotalProfit FROM "Superstore" GROUP BY ROLLUP(Category, Sub_Category); ``` Notice how `GROUP BY ROLLUP (Category, Sub_Category)` creates groups for each column combination: ```nolang Category, Sub-Category Category () — null ``` The query first groups the total profit for each subcategory of a given category. Next, it groups is the total profit for a single category. Once each category's total profit is accounted for, the query generates the total profit for all categories. | Category | Sub-Category | TotalProfit | | --------------- | ------------ | ----------- | | Furniture | Bookcases | -3,472.56 | |   | Chairs | 25,590.17 | |   | Furnishings | 13,059.14 | |   | Tables | -17,725.48 | |   | - | 18,451.27 | | Office Supplies | Appliances | 18,138.01 | |   | Art | 6,527.79 | |   | Binders | 30,221.76 | |   | Envelopes | 6,964.18 | |   | Fasteners | 949.52 | |   | Labels | 5,546.25 | |   | Paper | 34,053.57 | |   | Storage | 21,278.83 | |   | Supplies | -1,189.1 | |   | - | 122,490.8 | You can also group by multiple columns. This query generates the group of cities that contain stores in each category. The count column shows how many stores there are in each city. ```nolang SELECT Category, City, count(*) as cnt FROM "Superstore" GROUP BY Category, City ``` Here are the first ten results. | Category | City | cnt | | --------- | ------------ | --- | | Furniture | Akron | 2 | |   | Alexandria | 3 | |   | Allen | 1 | |   | Allentown | 1 | |   | Amarillo | 4 | |   | Anaheim | 8 | |   | Andover | 1 | |   | Apopka | 1 | |   | Apple Valley | 2 | # Group Interactions Bind the grouping to allow the dashboard viewer to select which dimensions to group the results by. For example, you can show different groupings in a chart based on the selection in a toggle widget. To dynamically set the grouping in a query based on a selection, bind the `groups` property in the query. If the query is used for a chart, also bind the corresponding widget property under `columnMap` to identify the chart attribute by the selected grouping. Some charts accept multiple groupings and use them differently. For example, the stacked bar chart can have two groupings, one for the vertical axis and one used to segment the bars. The `columnMap` widget-level property has subproperties that specify which grouping to use for each of these chart attributes. To dynamically set the grouping in a query based on a selection, complete these tasks. - Bind the `groups` property of the query. - If the query is used for a chart, replace the `columnMap` section of the widget with an empty `columns` array. Why? Because when you change the query, the set of fields can be different from what’s in the `columnMap` section. When you replace the `columnMap` property with an empty `columns` array, the system remaps the columns based on the new query definition. For example, let’s bind the grouping for this donut chart based on the selection in the toggle widget. ![The toggle widgets allow you to choose a measure to display in the map chart.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_grouping_binding_flex.png) **note:** Dashboard selections automatically reset each time you change your query grouping. For example, if you drill into Air Up and then switch your grouping to Country, the donut chart resets and Air Up is no longer selected. The toggle widget uses this custom query. ```json "GroupingsController_1": { "type": "staticflex", "values": [ { "display": "Country", "value": "Country" }, { "display": "Product", "value": "Product" }, { "display": "Rep Name", "value": "Referral" } ], "start": { "display": [ "Product" ] }, "broadcastFacet": true, "groups": [], "label": "GroupingsController", "numbers": [], "selectMode": "singlerequired", "strings": [] } ``` Each toggle option has one display label (`display`) that appears in the toggle. It also has one value (`value`) that determines the grouping. Let’s bind the `value` field of the custom query (`GroupingsController_1`) to the grouping in the donut chart’s query (`PieByProduct_2`). Any selection in the custom query passes the grouping to the `PieByProduct_2` query. ```json "PieByProduct_2": { "label": "PieByProduct", "query": { "measures": [[ "sum", "Amount" ]], "groups": [ "{{ cell(GroupingsController_1.selection, 0, \\"value\\").asString() }}" ] }, "broadcastFacet": true, "isGlobal": false, "receiveFacet": true, "selectMode": "single", "type": "aggregateflex", "useGlobal": true, "visualizationParameters": { "type": "chart", "parameters": { ... }, "options": {} }, "datasets": [ { "id": "0FbB00000000q5gKAA", "label": "Flexy Sales", "name": "Flexy_Sales", "url": "/services/data/v42.0/wave/datasets/0FbB00000000q5gKAA" } ] } ``` When you create the donut chart, by default, the widget (`chart_3`) contains the `columnMap` section that maps measures and groupings to chart attributes. ```json "chart_3": { "type": "chart", "parameters": { "visualizationType": "pie", "step": "PieByProduct_2", "theme": "wave", "columnMap": { "trellis": [], "dimension": [ "{{ cell(GroupingsController_1.selection, 0, \\"value\\").asString() }}" ], "plots": [ "sum_Amount" ] }, ... } } ``` **note:** The properties under the `columnMap` property vary based on the chart type. For the interaction to work correctly, replace the `columnMap` section with an empty `columns` array. ```json "chart_3": { "type": "chart", "parameters": { "visualizationType": "pie", "step": "PieByProduct_2", "theme": "wave", "columns" : [], ... } } ``` # group-by Organizes the rows returned from a query into groups. Within each group, you can apply an aggregate function, such as `count()` or `sum()` to get the number of items or sum, respectively. ## Syntax `group-by` takes this syntax. ```nolang group data_stream by fields; ``` | Parameter | Description | | ------------- | -------------------------------- | | _data_stream_ | Data input to group. | | _fields_ | Fields by which data is grouped. | ## Group-by One Field In this example, the query counts the number of rows for each `Category` field and groups the counts by category. ```nolang q = load "Superstore"; q = group q by 'Category'; q = foreach q generate 'Category' as 'Category', count() as 'count'; q = limit q 2000; ``` | Category | Count of Rows | | --------------- | ------------- | | Furniture | 2,121 | | Office Supplies | 6,026 | | Technology | 1,847 | **note:** `cogroup` and `group-by` are interchangeable. For clarity, we use `group-by` for statements that involve one data stream and `cogroup` for statements that involve two or more data streams. ## Group-by with Null Values To return grouped null values in your queries, you must select the preference to include null values in Setup. Otherwise, queries ignore null values. 1. In Setup, enter `Analytics` in the Quick Find box. 2. Select **Settings** from the list of Analytics options. 3. In **Settings**, click the checkbox for **Include null values in Analytics queries**. ![Null handling preference in Setup](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_null_handling.png) Here’s an example of a query that returns null values. It orders the results by the `Sub_Category` field and specifies that the results display in ascending order, with nulls first. ```nolang q = load "Superstore"; q = group q by 'Sub_Category'; q = foreach q generate 'Sub_Category' as 'Sub_Category', count() as 'count'; q = order q by 'Sub_Category' asc nulls first; q = limit q 2000; ``` | Sub-Category | Count of Rows | | ------------ | ------------- | | - | 4 | | Accessories | 775 | | Appliances | 466 | | Art | 796 | | Binders | 1,523 | | Bookcases | 228 | | Chairs | 617 | | Copiers | 68 | | Envelopes | 254 | | Fasteners | 217 | | Furnishings | 957 | | Labels | 364 | | Machines | 115 | | Paper | 1,370 | | Phones | 889 | | Storage | 846 | | Supplies | 190 | | Tables | 319 | ## Group-by all In this example, the query counts all of the rows and returns the number of different industries that you have opportunities with. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by all; q = foreach q generate unique('Industry') as 'unique_Industry'; ``` | # | Unique of Industry | | --- | ------------------ | | 1 | 20 | **See Also** - [Aggregate Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-aggregate.md) - [Null Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-null.md) - [cogroup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-cogroup.md) - [Use Group and Filter Pre-projection](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-group-filter.md) # group-by rollup `rollup` is a subclause of `group-by` that creates and displays aggregations of grouped data. The output of `rollup` is based on column order in your query. ## Syntax `group-by rollup` takes this syntax. ```nolang group data_stream by rollup(fields); ``` | Parameter | Description | | ------------- | -------------------------------- | | _data_stream_ | Data input to group. | | _fields_ | Fields by which data is grouped. | **note:** `rollup` works with `group-by` only. You cannot use it with `cogroup`. `rollup` supports the following aggregate functions. - `average()` - `count()` - `min()` - `max()` - `sum()` - `unique()` This example first groups the results by `Category` and `Sub-Category`, and runs `sum('Sales')`, an aggregate function on each resulting row. By modifying the `group-by` clause with `rollup`, the query "rolls up" the results into subtotals and a grand total. ```nolang q = load "Superstore"; q = group q by rollup('Category', 'Sub_Category'); q = order q by ('Category'); q = foreach q generate 'Category' as 'Category', 'Sub_Category' as 'Sub_Category', sum('Sales') as 'sum_sales'; ``` | Category | Sub-Category | sum_sales | | --------------- | ------------ | --------- | | Furniture | Bookcases | 114,348 | |   | Chairs | 328,237 | |   | Furnishings | 91,514 | |   | Tables | 206,966 | |   | - | 741,064 | | Office Supplies | Appliances | 107,532 | |   | Art | 27,119 | |   | Binders | 203,413 | |   | Envelopes | 16,363 | |   | Fasteners | 3,024 | |   | Labels | 12,486 | |   | Paper | 78,479 | |   | Storage | 223,844 | |   | Supplies | 46,674 | |   | - | 718,934 | | Technology | Accessories | 167,380 | |   | Copiers | 149,528 | |   | Machines | 189,239 | |   | Phones | 329,636 | |   | - | 835,783 | |   | - | 2,295,781 | The query first groups the total sales for each sub-category of a given category. Next, it groups the total sales for a single category. After each category's total sales is accounted for, the query generates the total sales for all categories. ## rollup with Null Values To return grouped null values in your queries, you must select the null handling for dimensions preference in Setup. See `group-by` for more information. This example shows how null values display in query results. The query is the same as the one in the first example. ```nolang q = load "Superstore"; q = group q by rollup('Category', 'Sub_Category'); q = foreach q generate 'Category' as 'Category', 'Sub_Category' as 'Sub_Category', sum('Sales') as 'sum_sales'; q = order q by ('Category', 'Sub_Category'); ``` | Category | Sub-Category | sum_sales | | --------------- | ------------ | --------- | | Furniture | Bookcases | 114,348 | |   | Chairs | 328,237 | |   | Furnishings | 91,514 | |   | Tables | 206,966 | |   | - | 92 | |   | - | 741,156 | | Office Supplies | Appliances | 107,532 | |   | Art | 27,119 | |   | Binders | 203,413 | |   | Envelopes | 16,363 | |   | Fasteners | 3,024 | |   | Labels | 12,486 | |   | Paper | 78,479 | |   | Storage | 223,844 | |   | Supplies | 46,674 | |   | - | 273 | |   | - | 719,206 | | Technology | Accessories | 167,380 | |   | Copiers | 149,528 | |   | Machines | 189,239 | |   | Phones | 329,636 | |   | - | 259 | |   | - | 836,041 | | - | Computers | 113 | |   | Projectors | 744 | |   | - | 562 | |   |   | 1,420 | |   |   | 2,297,824 | The query first groups the total sales for each sub-category of a given category. In this example, each category contains a null sub-category. The value of the null sub-category is also included in the total sales for each sub-category. After the query accounts for all of the named categories—categories that have a value—it displays the sub-categories and total sales for null categories. Finally, the query generates the total sales for all categories. ## rollup with Null Values and case Statements Use the `grouping` function and `case` statements together to label the subtotal and grand total categories. In this example, the first case checks for a null value generated by the rollup in the `Category` field. If true, then the query labels the field `All Categories`. The second case checks whether a `Sub-Category` field is similarly null. If true, then the query labels the field `All Sub-Categories`. ```nolang q = load "Superstore"; q = group q by rollup ('Category', 'Sub_Category'); q = foreach q generate (case when grouping('Category') == 1 then "All Categories" else 'Category' end) as 'Category', (case when grouping('Sub_Category') == 1 then "All Sub-Categories" else 'Sub_Category' end) as 'SubCategory', sum('Sales') as 'sum_sales'; ``` | Category | Sub-Category | sum_sales | | --------------- | ------------------ | --------- | | Furniture | Bookcases | 114,348 | |   | Chairs | 328,237 | |   | Furnishings | 91,514 | |   | Tables | 206,966 | |   | - | 92 | |   | All Sub-Categories | 741,156 | | Office Supplies | Appliances | 107,532 | |   | Art | 27,119 | |   | Binders | 203,413 | |   | Envelopes | 16,363 | |   | Fasteners | 3,024 | |   | Labels | 12,486 | |   | Paper | 78,479 | |   | Storage | 223,844 | |   | Supplies | 46,674 | |   | - | 273 | |   | All Sub-Categories | 719,206 | | Technology | Accessories | 167,380 | |   | Copiers | 149,528 | |   | Machines | 189,239 | |   | Phones | 329,636 | |   | - | 259 | |   | All Sub-Categories | 836,041 | | - | Computers | 113 | |   | Projectors | 744 | |   | - | 562 | |   | All Sub-Categories | 1,420 | | All Categories | All Sub-Categories | 2,297,824 | **See Also** - [Null Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-null.md) - [Simple case Operator](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-case.md) - [Aggregate Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-aggregate.md) - [grouping()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-fn-agg-grouping.md) # grouping() Returns 1 if null dimension values are due to higher-level aggregates (which usually means the row is a subtotal or grand total), otherwise returns 0. The `grouping()` function is most useful when paired with the `rollup` modifier on the `group` statement. Invoking `grouping()` lets work with subtotaled data. ## Example - Label Subtotaled Data Suppose that you have a dataset of opportunity information with amounts totaled by lead source and type. Calculate totals with `rollup`. Then use `grouping()` with a `case` statement to check whether a row is a total and if it is then label it as "all" values. ```nolang q = load "opportunityData"; --Modify the group statement with rollup to calculate subtotals of grouped measures q = group q by rollup('Type', 'LeadSource'); q = order q by ('Type', 'LeadSource'); --Determine which rows are totals with grouping(), which returns 1 if a row is a total q = foreach q generate (case when grouping('Type') == 1 then "All Types" else 'Type' end) as 'Type', (case when grouping('LeadSource') == 1 then "All Lead Sources" else 'LeadSource' end) as 'LeadSource', sum('Amount') as 'sum_Amount'; ``` ![Total rows labeled with grouping()](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_rollup_grouping_example.png) # GROUPING() Use the `GROUPING()` clause with `ROLLUP` to determine whether null values are the result of a `ROLLUP` operation or part of your dataset. `GROUPING()` returns 1 if the null value is a subtotal generated by a rollup. It returns 0 otherwise. This example uses the `GROUPING()` function and `CASE` statements together to label the subtotal and grand total categories. The first case checks for a null value generated by the rollup in the `Category` field. If true, then the query labels the field "All Categories." Similarly, the second case checks whether a `Sub-Category` field is null. If true, the query labels the field "All Sub-Categories." ```nolang SELECT (CASE WHEN GROUPING("Category") = 1 THEN 'All Categories' ELSE "Category" END) as "Category", (CASE WHEN GROUPING("Sub_Category") = 1 THEN 'All Sub-Categories' ELSE "Sub_Category" END) as "SubCategory", SUM("Sales") as "sum_sales" FROM "Superstore" GROUP BY ROLLUP("Category", "Sub_Category"); ``` | Category | Sub-Category | sum_sales | | --------------- | ------------------ | ------------ | | Furniture | Bookcases | 114,880 | |   | Chairs | 328,449.1 | |   | Furnishings | 91,705.16 | |   | Tables | 206,965.53 | |   | All Sub-Categories | 741,999.8 | | Office Supplies | Appliances | 107,532.16 | |   | Art | 27,118.73 | |   | Binders | 203,412.73 | |   | Envelopes | 16,476.4 | |   | Fasteners | 3,024.28 | |   | Labels | 12,486.31 | |   | Paper | 78,479.21 | |   | Storage | 223,843.61 | |   | Supplies | 46,673.544 | |   | All Sub-Categories | 719,047.03 | | Technology | Accessories | 167,380.32 | |   | Copiers | 149,528.03 | |   | Machines | 189,238.63 | |   | Phones | 330,007.05 | |   | All Sub-Categories | 838,154.03 | | All Categories | All Sub-Categories | 2,297,200.86 | # Handle Null Dates Use `is not null` to filter out null dates. ```nolang q = filter q by 'CloseDate' is not null; q = foreach q generate 'CloseDate'; ``` Projecting null values does not cause an error. For example, this Date Closed field is empty, but no error occurs. ```nolang q = filter q by year('CloseDate') is null; q = foreach q generate year('CloseDate') as "Date Closed"; ``` # HAVING Clause Use the `HAVING` clause to filter grouped results from grouped columns, aggregate functions, or grouping functions. `HAVING` follows this syntax: `HAVING {search-condition}`. A search condition can contain boolean expressions, comparison operators, and scalar functions. ## Grouped Columns This query returns groups of cities that contain furniture stores and their counts. The `HAVING` clause filters for the `Furniture` category. ```nolang SELECT Category, City, count(*) as "cnt" FROM "Superstore" GROUP BY Category, City HAVING Category = 'Furniture' LIMIT 10 ``` | Category | City | cnt | | --------- | ------------ | --- | | Furniture | Akron | 2 | |   | Alexandria | 3 | |   | Allen | 1 | |   | Allentown | 1 | |   | Amarillo | 4 | |   | Anaheim | 8 | |   | Andover | 1 | |   | Apopka | 1 | |   | Apple Valley | 2 | |   | Arlington | 13 | You can also write this query using `WHERE`. ```nolang SELECT Category, City, count(*) as "cnt" FROM "Superstore" WHERE Category = 'Furniture' GROUP BY Category, City LIMIT 10 ``` In the logical execution of a `SELECT` statement, `WHERE` filters out rows before any grouping or aggregate function runs. In this example, it selects the rows that can be passed to the aggregate function `count()`. The `WHERE` clause comes before a `GROUP BY` statement. With `HAVING`, the filtering occurs after all of the rows have been passed to `count()`. `HAVING` always comes after a `GROUP BY` statement. Both `HAVING` and `WHERE` run before projection. ## Aggregate Functions This query returns groups of cities that have more than 150 stores in each category. The `HAVING` clause filters out values greater than 150 in the aggregate column, `cnt`. ```nolang SELECT Category, City, count(*) as cnt FROM "Superstore" GROUP BY Category, City HAVING count(*) > 150 ``` | Category | City | cnt | | --------------- | ------------- | --- | | Furniture | Los Angeles | 154 | |   | New York City | 192 | | Office Supplies | Houston | 231 | |   | Los Angeles | 443 | |   | New York City | 552 | |   | Philadelphia | 312 | |   | San Francisco | 322 | |   | Seattle | 249 | | Technology | New York City | 171 | Using `HAVING` with an aggregate function automatically implies `GROUP BY()`. These two queries return the same result. ```nolang SELECT Sum(Profit) as TotalProfit FROM "Superstore" HAVING Sum(Profit) > 0 ``` ```nolang SELECT Sum(Profit) as TotalProfit FROM "Superstore" GROUP BY () HAVING Sum(Profit) > 0 ``` | TotalProfit | | ----------- | | 286,397.02 | ## GROUP BY ROLLUP Here’s a simple example of how to use `HAVING` with `GROUP BY ROLLUP`. The query returns the profit for each `Sub-Category`, rolls them up into subtotals of each `Category`, and then sums up the grand total. Here, `HAVING` filters on positive profits. ```nolang SELECT Category, Sub_Category, Sum(Profit) as TotalProfit FROM "Superstore" GROUP BY ROLLUP(Category, Sub_Category) HAVING Sum(Profit) > 0; ``` | Category | Sub-Category | TotalProfit | | --------------- | ------------ | ----------- | | Furniture | Chairs | 26,590.17 | |   | Furnishings | 13,059.14 | |   | - | 18,451.27 | | Office Supplies | Appliances | 18,138.01 | |   | Art | 6,527.79 | |   | Binders | 30,221.76 | |   | Envelopes | 6,964.18 | |   | Fasteners | 949.52 | |   | Labels | 5,546.25 | |   | Paper | 34,053.57 | |   | Storage | 21,278.83 | |   | - | 122,490.8 | | Technology | Accessories | 41,936.64 | |   | Copiers | 55,617.82 | |   | Machines | 3,384.76 | |   | Phones | 44,515.73 | |   | - | 145,454.95 | |   | - | 286,397.02 | ## GROUP BY ROLLUP with GROUPING() In SQL for CRM Analytics, you can use `HAVING()` with the `GROUP BY ROLLUP` subclause and the `GROUPING()` function. You can use `GROUPING()` with `ROLLUP` only; you can't use it on its own. This example uses the `GROUPING()` function with the `HAVING()` function to filter for the subtotals of each category and return the grand total. The `GROUPING()` function returns 1 for null values that are the result of a `ROLLUP`, and not null values in your dataset. Here, by setting `GROUPING(Sub_Category) = 1`, we know that these `Sub-Category` values refer to the subtotals of each category. ```nolang SELECT Category, Sub_Category, Sum(Profit) as TotalProfit FROM "Superstore" GROUP BY ROLLUP(Category, Sub_Category) HAVING GROUPING(Sub_Category) = 1 ``` | Category | Sub-Category | TotalProfit | | --------------- | ------------ | ----------- | | Furniture | - | 18,451.27 | | Office Supplies | - | 122,490.8 | | Technology | - | 145,454.95 | | - | - | 286,397.02 | # Hello World Component Example Create a simple Lightning Web Component widget to display Hello World in your dashboard. - **[Component Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-attributes.md)** You can convert any Lightning Web Component into a CRM Analytics Lightning Web Component by adding specific attributes. - **[CRM Analytics Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-config.md)** Now that the Lightning Web Component code is ready to go, it’s time to bring the component into a CRM Analytics dashboard. - **[Lightning Dashboards Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-lightning-dashboard-config.md)** Lightning dashboards provide a flexible way to visualize your data. By default, dashboards include standard components such as charts, tables, and gauges. However, you can extend their capabilities by adding custom Lightning Web Components (LWC). - **[Query Data](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-query-data.md)** Let’s learn how to inject query results into your running Lightning Web Component code. - **[Other Widgets](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-other.md)** The Hello World example is a simplified scenario. The most common real world use cases are a custom data visualization, a selection widget, or even better, a widget that does both. With practice, you can add anything you want. To see a list, a third-party data visualization integration, a hierarchy, and more widgets, check out the example GitHub repository. # Help for Salesforce CLI Commands The `-h` | `--help` parameter shows details about Salesforce CLI topics and their commands. For namespaces, the `-h` | `--help` parameter lists all topics in the namespace. For example, to see names and descriptions of all topics in the `force` namespace, run `sfdx force -h`. For topics, the `-h` | `--help` parameter lists the commands and their descriptions. For example, to see all commands in the `org` topic, run `sfdx force:org -h`. For commands, adding the `-h` | `--help` parameter shows parameters and usage information. For example, to see help for the `org:create` command, run `sfdx force:org:create -h`. Help for commands has four parts. 1. **Short Description of Command** At the top of the `--help` output (with no heading), a short description of the command is shown. For longer descriptions, see the *Salesforce CLI Command Reference*. 2. **Usage** The command signature on the Usage line uses the docopt format. - All available parameters are listed. Parameters that have short names are listed using their short names. - Parameters that take a value show the value’s type (for example, ``) in angle brackets immediately after the parameter’s name. - Optional parameters are in square brackets (`[ … ]`). - Required parameters have no annotation. - For parameters that accept a limited set of values, the values are shown after the parameter name, separated by pipes (`--parametername value1|value2|value3`). - Mutually exclusive options are shown in parentheses, separated by a pipe (`( … | … )`). If the command takes varargs (name-value pairs that aren’t parameters), the usage signature includes `name=value...`. **tip:** To see all Salesforce CLI commands, run `sfdx commands`. 3. **Options** The Options section lists all the command’s parameters, including their short name, long name, and purpose. For parameters that accept a value, the value name is written after an equals sign (`=`). The equals sign is optional when you run the command—for example, you could run `sfdx force:org:create -f=config/enterprise-scratch-def.json -a TestOrg1` or `sfdx force:org:create -f config/enterprise-scratch-def.json -a TestOrg1` with the same results. Parameters that accept a limited list of values include the values in parentheses, with the default value indicated by an asterisk (`*`). For more information about the parameters, see the *Salesforce CLI Command Reference*. 4. **Description** Usage notes and examples are below the list of parameters, in the Description section. This information is also available in the *Salesforce CLI Command Reference*. # Hide and Unhide Report Types Update hidden state of report types (`PATCH`). ## Syntax **URI:** `/services/data//analytics/reports/show-hide-report_type` **Formats:** JSON **HTTP Methods** |Method|Description| |------|-----------| |`PATCH`|Sets the `hidden` parameter to `true` or `false` for a specific report type.| **Parameters** |Parameter|Description| |---------|-----------| |`templateId`|Required for `PATCH` calls. Specifies report type API name.| |`hidden`|Required for `PATCH` calls. Specifies if report type is hidden (`true`) or not (`false`).| ## Example **Sample Request Body** Hide a report type ```nolang { "templateId" : , "hidden" : "true" } ``` Show a report type ```nolang { "templateId" : , "hidden" : "false" } ``` # Hide Dataset Fields from Lens and Dashboard By default, all dataset fields are available in the UI. But you can hide fields so that users can’t select them when building queries and dashboards. **note:** Although hidden fields aren’t available in the interface, users can still manually add them in dashboard JSON and SAQL queries. Users can also access the fields with the CRM Analytics REST API. For example, the Opportunity.StageName field appears in the explorer. ![When creating a grouping in explorer, you can see the Opportunity.StageName dataset field.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_field_show_true.png) To hide the field, modify the XMD as shown in the following text. ```nolang "dimensions": [{ "field": "Opportunity.StageName", "showInExplorer": false }], ``` **note:** To show the field, set **showInExplorer** to **true**. After applying the change, the field is no longer available for selection. ![The Opportunity.StageName dataset field is no longer available.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_field_show_false.png) **See Also** - [Dimensions and Derived Dimensions in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-dimensions.md) - [Measures and Derived Measures in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-measures.md) # Highlight Widget Values with Color Coding You can highlight content in a widget based on selections or results in other queries. For example, color code the values of number widgets based on thresholds to draw attention to low and high numbers. Let’s say you want to change the colors of measures in three number widgets based on whether the numbers are high (green), medium (yellow), or low (red). ![The number widgets show green, yellow, and red measures.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_conditional_format_number_widget.png) In the dashboard JSON, compute the color based on the measure of each query with a `case` statement. Then apply the computed color to the `numberColor` field of each number widget. ```json { "label": "Sales Overview", "state": { "gridLayouts": [...], "layouts": [], "steps": { "color_1": { "type": "aggregateflex", "visualizationParameters": { "options": {} }, "query": { "pigql": "q = load \"Opportunity_Dataset\";\n q = filter q by 'Region' == \"US\";\n q = group q by all;\n q = foreach q generate count() as 'count', (case when count() \< 25000 then \\"#EE0A50\\" when count() \< 50000 then \\"#F8CE00\\" else \\"#0FD178\\" end) as 'color';\\n q = limit q 2000;", "measures": [ [ "count", "*", "count" ] ], "groups": [ "color" ], "measuresMap": {} }, "isFacet": true, "useGlobal": true, "isGlobal": false, "datasets": [{ "name": "Opportunity_Dataset", "url": "/services/data/v38.0/wave/datasets/0Fbx000000000KLCAY", "id": "0Fbx000000000KLCAY" }] }, "color_2": { "type": "aggregateflex", "visualizationParameters": { "options": {} }, "query": { "pigql": "q = load \"Opportunity_Dataset\";\n q = filter q by 'Region' == \"AP\";\n q = group q by all;\n q = foreach q generate count() as 'count', (case when count() \< 25000 then \\"#EE0A50\\" when count() \< 50000 then \\"#F8CE00\\" else \\"#0FD178\\" end) as 'color';\\n q = limit q 2000;", "measures": [ [ "count", "*", "count" ] ], "groups": [ "color" ], "measuresMap": {} }, "isFacet": true, "useGlobal": true, "isGlobal": false, "datasets": [{ "name": "Opportunity_Dataset", "url": "/services/data/v38.0/wave/datasets/0Fbx000000000KLCAY", "id": "0Fbx000000000KLCAY" }] }, "color_3": { "type": "aggregateflex", "visualizationParameters": { "options": {} }, "query": { "pigql": "q = load \"Opportunity_Dataset\";\n q = filter q by 'Region' == \"EU\";\n q = group q by all;\n q = foreach q generate count() as 'count', (case when count() \< 25000 then \\"#EE0A50\\" when count() \< 50000 then \\"#F8CE00\\" else \\"#0FD178\\" end) as 'color';\\n q = limit q 2000;", "measures": [ [ "count", "*", "count" ] ], "groups": [ "color" ], "measuresMap": {} }, "isFacet": true, "useGlobal": true, "isGlobal": false, "datasets": [{ "name": "Opportunity_Dataset", "url": "/services/data/v38.0/wave/datasets/0Fbx000000000KLCAY", "id": "0Fbx000000000KLCAY" }] } }, "widgetStyle": {...}, "widgets": { "number_5": { "type": "number", "parameters": { "step": "color_1", "measureField": "count", "textAlignment": "right", "compact": false, "exploreLink": true, "titleColor": "#335779", "titleSize": 14, "numberColor": "{{cell(color_1.result, 0, \\"color\\").asString()}}", "numberSize": 32, "title": "Opp Count (United States)" } }, "number_6": { "type": "number", "parameters": { "step": "color_2", "measureField": "count", "textAlignment": "right", "compact": false, "exploreLink": true, "titleColor": "#335779", "titleSize": 14, "numberColor": "{{cell(color_2.result, 0, \\"color\\").asString()}}", "numberSize": 32, "title": "Opp Count (Asia Pacific)" } }, "number_7": { "type": "number", "parameters": { "step": "color_3", "measureField": "count", "textAlignment": "right", "compact": false, "exploreLink": true, "titleColor": "#335779", "titleSize": 14, "numberColor": "{{cell(color_3.result, 0, \\"color\\").asString()}}", "numberSize": 32, "title": "Opp Count (Europe)" } } } }, "datasets": [...] } ``` # Identifiers SAQL identifiers are case-sensitive and must be enclosed in single quotation marks ('). Identifiers that are enclosed in quotation marks can contain any character that a string can contain. This example uses valid syntax: ```nolang q = load "Opportunity"; --'Stage' is enclosed in single quotes because it is a field. "08 - Closed Won" is enclosed in double quotes because it is a string. q = filter q by 'Stage' == "08 - Closed Won"; q = group q by 'Account_Owner'; q = foreach q generate 'Account_Owner' as 'Account_Owner', count() as 'count'; ``` This example is **not** valid because you can't use double quotes for an identifier. ```nolang --this should be 'Account_Owner' in single quotes q = group q by "Account_Owner"; ``` # index_of() Returns the location (index) of the specified characters. ## Syntax `index_of`(_string_, _searchStr_ [,_position_ [, _occurence_]]) ## Usage This function returns the index of _searchStr_ in _string_, beginning at the specified _position_. The function returns 0 if _searchStr_ is not found. This function is case-sensitive. If any of the parameters are _null_, then the function returns _null_. The default value of _position_ is 1, which means that the function begins searching at the first character of _string_. An error results if _position_ is negative or zero. _occurrence_ is an optional integer, with a default value of `1` . You can use this parameter to specify which occurrence of _searchStr_ to search for. For example, if there is more than one occurrence of _searchStr_, and _occurence_ is 2, the index of the second occurrence is returned. Constant values are supported for _position_ and _occurrence_, not arbitrary expressions. If _searchStr_ is an empty string, then the function returns _null_. ## Example ```nolang q = load "Opportunity Details"; q = group q by all; -- return the first occurrence of "a", starting at the beginning. -- The result is 2. q = foreach q generate index_of("Hawaii", "a") as 'Index'; -- return the second occurrence of "a", starting at the beginning -- the result is 4 q = foreach q generate index_of("Hawaii", "a",1, 2) as 'Index'; -- return the first occurrence of "a", starting at the third position -- the result is 4 q = foreach q generate index_of("Hawaii", "a",3) as 'Index'; ``` # index_of({source_str}, {search_str}, [{position},{occurrence}]) Returns a boolean indicating whether a string ends with the search string. `INDEX_OF()` follows this syntax. - _source_str_ - : The string to be searched. - _search_str_ - : The string to search for within the source string. - _position_ - : Optional. The index from which to begin searching the string. The default _position_ is set to 1. - _occurrence_ - : Optional. If there’s more than one instance of the searched string, you can specify occurrence to choose which instance to return. The default _occurrence_ is set to 1. The function returns 0 if _search_str_ isn’t found. ## Example This example returns the index of the second occurrence of the letter “`e`” in the first five cities in the dataset. ```nolang SELECT City, INDEX_OF(City, 'e', 1, 2) as "indexValue" FROM "Superstore" LIMIT 5; ``` | City | indexValue | | --------------- | ---------- | | Henderson | 5 | | Henderson | 5 | | Los Angeles | 10 | | Fort Lauderdale | 15 | | Fort Lauderdale | 15 | # Install the Tableau Next Embedding SDK The Analytics Embedding SDK is available at [https://npmjs.com/package/@salesforce/analytics-embedding-sdk](https://npmjs.com/package/@salesforce/analytics-embedding-sdk) **important:** Starting in July '26, you must use v2.0. The back-end Lightning Out support has upgraded and v1.0 and v1.1 are no longer supported. To use the embedding SDK as a node package, run: ```bash npm install @salesforce/analytics-embedding-sdk --save ``` Select the latest version of the SDK from the repository. ## Add the SDK Script to Your App After you install the SDK, make sure that the downloaded SDK package is accessible to your web app. Add the ` ``` ### Example: Non-module version ```html ``` --- [Next - Add the Tableau Next Web Component to Your Web App](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-initialize-embed.md) # Instance Results Retrieves results for an instance of a report run asynchronously with or without filters. Depending on your asynchronous report run request, data can be at the summary level or include details. ## Resource URL ```nolang /services/data//analytics/reports//instances/ ``` ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |GET|Retrieves results of an asynchronous report run. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-get-reportdata.md).| |DELETE|If the given report instance has a `status` of `Success` or `Error`, delete the report instance and return an empty response body.| ## GET Response Body |Property|Type|Description| |--------|----|-----------| |`allData`|Boolean|When True, all report results are returned. When False, returns results for the same number of rows as a report run in Salesforce.| |`attributes`|[Attributes](#attributes)|Attributes for the instance of the report run.| |`factMap`|[Fact map](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md)|Collection of summary level data or both detailed and summary level data.| |`groupingsAcross`|[Groupings across](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Collection of column groupings.| |`groupingsDown`|[Groupings down](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Collection of row groupings.| |`hasDetailRows`|Boolean|When `false`, report results are at summary level. When `true`, report results are at the record detail level.| |`hasExceededTabularRowLimit`|Boolean|When True, returns the same number of rows as a report run in Salesforce. For a report on Salesforce Objects, total and subtotal rows don't count toward this limit. For a report on Data 360 Objects, total and subtotal rows do count toward this limit. When False, all report results are returned.| |`reportExtendedMetadata`|[Report extended metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Information on report groupings, summary fields, and detailed data columns, which is available if detailed data is requested.| |`reportMetadata`|[Report metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Information about the fields used to build the report.| ## Attributes |Property|Type|Description| |--------|----|-----------| |`id`|String|Unique ID for an instance of a report that was run.| |`status`|String|New if the report run has just been triggered through a request, Success if the report ran, Running if the report is being run, or Error if the report run failed. The instance of a report run can return an error if, for example, your permission to access the report has been removed since you requested the run.| |`ownerId`|String|API name of the user that created the instance.| |`completionDate`|Date, time string|Date, time when the instance of the report run finished. Only available if the report instance ran successfully or couldn’t be run because of an error. Date-time information is in ISO-8601 format.| |`requestDate`|Date, time string|Date and time when an instance of the report run was requested. Date-time information is in ISO-8601 format.| |`type`|String|Format of the resource.| |`reportId`|String|Unique report ID.| |`reportName`|String|Display name of the report.| **See Also** - [Execute Async](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instances-summaryasync.md) - [Instances List](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instances-resource.md) # Instances List Returns a list of instances for a report that you requested to be run asynchronously. Each item in the list is treated as a separate instance of the report run with metadata in that snapshot of time. ## Resource URL ```nolang /services/data//analytics/reports//instances ``` ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |GET|Return a list of asynchronous runs of a report. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-list-asyncreportruns.md).| ## Response Body |Property|Type|Description| |--------|----|-----------| |`id`|String|Unique ID for a report instance that was requested for a run. The ID is used to obtain results of the report run for that instance.| |`status`|String|New if the report run has just been triggered through a POST request, Success if the report ran, Running if the report is being run, or Error if the report run failed. The instance of a report run can return an error if, for example, your permission to access the report has been removed since you requested the run.| |`url`|String|URL where results of the report run for that instance are stored. The value is null if the report couldn’t be run because of an error.| |`ownerId`|String|API name of the user that created the instance.| |`hasDetailRows`|Boolean|When `false`, indicates that summary level data was requested for the report run. When `true`, indicates that detailed data, which includes summary level data, was requested for the report run.| |`completionDate`|Date, time string|Date, time when the instance of the report run finished. Only available if the report instance ran successfully or couldn’t be run because of an error. Date-time information is in ISO-8601 format.| |`requestDate`|Date, time string|Date and time when an instance of the report run was requested. Date-time information is in ISO-8601 format.| **See Also** - [Execute Async](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instances-summaryasync.md) - [Instance Results](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instance-resource-results.md) # Integrating the Tableau Next Embedding SDK After you have your External Client App set up for OAuth, you can add the Embedding SDK and your components into your web app. Tableau Next provides an easy way to generate the component code you need to embed. - [Copy Component Code Snippet from Tableau Next](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-copy-asset.md) Install the SDK for your web app. - [Install the Tableau Next Embedding SDK](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-install-sdk.md) Add the copied Tableau Next component code, initialize the SDK, and render the embedded component in your web app. - [Add the Tableau Next Component to Your Web App](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-initialize-embed.md) Add the Tableau Agent to your web app. - [Embed the Tableau Agent](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-embed-agent.md) Embed components from multiple Salesforce orgs in the same web app. - [Add Tableau Next Components from Multiple Salesforce Orgs](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-multiple-orgs.md) - [Logout from Salesforce Orgs](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-logout.md) Read through the [Best Practices for the Tableau Next Embedding SDK](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-best-practices.md) before pushing your updated web app to production. # Interaction Errors If you create an invalid interaction in a dashboard, the widget that uses the interaction displays an error in the dashboard. Generally, there are two types of errors. ## Validation Errors These errors occur when CRM Analytics is unable to parse the interaction due to the wrong syntax or illegal arguments used in your interactions. Another typical issue is that you didn’t escape double quotes when they’re inside other double quotes. For example, notice how the inner set of double quotes is escaped. ```javascript "numberColor": "{{cell(color_1.result, 0, \"color\").asString()}}" ``` ## Execution Errors These errors occur when CRM Analytics executes the interaction and either the expected columns or rows are missing or the data is in the wrong shape. For example, the interaction received a row, when it expected a cell. Review error messages to understand how to resolve interaction issues. Here’s an example of an interaction error in a dashboard. ![Binding error](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_dashboard_bindings_error.png) # Interaction Functions Dashboard designer dashboards support a variety of interaction functions that get data from a source query, manipulate it, and serialize it to make it consumable by the target query. If the input data has empty results, the function returns a null value. If the specified location of the data doesn’t exist, an error occurs. For example, the interaction is defined to get data from row 3, but row 3 doesn’t exist. An error also occurs if the shape of the input data doesn’t meet the requirement for the function. Interaction functions operate on input data with one of these shapes. - Scalar value, like `0`, `"this is scalar"`, or `null`. - One-dimensional array, like `([1, 2, 3])` or `(["one","two","three"])` - Two-dimensional array (an array of arrays), like `([ [1, 2], [3, 4] ])` The required shape of the input data varies with each function. After processing the data, the functions can change the shape of the data. Each interaction consists of nested functions. Each interaction must have one data selection function and one data serialization function. Optionally, interactions can have multiple data manipulation functions. This example illustrates how nested functions in an interaction work together to produce the expected result for a target query in which they’re defined. The example is based on this interaction. ```javascript coalesce(cell(mySourceStep.selection, 0, \"grouping\"), \"state\")**.asString()** ``` The `mySourceStep` query has this input data. | display | grouping | | ------------- | -------- | | Regional Area | region | | Country | country | | State | state | Technically, the data for this query is stored as a two-dimensional array, where each row is stored as a map of key-value pairs. ```json [ ["display":"Regional Area", "grouping":"region"], ["display":"Country", "grouping":"country"], ["display":"State", "grouping":"state"] ] ``` At runtime, CRM Analytics evaluates the interaction functions, starting with the innermost function. Using that logic, CRM Analytics evaluates the example’s interaction functions in this order. | Function | Description | | -------- | ----------- | | `mySourceStep.selection` | CRM Analytics returns each row of selected data as a map of key-value pairs. If a single selection is made, only one row returns. If multiple selections are made, multiple rows return.| | `cell(mySourceStep.selection, 0, \"grouping\")` | The `cell` function returns a scalar value from the `"grouping"` column of the first row (indicated by the 0 index) returned by `mySourceStep.selection`. Based on the selection, the return value can be `"region"`, `"country"`, or `"state"`. If no selection is made, the function returns `null`.| | `coalesce(cell(mySourceStep.selection, 0, \"grouping\"), \"state\")` | The `coalesce` function returns the value of the `cell` function if a selection was made. If no selection was made, the `coalesce` function returns the specified default value `"state"`.| | `coalesce(cell(mySourceStep.selection, 0, \"grouping\"), \"state\").asString()` | The `.asString` function returns the result of the `coalesce` function as a SAQL string.| **tip:** Use the `coalesce` function to provide a default value so that an error doesn’t occur when a null value is encountered. # Interaction Limitations for Dashboards CRM Analytics supports interactions in numerous places, but not everywhere. Review these limitations before you create any interactions. You can bind widget properties in chart and number widgets only. You can bind all except these properties. | Widget Type | Unsupported Widget Properties | | ----------- | ----------------------------- | | Number |
  • `borderEdges`
  • `borderWidth`
  • `compact`
  • `exploreLink`
  • `measureField`
  • `textAlignment`
| |Chart|
  • `borderEdges`
  • `borderRadius`
  • `borderWidth`
  • `exploreLink`
  • `measureField`
| You can’t bind these query properties: - `selectMode` # Interaction Syntax in the Dashboard You must specify the correct syntax when creating an interaction in a dashboard designer dashboard. The syntax is different for each dashboard designer. To specify a selection or results interaction in the dashboard designer, use this syntax. ```javascript {{.}} ``` For example, ```javascript {{mySourceStep.selection}} ``` **note:** When specifying the query, you specify the ID, not the label. ## Creating an Interaction To create an interaction: - Determine the source step and parameters. - Start with the basics, `"{{}}"`. Interactions are case sensitive. - An interaction with a trigger is `"{{.selection}}"` and without a trigger is `"{{.result}}"`. - Define which step to make the interaction by using the API name, not the label. `"{{Step_1.selection}}"` - Identify where the information for the interaction comes from: a cell, column, or row. Cell and column are more common than row. `"{{column(Step_1.selection)}}"` - Define the data serialization function by the expected result of the data, one value or an array of values. In most cases, the `column` function works with `asObject()` data serialization and the `cell` function works with `asString()`. `"{{column(Step_1.selection).asObject()}}"` - To complete the data selection, define the information that the interaction must take then add the field. For `asObject()`, wrap the field in `[]` and quotes. With `asString()`, the brackets aren't needed: `"{{column(Step_1.selection, ["value"]).asObject()}}"`. For `cell`, define which row to take the cell from: `"{{cell(Step_1.selection, 0, "value").asString()}}"`. # Interactions in Dashboards The dashboard designer treats selection and results interactions the same. Both types of interactions operate on tabular data and return complete rows, even for columns not used in widgets. The dashboard designer treats multiple selections as tabular data and single selections as a single row of tabular data. The designer expresses each row of tabular data in the form of an array of objects, where each object is keyed by the column name. # Introducing SQL for CRM Analytics SQL for CRM Analytics is a query language that lets you execute queries against your CRM Analytics datasets. SQL (Structured Query Language) is typically used for working with data stored in relational databases—you might already be familiar with variants like MySQL and PostGreSQL. CRM Analytics uses the ANSI SQL interface to access CRM Analytics’s fast in-memory data store. It has native support of Salesforce features used in CRM Analytics, including sharing inheritance and custom fiscal calendars. SQL for CRM Analytics supports these standard SQL features. - `SELECT` Clause - `FROM` Clause - `WHERE` Clause - `GROUP BY` Clause - `GROUP BY ROLLUP` - `GROUPING()` - `HAVING` Clause - `ORDER BY` Clause - `LIKE` Clause - `LIMIT` Clause - `FETCH` Clause - `OFFSET` Clause - `CASE` statements - `COALESCE()` - `NULLIF()` - `UNION` Operator - Aggregate, windowing, math, and string functions - Subqueries **note:** These features don’t support the full range of cases covered by ANSI SQL. Refer to each statement in the SQL for CRM Analytics reference for more information. # Introduction Most actions you take in Analytics result in one or more SAQL queries. Every lens, dashboard, and explorer action generates and executes a SAQL query to build the data needed for the visualization. Analytics evaluates queries, widgets, and layouts to render a dashboard. Behind every widget is a SAQL query which is sent the query engine for execution. The resulting data is passed to the charting library, which renders it using corresponding widget definitions. SAQL is influenced by the Apache Pig Latin (pigql) syntax, but their implementations differ, and they are not compatible. ![Diagram showing stylized relationship between client/server components](https://developer.salesforce.com/media/bi_dev_guide_saql/wave_saql_perf_query_journey1.png "How the components fit together") Developers can write SAQL to access Analytics data, either via the Analytics REST API, or by creating and editing SAQL queries contained in the dashboard JSON. A SAQL query loads an input dataset, operates on it, and outputs a results dataset. Each SAQL statement has an input stream, an operation, and an output stream. Statements can span multiple lines and must end with a semicolon. Each query line is assigned to a named stream. A named stream can be used as input to any subsequent statement in the same query. The only exception to this rule is the last line in a query, which you don’t need to assign explicitly. # join semi and anti Use the `join` statement with the `join_type` to create semi-join or anti-join results. ## Usage A semi-join returns the rows from one data stream if one or more matching rows are found in the second data stream. Each matched row is returned one time. The row data types must match for the specified data streams. An anti-join returns the rows in the first data stream that don’t match any rows in the second data stream. ## Syntax ```nolang results = join alias1 by (field1, ... fieldK) join_type, alias2 by (field1, ... fieldK) ``` | `Name` | `Description` | | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `alias1` | Required. The data stream to report semi-join or anti-join results for. | | `alias2` | Required. The data stream to look for matches or no matches in. | | `field1` | Required. The field name as it appears in the data stream. The field data type must be the same in `alias1` and `alias2` to match. Multi-value fields aren’t allowed. At least 1 field is requires, with a maximum of 5 fields allowed. Duplicate field names aren’t allowed in either data stream. | | `join_type` | Required. The type of join to run. Valid values are `semi` and `anti`. | The result stream contains the matched or unmatched rows from the `alias1` data stream only. For a semi-join, a row from `alias1` is only present if it satisfies the join criteria. The syntax supports *equijoin* (equality) criteria only. There isn't a guarantee that the rows in the result stream are in the same order as in `alias1`. The parenthesis used to specify the fields are optional if there’s only 1 field. The input data stream aliases must be unique. These streams can't be unprojected `group` or `cogroup` results, either directly or indirectly. The `group` or `cogroup` statement is made after the `join` statement. Performance Considerations - The join performance is directly proportional to the amount of data returned by the second dataset. We recommend running any filters on the second dataset before running the join. - Run the join before running any projections on the query results. For example, if you have a `foreach` statement in your query, like `q = foreach q generate count(q1) as 'A';`, run it after the `join` statement. **note:** The `join` `alias` field must be a dimension or a date. If you use a measure field as an `alias`, the query returns an error stating `Error in join: non-dimension field: {field1} is not allowed in pre-projection alias: {alias1} at join keys list position: 1`. This restriction is only for pre-projection `alias`. All data types are allowed in the post-projection `alias`. For example, to use a measure in a `join`, project the measure field first. This query joins `Number_of_Employees`, a measure, by projecting it before running the `join`. ```nolang c = load \"cases\"; a = load \"accounts\"; a = join a by Name semi, c by Name; a = foreach a generate ID, Industry, Name, Year, Number_of_Employees; a = order a by (ID); ``` ## Semi-Join Syntax ```nolang a = join a by (id) semi, b by (id); ``` ## Anti-Join Syntax ```nolang a = join a by (id) anti, b by (id); ``` ## Multiway Semi-Join Syntax `join` statements can be combined to form a multiway semi-join. A maximum of 3 `join` statements are allowed in a query. These statements combine into a conjunctive predicate. ```nolang a = join a by (id) semi, b by (id); a = join a by (id) anti, c by (id); ``` ## join Use Cases Use a `join` statement to query for accounts with at least 1 opportunity ```nolang account = load \"accounts\"; opp = load \"opportunities\"; q = join account by (id) semi, opp by (accountId); ``` Use a `join` statement to query for accounts with opportunity amount more than 10K. ```nolang account = load \"accounts\"; opp = load \"opportunities\"; opp = filter opp by amount > 10000; q = join account by (id) semi, opp by (accountId); ``` Use a `join` statement to query for accounts with more than 10 opportunities. ```nolang account = load \"accounts\"; opp = load \"opportunities\"; opp = group opp by accountId; q = join account by (id) semi, opp by (accountId); q = foreach q generate accountId, count() as count; q = filter q by count > 10; ``` Use a `join` statement to query for accounts with no opportunities. ```nolang account = load \"accounts\"; opp = load \"opportunities\"; q = join account by (id) anti, opp by (accountId); ``` Use a `join` statement to query for accounts with opportunities, but no orders. ```nolang account = load \"accounts\"; opp = load \"opportunities\"; orders = load \"orders\"; q = join account by (id) semi, opp by (accountId); q = join q by (id) anti, orders by (accountId) ``` ## Null Handling Running the `join` query with null fields is a special case. For the SAQL anti-join statement, null isn't equal to null, which differs from the `cogroup` statement. The behavior of the statement is the same as `NOT EXISTS` in SQL. In this example, imagine you’re joining the accounts and the opportunities data streams, which contain these rows: | `accounts` | | `opportunities` | | | ---------- | ---- | --------------- | ---- | | `id` |   | `account_id` |   | |   | 1 |   | 1 | |   | 2 |   | NULL | |   | NULL |   |   | For SAQL, this statement: ```nolang a = load \"accounts\"; opp = load \"opportunities\"; q = join a by (id) anti, opp by (account_id); q = foreach q generate id, name; ``` has the same behavior as this SQL statement: ```nolang select id, name from accounts a where not EXISTS (select 1 from opportunities opp where opp.account_id = a.id); ``` The SAQL anti-join query returns two rows: ```nolang [ { id : null }, { id : 2 } ] ``` ## Considerations Using a `union` statement and a `join` statement in the same query has strict enforcements. When a `semi` or `anti` `join` statement is present, the `union` statement returns an error if there are: - mismatched number of columns - mismatched data types The errors appear as "Different number of fields found across union streams" or "Different types found for field 1: '_fieldName_' in different union inputs." There's also strict checking on the name of the columns. Using this SAQL example with a `semi` `join` statement and a `union` statement: ```soql q1 = load "Opportunity"; q2 = load "Opportunity"; q1 =join q1 by (AccountId) semi, q3 by (AccountId); q2 = group q2 by all; q1 = foreach q1 generate q1.'AccountId' as 'AccountId',q1.StageName as 'StageName', q1.'Description' as 'Description', q1.'Id' as 'Id',q1.'Amount' as 'Amount', q1.'Probability' as 'Probability'; q2 = foreach q2 generate null as 'AccountId', null as 'StageName',null as 'Description',null as 'Id', sum(unique('Amount')) over([..] partition by all) as 'Amount_total',sum(unique('Probability')) over([..] partition by all) as 'Probability'; q1 = limit q1 5; qU = union q1, q2; ``` When the join is present, strict name checking only allows for one ‘Amount’ column name, which comes from the first stream, `q1`. The ‘Amount_total’ summary column name from the second stream, `q2`, isn’t honored and only the normal 'Amount' column name is in the union results. If the `join` statement is removed, both the normal ‘Amount’ and the summary ‘Amount_total’ column names are in the union results. **See Also** - [cogroup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-cogroup.md) - [union](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-union.md) # `json` Functions Use `json` functions in rules to manipulate JSON at runtime. For example, find all the JSON paths in a dashboard that have a link widget and update the links at runtime. ## `searchPaths` Parameters: `String jsonPath` Returns: `Collection` Recursive: Not supported Description: Searches the current JSON document and returns matching fully qualified JSON paths. If no results are found, returns an empty array. If more than one item is found, returns an array of JSON paths. ### Example ```json { "searchPaths": "${json:searchPaths('$.state.widget..[?(@.type in [\"link\"])]')}" } ``` run on a dashboard returns all JSON paths in the dashboard with link widgets: ```json { "searchPaths": ["$['state']['widgets']['link3']", "$['state']['widgets']['link4']", "$['state']['widgets']['link1']", "$['state']['widgets']['link2']" ] } ``` These paths can be used to make runtime updates to the links in the dashboard. ## `searchValues` Parameters: `String jsonPath` Returns: `Collection` Recursive: Not supported Description: Searches the current JSON document and returns values of the matching nodes. If no results are found, returns an empty array. If more than one item is found, returns an array of objects. This function throws an error when called outside rules execution. ### Example ```json { "searchValues": "${json:searchValues('$.path.to.json.object')}" } ``` ## `toJsonObject` Parameters: `Object object` Returns: `Object` Recursive: Not supported Description: Converts a string to a JSON object ### Example ```json { "jsonObject": "${json:toJsonObject('{\"type\" : \"fruit\",\"color\" : \"red\"}')}" } ``` Returns ```json { "jsonObject": { "type" : "fruit", "color" : "red" } } ``` # json Functions Use json functions in rules to manipulate JSON at runtime. For example, find all the JSON paths in a dashboard that have a link widget and update the links at runtime. ## Function Name: searchPaths Parameters: String `jsonPath` Returns: `Collection` See _Description_ for detail. Recursive: Not supported Description: Searches the current JSON document and returns matching fully qualified JSON paths. If no results are found, returns an empty array. If more than one item is found, returns an array of JSON paths. ## Example ```nolang ${json:searchPaths('$.state.widget..[?(@.type in [\"link\"])]')} ``` run on a dashboard returns all JSON paths in the dashboard with link widgets: ```nolang ["$['state']['widgets']['link3']", "$['state']['widgets']['link4']", "$['state']['widgets']['link1']", "$['state']['widgets']['link2']" ]. ``` These paths can be used to make runtime updates to the links in the dashboard. ## Function Name: searchValues Parameters: String `jsonPath` Returns: `Collection` See _Description_ for detail. Recursive: Not supported Description: Searches the current JSON document and returns values of the matching nodes. If no results are found, returns an empty array. If more than one item is found, returns an array of objects. ## Example ```nolang ${json:searchValues('$.path.to.json.object')} ``` If this function is called outside of rules execution, an error is thrown. # Keywords Keywords are case-sensitive and must be lowercase. For a list of SAQL statements that are keywords, see [SAQL Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-statements-concept.md). **See Also** - [sample](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-sample.md) # Last Day in the Week, Month, Quarter, or Year Returns the date of the last day in the specified week, month, quarter, or year. ## Usage Use these functions in a `foreach()` statement. You cannot use them in `group by`, `order by`, or `filter` statements. Use the functions whose names begin with `week`, `month`, `quarter`, and `year` with standard calendar year dates. Use the functions whose names begin with `fiscal` with fiscal year dates. **note:** You can't use fiscal date functions in recipes and dataflow transformations. ## week_last_day(date) Returns the date of the last day of the week for the specified date. **note:** This function always counts the `firstDayOfWeek` as 0 (Sunday). It overrides the `firstDayOfWeek` parameter for `sfdcDigestTransformation` and CSV uploads. ```nolang q = foreach q generate week_last_day(toDate('CloseDate_sec_epoch')) as 'Week Last Day'; ``` ## fiscal_week_last_day(date) Returns the fiscal date of the last day of the week for the specified date. **note:** This function respects the `firstDayOfWeek` parameter for `sfdcDigestTransformation` and CSV uploads. The default value is 0 (Sunday). ```nolang q = foreach q generate fiscal_week_last_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Week Last Day'; ``` ## month_last_day(date) Returns the date of the last day of the month for the specified date. ```nolang q = foreach q generate month_last_day(toDate('CloseDate_sec_epoch')) as 'Month Last Day'; ``` ## fiscal_month_last_day(date) Returns the fiscal date of the last day of the month for the specified date. ```nolang q = foreach q generate fiscal_month_last_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Month Last Day'; ``` ## quarter_last_day(date) Returns the date of the last day of the quarter for the specified date. ```nolang q = foreach q generate quarter_last_day(toDate('CloseDate_sec_epoch')) as 'Quarter Last Day'; ``` ## fiscal_quarter_last_day(date) Returns the fiscal date of the last day of the quarter for the specified date. ```nolang q = foreach q generate fiscal_quarter_last_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Quarter Last Day'; ``` ## year_last_day(date) Returns the date of the last day of the year for the specified date. ```nolang q = foreach q generate year_last_day(toDate('CloseDate_sec_epoch')) as 'Year Last Day'; ``` **note:** This function always returns 31st December. You can use it to find the number of days to the year end. ## fiscal_year_last_day(date) Returns the fiscal date of the last day of the year for the specified date. ```nolang q = foreach q generate fiscal_year_last_day(toDate('CloseDate_sec_epoch')) as 'Fiscal Year Last Day'; ``` **See Also** - [Date Formats and Fiscal Dates for Source Data](https://help.salesforce.com/s/articleView?id=bi_integrate_date_formats_and_fiscal_dates.htm) # last() Returns the last value in the tuple for the specified field. Use `last()` to return the last value of a measure or dimension. You can also use `last()` to return the value of a field without grouping by that field. **note:** If the values are not sorted, the 'last' value could be any value in the tuple. ## Example - Return the Last Industry for an Account Owner Your reps own opportunities in several industries. You need a list of rep names with their last industry, where industry is sorted alphabetically. Group by account owner and industry, sort by industry, then use `first()` to get the last industry. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by ('Account_Owner', 'Industry'); q = foreach q generate 'Account_Owner' as 'Account_Owner', 'Industry' as 'Industry'; q = order q by 'Industry'; q = foreach q generate 'Account_Owner' as 'Account_Owner', last('Industry') as 'One Industry'; ``` ![Diagram showing first function with sorted field.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_last_image.png) **See Also** - [first()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-1st.md) # len() Returns the number of characters in the string. ## Syntax `len`(_string_) ## Usage Leading and trailing whitespace characters are included in the length returned. Returns `null` if _string_ is `null`. ## Example ```nolang len("starfox") == 7 len(" rocket ") == 8 len("謝") == 1 len("") == 0 ``` # Lightning Dashboards Configuration Lightning dashboards provide a flexible way to visualize your data. By default, dashboards include standard components such as charts, tables, and gauges. However, you can extend their capabilities by adding custom Lightning Web Components (LWC). You can add custom LWCs such as Kanban boards, heatmaps, and other interactive visualizations to explore, filter, and act on data directly within the dashboard. **See Also** - [Component Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-attributes.md) - [CRM Analytics Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-config.md) - [Query Data](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-query-data.md) - [Other Widgets](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-other.md) - [Add Custom Lightning Web Components to Lightning Dashboards (Beta)](https://help.salesforce.com/s/articleView?id=analytics.dashboards_embed_lwcs.htm) # Lightning Web Component getState Method Use the `getState` method to retrieve the current state of the rendered Lightning web component for CRM Analytics dashboards. ## Arguments | Argument Name | Description | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `callback` | The callback function to handle the `getState` response. See the next section for a basic `callback` example. | ## Example Add your implementation of the `getState` call into the wrapper Javascript and HTML for your component. **note:** To use the communityDashboard component, replace `wave-wave-dashboard-lwc` with `wave-community-dashboard`. The HTML for the component: ```html ``` The Javascript for the component, which implements `getState()`: ```javascript import { LightningElement } from 'lwc'; export default class DashboardWrapper extends LightningElement { getState () { const dashboard = this.template.querySelector('wave-wave-dashboard-lwc'); dashboard.getState(function (result, error) { if (error) { console.warn("getState error: ", error); } if (result) { let state = JSON.parse(JSON.stringify(result.payload)); console.warn("getState state: ", state); let json = JSON.stringify(state, null, 2); console.wave("getState as json: ", json); } }); } } ``` In this example, the `callback` function result contains a JSON payload with `state` attributes. Here’s a sample callback result. ```json { "state": { "datasets": {}, "sObjects": {}, "steps": { "Step_1": { "values": [], "metadata": { "groups": ["Field1__c"] } } } } } ``` **See Also** - [Lightning Web Component `setState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-setstatemethod.md) # Lightning Web Component setState Method Use the `setState` method to set the state of the rendered Lightning web component for CRM Analytics dashboards. ## Arguments | Argument Name | Description | | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `state` | The state to update the CRM Analytics dashboard component with. | ## Example Add your implementation of the `setState` call into the wrapper Javascript and HTML for your component. **note:** To use the communityDashboard component, replace `wave-wave-dashboard-lwc` with `wave-community-dashboard`. The HTML for the component: ```html ``` The Javascript for the component, which implements `setState()`: ```javascript import { LightningElement } from 'lwc'; export default class DashboardWrapper extends LightningElement { _state = {}; setState () { const dashboard = this.template.querySelector('wave-wave-dashboard-lwc'); dashboard.setState(this._state); console.warn("setState complete"); } } ``` The `state` can be set dynamically from user input or from another dashboard’s `state`. For the complete dashboard `state` structure, refer to the [Analytics Dashboard JSON Reference](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_json.meta/bi_dev_guide_json/bi_dbjson_intro.htm) guide. **See Also** - [Lightning Web Component `getState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-getstatemethod.md) # Lightning Web Components for Analytics Dashboards There are two Lightning web components for displaying dashboards in Salesforce. The `wave-wave-dashboard-lwc` component displays a CRM Analytics dashboard in a Lightning page. The `wave-community-dashboard` component displays a CRM Analytics dashboard in Experience Cloud. The component, **LWC CRM Analytics Dashboard**, is available in both the Lightning App Builder and the Experience Cloud Builder as a drag-and-drop component. You can also create your own component to interact programmatically with the `wave-wave-dashboard-lwc` or `wave-community-dashboard` components. To display a CRM Analytics dashboard, pass in the required attribute, which is either `dashboard` or `developer-name`. All other attributes have a default value and are specified only if you want to override the default with your own custom value. ## Example: CRM Analytics Dashboard component on a Lightning Page ```xml ``` ## Example: CRM Analytics Dashboard component on an Experience Cloud page ```xml ``` **See Also** - [Lightning Web Component for Analytics Dashboards Reference](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-reference.md) - _Salesforce Help_: [Embed Dashboards in Lightning Pages](https://help.salesforce.com/s/articleView?id=analytics.bi_embed_lightning.htm) - - _Salesforce Help_: [Share CRM Analytics in Experience Cloud Sites](https://help.salesforce.com/s/articleView?id=analytics.bi_app_communities.htm) - [Lightning Web Components Developer Guide](https://developer.salesforce.com/docs/platform/lwc/guide) # Lightning Web Components in CRM Analytics and Lightning Dashboards With Lightning Web Components in dashboards, you can now extend the dashboard capabilitieswith your own custom widgets. ## Overview With Lightning Web Components in dashboards, widgets can be a custom data visualization, a custom selection control, a richly formatted custom document, and more. The main benefits are: - Part of the dashboard canvas - Any Lightning Web Component can be next to a dashboard, but it’s always offset by spacing. Lightning Web Components in dashboards allow the component to render ON the dashboard canvas, and it can look and feel like a native widget. Also, the dashboard can have one or more Lightning Web Components inside it, so everything can be browsed, embedded, and consumed as a single, cohesive unit. In Lightning dashboards, you can add only one custom Lightning Web Component. - No code data querying built-in - Each Lightning Web Component can be optionally associated with a query, also known as a step. This query provides a table of data to the Lightning Web Component, so that the developer writes less code to query and fetch data. Anyone configuring your component can use the CRM Analytics Explorer UI to configure any query against datasets, Salesforce Objects, or Snowflake with clicks and not code. Also, the Analytics Dashboard Designer UI has additional features like Embedded Filters, Global Filters, selective faceting, and bindings. Here you can configure how the widget interacts with other dashboard elements without adding any additional code to your Lightning Web Component. This doesn't apply for custom Lightning Web Components added to Lightning dashboards. - Attributes UI - The developer can specify attributes and their types that populate a configuration UI for each setup. These attributes are a great way to abstract: - Constants for use case defined parameters - Dynamic, calculated data - Metadata about how to use the columns of configured query results - Labels - Colors, sizes, and other styling attributes By specifying the attribute type, your users see the appropriate configuration UI and validation for that type. And they always have the option to use the Designer IDE to create custom interactions to make any attribute dynamic. - Set and Get State Functions - These functions provide the same functionality present in the CRM Analytics Dashboard Component. Your custom Lightning Web Component can get the entire state of the parent dashboard and modify it in any way. The benefit of a Lightning Web Component is that it’s even easier to connect to the parent dashboard with auto-wiring. - **[Architecture](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-architecture.md)** Let’s look at how custom Lightning Web Component widgets fit into the existing CRM Analytics dashboard architecture. - **[Setup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-setup.md)** Set up your environment to create Lightning Web Component widgets, and then add them to your CRM Analytics and Lightning dashboards. # Lightning Web Components in CRM Analytics Dashboards Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | ---------------------------------------------------------------------------------------------------------- | | 68.0 | Winter '27 | [Download PDF](https://resources.docs.salesforce.com/264/latest/en-us/sfdc/pdf/bi_dev_guide_lwc_in_db.pdf) | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_lwc_in_db.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_lwc_in_db.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_lwc_in_db.pdf) | # LIKE Clause Use `LIKE` to match single characters and patterns found anywhere in a string—beginning, ending, or somewhere in between. `LIKE` takes this syntax. `[NOT] LIKE {pattern}` `NOT`—Optional. Returns `True` if the left operand matches the pattern on the right. This operator is case-sensitive. A pattern must be at least two characters. To match any single character in the string, include an underscore (`_`). To match any pattern, include a percent sign (`%`). Starting a pattern with a percent sign returns all words that end with the specified characters. The percent sign indicates that any number of characters can precede the specified ones. Ending a pattern with a percent sign returns all the words that begin with the specified characters. Any number of characters can follow the specified ones. To match a pattern anywhere in a string, the pattern must start and end with a percent sign. For example, let's say we have a list of countries. A query that filters on the pattern `%a%a%` returns Bahamas, Jamaica, Slovakia, and Trinidad and Tobago. If we change the pattern to `_a_a___`, the query returns Bahamas and Jamaica. To include a literal percent sign or underscore in a pattern, escape them with a backwards slash (`\`). Additional wildcard characters and regular expressions aren’t supported. Here are some more examples. ## Simple Pattern in a String This example checks whether a customer name contains the characters "ni" anywhere in the string. If the string contains "ni", then the condition evaluates to `True` and the query returns the name. ```nolang SELECT Customer_Name as 'name' FROM "Superstore" WHERE Customer_Name LIKE "%ni%"; GROUP BY Customer_Name; LIMIT 5; ``` | name | | --------------- | | Annie Thurman | | Annie Zypern | | Benjamin Venier | | Berenike Kampe | | Chad Cunningham | ## One Underscore This query returns city names that contain any single character preceding "lb" and zero or more characters following it. ```nolang SELECT City as 'city' FROM "Superstore" WHERE City LIKE "_lb%"; GROUP BY City; ``` | city | | ----------- | | Albuquerque | ## Multiple Underscores If we precede the characters "lb" with two underscores, the query returns results that have any two characters before "lb." ```nolang SELECT City as 'city' FROM "Superstore" WHERE City LIKE "__lb%"; GROUP BY City; ``` | city | | --------- | | Gilbert | | Melbourne | ## End with Percent Sign This query matches names that begin with "An." These names include Andrew Levine, Annette Boone, Annette Cline, and Annie Horne. ```nolang WHERE Customer_Name LIKE "An%" ``` ## Exclude Records with NOT This query shows all customer names that don’t contain "po." These names include Aaron Davies Bruce, Aaron Day, Aaron Dillon, and Aaron Riggs. ```nolang WHERE NOT Customer_Name LIKE "%po%" ``` # limit Limits the number of results that are returned. If you don’t set a limit, queries return a maximum of 10,000 rows. ## Syntax ```nolang result = limit rows number; ``` ## Usage Use this statement only on data that has been ordered with the `order` statement. The results of a `limit` operation aren’t automatically ordered, and their order can change each time that statement is called. You can use the `limit` statement with ungrouped data. You can use the `limit` statement to limit grouped data by an aggregated value. For example, to find the top 10 regions by revenue: group by region, call `sum(revenue)` to aggregate the data, `order` by `sum(revenue)` in descending order, and `limit` the number of results to the first 10. **note:** The `limit` statement isn’t a `top()` or `sample()` function. ## Example This example limits the number of returned results to 10: ```nolang b = limit a 10; ``` The expression can’t contain any columns from the input. For example, this query is not valid: ```nolang b = limit OrderDate 10; ``` **See Also** - [Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statements.md) - [order](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-order.md) # Limit and Offset Interactions You can also bind the limit and offset of a SAQL query. These interactions don’t require data serialization functions. Consider a source query that provides this data. ```json [ {limit: 100, offset: 10} ] ``` To bind the limit and offset, use this logic. ```javascript q = limit q {{cell(stepFoo.selection, 0, "limit").asString()}}; q = offset q {{cell(stepFoo.selection, 0, "offset").asString()}}; ``` After CRM Analytics evaluates the interaction, the limit and offset become: ```javascript q = limit q 100; q = offset q 10; ``` For information about limits and offsets, see the [CRM Analytics SAQL Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_saql.meta/bi_dev_guide_saql/bi_saql_intro.htm). # LIMIT Clause The `LIMIT` clause specifies the maximum number of rows to return. If no `LIMIT` clause is specified, then SQL returns all rows. `LIMIT` follows the syntax `LIMIT {count}`. **important:** When working with two or more columns, make sure to use `LIMIT` with an `ORDER BY` clause, so that your results are returned in a specified order. Otherwise, results return in an order you may not want. ORDER BY is optional for working with a single column. Here’s an example. ```nolang SELECT City FROM "Superstore" ORDER BY City LIMIT 5; ``` This query returns the cities in the first three rows of the dataset. | City | | -------- | | Aberdeen | | Abilene | | Akron | | Akron | | Akron | # Limit Multivalue Fields Multivalue fields can cause poor performance. The behavior of these fields is undefined for `group-by` and `foreach` statements. If possible, write your query so that the fields are referenced only in filters. **note:** To work with multivalue fields, from Setup, in the Quick Find box, enter `Analytics`, and then select **Settings**. In Settings, click the checkbox for **Enable indexing of multivalue fields in CRM Analytics**. If you don’t select this preference, the `mv_to_string()` function returns only the first value in the field. See [mv_to_string()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-mts.md) for more information. Even with indexing enabled, multivalue fields in multilevel grouping, such as `group by(Year, Region)`, can cause poor performance. Here’s FlightsMV, a sample dataset of flight information. | airline | flight_num | origin | dest | pilot | airplane | flight_classes | flight_attendants | distance | num_passengers | | --------- | ---------- | ------ | ---- | ------ | -------------- | ---------------------- | --------------------------- | -------- | -------------- | | southwest | sw301 | lax | sfo | john | boeing 737-700 | business;economy | mark;sara;kate;maria;martin | 1000 | 100 | | united | u321 | lax | sfo | mark | boeing 737-900 | first;business;economy | jen;sophia;emma;alice | 1000 | 200 | | alaska | as400 | lax | sfo | tim | airbus A320 | business;economy | mark;leila;brad | 1000 | 100 | | delta | d301 | lax | sfo | martin | airbus A321 | business;economy | sarah;maria | 1000 | 100 | | southwest | sw302 | sfo | lax | - |   | business;economy | - | 1000 | 100 | | united | u322 | sfo | lax | john | boeing 737-700 | first;business;economy | sarah;martin | 1000 | 200 | | alaska | as401 | sfo | lax | mark | boeing 737-900 | business;economy | maria;mark;sara;kate;martin | 1000 | 100 | | delta | d302 | sfo | lax | tim | airbus A320 | business;economy | emma;jen;sophia;alice | 1000 | 100 | | southwest | sw303 | lax | jfk | robert | airbus A321 | business;economy | leila;mark;brad | 1000 | 100 | | united | u323 | lax | jfk | maria |   | first;business;economy | - | 1000 | 200 | | alaska | as403 | lax | jfk | mark | boeing 737-700 | business;economy | - | 1000 | 100 | | delta | d303 | lax | jfk | tim | boeing 737-900 | business;economy | maria;sarah | 1000 | 100 | | southwest | sw304 | jfk | lax | robert | airbus A320 | business;economy | martin;sarah | 1000 | 100 | | united | u324 | jfk | lax | - | airbus A321 | first;business;economy | kate;mark;sara;maria;martin | 1000 | 200 | | alaska | as404 | jfk | lax | john |   | business;economy | sophia;jen;emma;alice | 1000 | 100 | | delta | d304 | jfk | lax | mark | boeing 737-700 | business;economy | - | 1000 | 100 | | southwest | sw303 | lax | ord | martin | boeing 737-900 | business;economy | - | 1000 | 100 | | united | u323 | lax | ord | robert | airbus A320 | first;business;economy |   | 1000 | 200 | | alaska | as403 | lax | ord | - | airbus A321 | business;economy | brad;mark;leila | 1000 | 100 | | delta | d303 | lax | ord | john | - | business;economy | sarah;maria | 1000 | 100 | The `flight_attendants` column contains multivalue fields. Let’s write a query to filter on the rows where `maria` is listed as a flight attendant. ```nolang q = load "FlightsMV"; q = filter q by 'flight_attendants' in ["maria"]; q = foreach q generate 'airplane' as 'airplane', 'distance' as 'distance', 'flight_attendants' as 'flight_attendants', 'flight_num' as 'flight_num', 'id' as 'id', 'num_passengers' as 'num_passengers', 'origin' as 'origin', 'pilot' as 'pilot'; ``` | airplane | distance | flight_attendants | flight_num | id | num_passengers | origin | pilot | | -------------- | -------- | ----------------- | ---------- | --- | -------------- | ------ | ------ | | boeing 737-700 | 1000 | kate | sw301 | 1 | 100 | lax | john | | airbus A321 | 1000 | maria | d301 | 4 | 100 | lax | martin | | boeing 737-900 | 1000 | kate | as401 | 7 | 100 | sfo | mark | | boeing 737-900 | 1000 | maria | d303 | 12 | 100 | lax | tim | | airbus A321 | 1000 | kate | u324 | 14 | 200 | jfk | - | | - | 1000 | maria | d303 | 20 | 100 | lax | john | The results display the rows that include `maria`. The `flight_attendants` field displays only one flight attendant name when the field is multivalue. To return all the names, use the `mv_to_string()` function. ```nolang q = load "FlightsMV"; q = filter q by 'flight_attendants' in ["maria"]; q = foreach q generate 'airplane' as 'airplane', 'distance' as 'distance', mv_to_string('flight_attendants') as 'flight_attendants', 'flight_num' as 'flight_num', 'id' as 'id', 'num_passengers' as 'num_passengers', 'origin' as 'origin', 'pilot' as 'pilot'; ``` **note:** When using comparison operators in the filter, use `in` and `not in` to return the correct values. Using `==` and `!=` returns unexpected values when null handling is enabled. See [`Group-by` with Null Values](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-groupby.md) for more information. **See Also** - [Multivalue Field](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-multivalue.md) # Limit the Use of unique() `unique()` can affect query performance for large datasets that have over 100 million rows and include more than one million unique values. For large datasets, `unique()` is faster for measures than for dimensions. If counting the number of unique string values causes performance issues, convert the string to a number. For example, use a hash of the string value or refer to the index of the string in a sorted list of string values. **note:** Counting unique values can impact performance, but counting the total number of rows in a dataset doesn’t. # List Asynchronous Runs of a Report You can get as many as 2000 instances of a report for which you requested asynchronous runs by sending a GET request to the Instances List resource. The instance list is sorted by the date when the run was requested. Report results are stored for a rolling 24-hour period. During this time, based on your user access level, you can access results for each instance of the report that was run. ## Example A GET request, `/services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/instances`, to the Instances List resource returns two instances of the report that was run asynchronously. Each URL handle stores report results for that instance. ```nolang [ { "id": "0LGD000000000IyOAI", "requestDate": "2013-08-12T19:06:47Z", "status": "Success", "url": "/services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/instances/0LGD000000000IyOAI", "ownerId": "005D0000001KvxRIAS", "queryable" : false, "hasDetailRows": false, "completionDate": "2013-08-12T19:06:48Z" }, { "id": "0LGD000000000IjOAI", "requestDate": "2013-08-12T18:39:06Z", "status": "Success", "url": "/services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/instances/0LGD000000000IjOAI", "ownerId": "005D0000001KvxRIAS", "queryable" : false, "hasDetailRows": false, "completionDate": "2013-08-12T18:39:07Z" } ] ``` **See Also** - [Instances List](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-instances-resource.md) # List Recently Viewed Reports Get up to 200 of the reports you most recently viewed in Salesforce by sending a GET request to the Report List resource. Each report listing in the response has resource URLs to get metadata and run a report asynchronously or synchronously. For a more extensive reports list, query the Report object using a SOQL query in a Salesforce API such as SOAP API or REST API. This SOQL query, for example, returns all reports that are in matrix format: `SELECT Description,Format,LastRunDate FROM Report WHERE Format = 'MATRIX' ORDER BY Id ASC NULLS FIRST` ## Example This GET request `/services/data/v35.0/analytics/reports` to the Report List resource returns a list of 5 recently viewed reports. ```nolang [ { "describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2OmMAK/describe", "id" : "00OR0000000K2OmMAK", "instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2OmMAK/instances", "name" : "Pipeline By Industry", "url" : "/services/data/v35.0/analytics/reports/00OR0000000K2OmMAK" }, { "describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFXeMAO/describe", "id" : "00OR0000000OFXeMAO", "instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFXeMAO/instances", "name" : "My Open Pipeline", "url" : "/services/data/v35.0/analytics/reports/00OR0000000OFXeMAO" }, { "describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/describe", "id" : "00OR0000000K2UeMAK", "instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances", "name" : "Deals Closing This Quarter", "url" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK" }, { "describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFHoMAO/describe", "id" : "00OR0000000OFHoMAO", "instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFHoMAO/instances", "name" : "Sample Report: # of Opportunities", "url" : "/services/data/v35.0/analytics/reports/00OR0000000OFHoMAO" }, { "describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000JdVOMA0/describe", "id" : "00OR0000000JdVOMA0", "instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000JdVOMA0/instances", "name" : "My Leads rpt", "url" : "/services/data/v35.0/analytics/reports/00OR0000000JdVOMA0" } ] ``` **See Also** - [Report List](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-recentreportslist.md) # ln({n}) Returns the base e (Euler's number) logarithm of a number _n_. The value _n_ can be any positive, non-zero numeric value in the range 0 \< _n_ \<= 1.797e308. `ln({n})` takes the following syntax. ```nolang SELECT ln(NUMERICVALUE) as ALIASNAME FROM DATASET; ``` ## Example This example returns the base e logarithm for the number 8. ```nolang SELECT ln(8.0) as LnExample FROM Superstore LIMIT 1; ``` | LnExample | | --------- | | 2.079 | # load Loads a dataset. All SAQL queries start with a `load` statement. ## Syntax ```nolang result = load dataset; ``` If you’re working in Dashboard JSON, _dataset_ must be the dataset name from the UI. Use of the dataset name (also called an alias) means the app can substitute it with the correct version of the dataset. If you’re working in the Analytics REST API, _dataset_ must be the containerId/versionId. ## Usage After being loaded, the data is not grouped. The columns are the columns of the loaded dataset. ## Example Load the Accounts dataset to the stream 'b'. `b = load "Accounts";` # log({m},{n}) Returns the natural logarithm (base m) of a number n. The values m and n can be any positive, non-zero numeric value in the range 0 \< m, n \<= 1.797e308 and m ≠ 1. `log({m}{n})` takes the following syntax. ```nolang SELECT log(baseNumber, numericValue) as AliasName FROM dataset; ``` ## Example This example returns the base 2 logarithm for the number 8. ```nolang SELECT log(2.0,8.0) as natlLogExample FROM Superstore LIMIT 1; ``` | natlLogExample | | -------------- | | 3.0 | # log(m, n) Returns the natural logarithm (base m) of a number _n_. The values _m_ and _n_ can be any positive, non-zero numeric value in the range 0 \< m, n \<= 1e308 and m ≠ 1. The smallest value for _m_ or _n_ that will not produce 0 is log(10, 0.3e-323). This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate log(10, Population) as Population; q = filter q by log(10, Population) < 15; ``` # log10({n}) Returns the base 10 logarithm of a number _n_. The value _n_ can be any positive, non-zero numeric value in the range 0 \< _n_ \<= 1.797e308. `log10({n})` takes the following syntax. ```nolang SELECT log10(NUMERIC_VALUE) as ALIASNAME FROM DATASET; ``` ## Example This example returns the base 10 logarithm for the number 5. ```nolang SELECT log10(5) as logExample FROM Superstore LIMIT 1; ``` | logExample | | ---------- | | 0.698 | # Logical Operators Use logical operators to perform AND, OR, and NOT operations. Logical operators can return true, false, or null. | Operator | Name | Description | | ----------- | ----------- | ----------- | | `&& (and)` | Logical AND | See table. | | `\|\| (or)` | Logical OR | See table. | | `! (not)` | Logical NOT | See table. | The following tables show how nulls are handled in logical operations. | x | y | x && y | x \|\| y | | ----- | ----- | ------ | -------- | | True | True | True | True | | True | False | False | True | | True | Null | Null | True | | False | True | False | True | | False | False | False | False | | False | Null | False | Null | | Null | True | Null | True | | Null | False | False | Null | | Null | Null | Null | Null | | x | !x | | ----- | ----- | | True | False | | False | True | | Null | Null | # Logout from Salesforce Orgs To provide user logout functionality, use the `logout` function to log out from one or more Salesforce orgs. The function returns a `LogoutResponse` with the same structure as `BootstrapResponse`. ```javascript import { logout } from "@salesforce/analytics-embedding-sdk"; // Logout from all orgs const response = await logout(); // Logout from specific orgs const response = await logout([ "https://org1.lightning.force.com", "https://org2.lightning.force.com", ]); console.log(response.status); // 'Success', 'Partial Success', or 'Failure' console.log(response.message); // Detailed logout message ``` ### Example Logout Response ```json { "message": "Log out for all orgs complete", "status": "Success", "orgStates": { "https://org1.lightning.force.com": { "state": "LOGGED_OUT", "reason": "" }, "https://org2.lightning.force.com": { "state": "LOGGED_OUT", "reason": "" } } } ``` **See Also** - [`logout`](/docs/analytics/sdk/references/sdk-js-v2/logout.html) - [`LogoutResponse`](/docs/analytics/sdk/references/sdk-js-v2/LogoutResponse.html) # lower() Returns a copy of the string with all characters in lower case. ## Syntax `lower`(_string_) ## Usage Returns `null` if _string_ is `null`. ## Example ```nolang lower("JAVA") == "java" ``` # lower({str}) Returns a copy of string _str_ with all cased characters converted to lowercase. ## Example This example returns the first five entries in the City column in lowercase. ```nolang SELECT lower(City) as "lCity" FROM "Superstore" GROUP BY City LIMIT 5; ``` | lCity | | ----------- | | aberdeen | | abilene | | akron | | albuquerque | | alexandria | # ltrim() Removes the specified characters from the beginning of a string. ## Syntax `ltrim`(_string_,_substr_) ## Usage Removes every instance of each character in _substr_ from the beginning of _string_. This function is case-sensitive. To remove leading spaces, do not specify a value for _substr_. ## Example This example shows that `ltrim` removes the specified characters from the beginning of a string. This function is case-sensitive. ```nolang q = load "test"; q = foreach q generate 'Company' as 'Company', ltrim('Company',"abc") as 'ltrim abc', ltrim('Company',"cba") as 'ltrim cba', ltrim('Company',"ab") as 'ltrim ab', ltrim('Company',"bc") as 'ltrim bc'; ``` ![Diagram showing number of close opps, grouped by day of the week they were closed.](https://developer.salesforce.com/media/bi_dev_guide_saql/ltrim.png) # Macro Examples The following examples show the structure and syntax of macros in rules. Here’s an example macro showing the use of attributes, parameters, and `“path”` statements. ```nolang "macros": [
        {
            "namespace": "myMacroNamespace", 
           "definitions": [
                {
                    "name": "multiplyTwoNumbers", 
                   "parameters": [
                        "firstNumber", 
                       "secondNumber"
                    ], 
                   "returns": "${p.firstNumber * p.secondNumber}"
                }, 
                {
                    "name": "deleteWidget", 
                   "description": "Deletes a widget and any references to the widget.", 
                   "parameters": [
                        "widgetName"
                    ], 
                   "actions": [
                        {
                            "action": "eval", 
                           "key": "results", 
                           "path": "${json:searchPaths(\”$.state.widget['p.widgetName']\”)}”
                        }, 
                        {
                            "condition": "${!empty results}", 
                           "action": "delete", 
                           "path": "$.state.widgets['${p.widgetName}']"
                        }, 
                        {
                            "condition": "${!empty results}", 
                           "action": "delete", 
                           "path": "$.state.gridLayouts..pages..widgets[?(@.name=='${p.widgetName}')]"
                        }
                    ]
                }
            ]
        }
    ], 
    "constants": [...], 
    "rules": [...]
} ``` The following example calls a macro with namespace `'myNS'` and macro name `'getSomething'` defined with no parameters. Results of the macro are stored in the template context, and can be referenced using this expression: `${Rules.Eval.macroResults}`. ```nolang {  "action": "eval",  "key": "macroResults",  "value": "${myNS:getSomething()}" } ``` This example sets the JSON node at path \$.path.to.json.node with the result of macro `myNS:getJsonValue` defined with no parameters. This action will only be called if the macro `myNS:shouldExecute` (defined with one parameter) returns true. ```nolang {  "action": "set",  "condition": "${myNS:shouldExecute(true)}",  "path": "$.path.to.json.node",  "value": "${myNS:getJsonValue()}" } ``` # Macro Use Case: Add an Array of SObject Names to Extract Workflow Here’s a macro that adds an array of `sObject` names to the extract workflow. ## Example Macro ```nolang {     "name" : "concatArrayFieldName",     "description" : "Concatenates field names from an sobject array node",     "parameters" :     [     "variable"     ],     "returns": "${array:concat(Rules.CurrentNode, array:forEach(p.variable,'{\"name\":\"${var.fieldName}\"}'))}"         },     {     "name" : "addToExtractCaseWorkflow",     "description" : "Adds array fields to Extract Case node",     "parameters" :     [     "variable"     ],     "actions": [     {     "action": "set",           "description": "put selected values for sfdcDigest in dataflow",           "path": "$.workflowDefinition.Extract_Case.parameters.fields",           "value" : "${macros:concatArrayFieldName(p.variable)}"           }           ]     } ``` ## Example Rule Calling the Macro ```nolang {          "action": "eval",          "description": "put selected values for sfdcDigest in dataflow",          "value": "${macros:addToExtractCaseWorkflow(Variables.CaseMoreDims)}"        } ``` # Macro Use Case: Delete Workflow Nodes Use this macro to delete multiple nodes from the workflow without having to write multiple actions. ## Example Macro ```nolang        {            "name": "deleteWorkflowNode",            "description": "Deletes a workflow node.",            "parameters": [                "nodeName"            ],            "actions": [                { "action": "delete",  "path": "$.workflowDefinition.${p.nodeName}"}            ]        },        {            "name": "deleteArrayOfWorkflowNodes",            "description": "Deletes a set of workflow nodes.",            "parameters": [                "nodeNameArray"            ],            "actions": [                { "action": "eval",                  "value": "${array:forEach(p.nodeNameArray, '${macros:deleteWorkflowNode(var)}')}"}            ]        } ``` ## Example Rule Calling the Macro ```nolang {"action":"eval","key" : "myArray","value":["Extract_Queue","Add_Fields_To_Queue","Append_Queue_User"]},     {          "action": "eval",          "description": "remove multiple nodes in dataflow",          "value": "${macros:deleteArrayOfWorkflowNodes(Rules.Eval.myArray)}"        } ``` # Macro Use Case: Recursive Operations Here’s an example of a macro that deletes an `sfdcDigest` node. It also deletes the digest node and all other nodes that depend on that node. This macro deletes the specified node and dynamically queries the JSON document to delete each dependency of those nodes. Consider the simplified JSON below. To delete 'node3' and its dependencies, the result should delete: node3, node4, node5 (depends on node4), node6 (depends on node5), node7, node8, node9. ## Example Example JSON ```nolang {    "node1": { },    "node2": {        "dependsOn": "node1"    },    "node3": {        "dependsOn": "node2"    },    "node4": {        "dependsOn": "node3"    },    "node5": {        "dependsOn": "node4"    },    "node6": {        "dependsOn": "node5"    },    "node7": {        "dependsOn": "node3"    },    "node8": {        "dependsOn": "node3"    },    "node9": {        "dependsOn": "node3"    } } ``` ## Example Without Macro Without using a macro (and associated enhancements), nodes would have to be deleted individually. ```nolang {    "actions": [        {            "action": "delete",            "path": "$.node3"        },        {            "action": "delete",            "path": "$.node4"        },       {            "action": "delete",            "path": "$.node5"        },       {            "action": "delete",            "path": "$.node6"        },        {            "action": "delete",            "path": "$.node7"        },        {            "action": "delete",            "path": "$.node8"        },        {            "action": "delete",            "path": "$.node9"        }    ] } ``` This code is rigid and difficult to maintain because rules would need to be modified as node dependencies are added and removed from the JSON payload. ## Example Macro Source ```nolang {
    "namespace": "macroRecursion", 
   "definitions": [
        {
            "name": "deleteNodeAndDependencies", 
           "description": "Delete a node and its dependencies.  Returns an array of json paths of all the nodes that were deleted.", 
           "parameters": [
                "nodeName"
            ], 
           "actions": [
                {"action": "eval", "key": "fullNodePath",  "value": "$.${p.nodeName}" }, 
               {"action": "eval", "key": "dependencies",  "value": "${macroRecursion:getDependents(p.nodeName)}"}, 
               {
                  "action": "eval", 
                 "value": "${array:forEach(Rules.Eval.dependencies, '${macroRecursion:deleteNodeAndDependencies(macroRecursion:deleteSingleNodeByFullJsonPath(var))}')}"
                }, 
                {
                    "action": "eval", 
                   "value": "${macroRecursion:deleteSingleNodeByFullJsonPath(Rules.Eval.fullNodePath)}"
                }
            ]
        }, 
        {
            "name": "deleteSingleNodeByFullJsonPath", 
           "description": "Deletes a node by full json path.", 
           "parameters": [
                "fullJsonPath"
            ], 
           "actions": [
               {"action": "eval", "key": "pathSegments",  "value": "${string:match(p.fullJsonPath,'\\\\[\\'(.*?)\\'\\\\]')}"}, 
              { "action": "delete",  "path": "${p.fullJsonPath}"}
            ], 
           "returns": "${array:last(Rules.Eval.pathSegments)}"
        }, 
        {
            "name": "getDependents", 
           "description": "Returns the full json path to search results", 
           "parameters": [
                "nodeName"
            ], 
           "actions": [
               { "action": "eval", "key": "searchString", "value": "$.*[?(@.dependsOn=='${p.nodeName}')]"}, 
              { "action": "eval", "key": "paths", "value": "${json:searchPaths(Rules.Eval.searchString)}"}
            ], 
           "returns": "${Rules.Eval.paths}"
        }
    ]
} ``` ## Example Rule Calling the Macro ```nolang {    "rules": [        {            "name": "Recursively delete node3 and dependencies",            "actions": [                {"action": "eval", "value": "${macroRecursion:deleteNodeAndDependencies('node3')}" }            ]        }    ] } ``` # Macros in Rules Use a macro when a single rule executes repeatedly on different JSON node paths. Rule macros let template developers define repeatable, well-tested rule code units that you can call within the context of any JSON transformation. Macros simplify the rule definition source and make it easier to maintain. You invoke macros using standard function syntax. Reference them anywhere a traditional expression is resolved within a rule action. In template rules, macros can be referenced by an `eval` action. Macros can include actions and can reference other macros, and macro recursion is supported. Templates support a macro depth of 10. Exceeding that depth results in an overflow error and app creation failure. For example, consider the following macro for multiplying two numbers: ```json { "namespace": "testMacroNamespace", "definitions": [ { "name": "multiplyTwoNumbers", "parameters": [ "firstNumber", "secondNumber" ], "returns": "${p.firstNumber * p.secondNumber}" }, { "name": "shouldExecuteAction", "returns": true } ] } ``` It can be invoked in rules actions as follows: ```json { "rules": [ { "name": "Testing of example macro", "actions": [ { "action": "set", "key": "macroResult", "path": "$.path.to.a.number", "value": "${testMacroNamespace:multiplyTwoNumbers(3,3)}" }, { "action": "put", "condition": "${testMacroNamespace:shouldExecuteAction()}", "path": "$.my.json.path", "value": { "foo": "bar", "anotherNumber": "${testMacroNamespace:multiplyTwoNumbers(5,5)}" } } ] } ] } ``` ## Macro Object and Macro Definition A rule macro object contains a collection of macro definition objects. Macro definition objects define the logic of macros and their return values. Macro object attributes are as follows: - `namespace`: A unique string identifier (to the template) used to scope the collection of macro definitions. - `definitions`: Array of macro definition objects defined within the rule macro. Macro definition object attributes are as follows: - `name`: The name of the macro. - `description`: A string that describes what the macro does. - `parameters`: An array of zero or more parameter names that the macro expects. - `actions`: An array of zero or more rule actions to perform as part of the macro. - `returns`: An expression or literal value to be returned from the macro. The number of parameters passed in the macro function call must match the number of parameters defined in the macro. They’re passed in the order defined in the macro definition. You can use a maximum of 10 parameters per macro. Parameters can be referenced in the body of the macro using standard expression syntax: `${p.}`. Parameters can be referenced in any action that accepts expressions. Macros in actions support `path` statements so that expressions can be used for more dynamic JSON path handling. Parameters are scoped to the execution of the macro call, and any references to `${p.}` fail outside the scope of the macro. ## Macro Examples An example macro showing multiple definitions including `path` statements. ```json "macros": [       {           "namespace": "myMacroNamespace",           "definitions": [                {                   "name": "multiplyTwoNumbers",                   "parameters": [                       "firstNumber",                       "secondNumber"                    ],                   "returns": "${p.firstNumber * p.secondNumber}"                },                {                   "name": "deleteWidget",                   "description": "Deletes a widget and any references to the widget.",                   "parameters": [                       "widgetName"                   ],                   "actions": [                      {                       "action": "eval",                        "key": "results",                        "path": "${json:searchPaths(\"$.state.widget['p.widgetName']\")}"                      },                      {                         "condition": "${!empty results}",                         "action": "delete",                         "path": "$.state.widgets['${p.widgetName}']"                      },                      {                         "condition": "${!empty results}",                         "action": "delete",                         "path": "$.state.gridLayouts..pages..widgets[?(@.name=='${p.widgetName}')]"                      }                   ]               }           ]       }   ],  "constants": [...],  "rules": [...]} ``` This example calls a macro with namespace `myNS` and macro name `getSomething` defined with no parameters. The results of the macro are stored in the template context, and can be referenced using this expression: `${Rules.Eval.macroResults}`. ```json {  "action": "eval",  "key": "macroResults",  "value": "${myNS:getSomething()}" } ``` This example sets the JSON node at path `$.path.to.json.node` with the result of macro `myNS:getJsonValue` defined with no parameters. This action is only called if the macro `myNS:shouldExecute` (defined with one parameter) returns true. ```json {  "action": "set",  "condition": "${myNS:shouldExecute(true)}",  "path": "$.path.to.json.node",  "value": "${myNS:getJsonValue()}" } ``` **See Also** - [Work with App Template Framework Rules](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-overview.md) # Macros in Rules Use a macro when a single rule executes repeatedly on different JSON node paths. Rule macros enable template developers to define repeatable, well-tested rule code units that can be called within the context of any JSON transformation, simplifying and making the rule definition source easier to maintain. You invoke macros using standard function syntax. Reference them anywhere a traditional expression is resolved within a rule action. In template rules, macros can be referenced by an ‘eval’ action. Macros can include actions and can reference other macros, and macro recursion is supported. Template support a macro depth of 10; beyond that results in an overflow error and app creation failure. For example, consider the following macro for multiplying two numbers: ```nolang { "namespace": "testMacroNamespace", "definitions": [ { "name": "multiplyTwoNumbers", "parameters": [ "firstNumber", "secondNumber" ], "returns": "${p.firstNumber * p.secondNumber}" }, { "name": "shouldExecuteAction", "returns": true } ] } ``` It can be invoked in rules actions as follows: ```nolang { "rules": [ { "name": "Testing of example macro", "actions": [ { "action": "set", "key": "macroResult", "path": "$.path.to.a.number", "value": "${testMacroNamespace:multiplyTwoNumbers(3,3)}" }, { "action": "put", "condition": "${testMacroNamespace:shouldExecuteAction()}", "path": "$.my.json.path", "value": { "foo": "bar", "anotherNumber": “${testMacroNamespace:multiplyTwoNumbers(5,5)}” } } ] } ] } ``` - **[Rule Macro And Macro Definition Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-rulemacro-attributes.md)** A rule macro object contains a collection of macro definition objects. Macro definition objects define the logic of macros and their return values. - **[Macro Examples](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templates-dev-macro-examples.md)** The following examples show the structure and syntax of macros in rules. - **[Macro Use Case: Recursive Operations](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-rules-macros-sample-recursive.md)** Here’s an example of a macro that deletes an `sfdcDigest` node. It also deletes the digest node and all other nodes that depend on that node. - **[Macro Use Case: Delete Workflow Nodes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-rules-macros-sample-delete.md)** Use this macro to delete multiple nodes from the workflow without having to write multiple actions. - **[Macro Use Case: Add an Array of SObject Names to Extract Workflow](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-rules-macros-sample-add-array.md)** Here’s a macro that adds an array of `sObject` names to the extract workflow. # Macros Use Case: Recursive Operations Here’s an example of a macro that deletes a `sfdcDigest` node. It also deletes the digest node and all other nodes that depend on that node. This macro deletes the specified node and dynamically queries the JSON document to delete each dependency of those nodes. Consider the simplified JSON below. To delete `node3` and its dependencies, the result should delete: `node3`, `node4`, `node5` (depends on `node4`), `node6` (depends on `node5`), `node7`, `node8`, and `node9`. ## Example Example JSON ```json {    "node1": { },    "node2": {        "dependsOn": "node1"    },    "node3": {        "dependsOn": "node2"    },    "node4": {        "dependsOn": "node3"    },    "node5": {        "dependsOn": "node4"    },    "node6": {        "dependsOn": "node5"    },    "node7": {        "dependsOn": "node3"    },    "node8": {        "dependsOn": "node3"    },    "node9": {        "dependsOn": "node3"    } } ``` ## Example Without Macro Without using a macro (and associated enhancements), nodes would have to be deleted individually. ```json {    "rules": [        {            "name": "Delete node3 and dependencies",            "actions": [        {            "action": "delete",            "path": "$.node3"        },        {            "action": "delete",            "path": "$.node4"        },       {            "action": "delete",            "path": "$.node5"        },       {            "action": "delete",            "path": "$.node6"        },        {            "action": "delete",            "path": "$.node7"        },        {            "action": "delete",            "path": "$.node8"        },        {            "action": "delete",            "path": "$.node9"        }    ] } ] } ``` This code is rigid and difficult to maintain because the rules need to be modified as node dependencies are added and removed from the JSON payload. ## Example with a Recursive Macro ```json {    "namespace": "macroRecursion",   "definitions": [        {            "name": "deleteNodeAndDependencies",           "description": "Delete a node and its dependencies.  Returns an array of json paths of all the nodes that were deleted.",           "parameters": [                "nodeName"            ],           "actions": [                { "action": "eval",  "key": "fullNodePath", "value": "$.${p.nodeName}" },               { "action": "eval", "key": "dependencies",   "value": "${macroRecursion:getDependents(p.nodeName)}" },               {                  "action": "eval",                 "value": "${array:forEach(Rules.Eval.dependencies, '${macroRecursion:deleteNodeAndDependencies(macroRecursion:deleteSingleNodeByFullJsonPath(var))}')}"                },               {                   "action": "eval",                  "value": "${macroRecursion:deleteSingleNodeByFullJsonPath(Rules.Eval.fullNodePath)}"                }            ]        },       {            "name": "deleteSingleNodeByFullJsonPath",           "description": "Deletes a node by full json path.",           "parameters": [                "fullJsonPath"            ],           "actions": [              { "action": "eval", "key": "pathSegments", "value": "${string:match(p.fullJsonPath,'\\\\[\\'(.*?)\\'\\\\]')}" },             { "action": "delete",   "path": "${p.fullJsonPath}" }            ],           "returns": "${array:last(Rules.Eval.pathSegments)}"        },       {            "name": "getDependents",           "description": "Returns the full json path to search results",           "parameters": [                "nodeName"            ],           "actions": [              { "action": "eval", "key": "searchString",  "value": "$.*[?(@.dependsOn=='${p.nodeName}')]" },             { "action": "eval", "key": "paths", "value": "${json:searchPaths(Rules.Eval.searchString)}" }            ],           "returns": "${Rules.Eval.paths}"        }    ] } ``` Then, use a rule to call the macro: ```json {    "rules": [        {            "name": "Recursively delete node3 and dependencies",            "actions": [                { "action": "eval", "value": "${macroRecursion:deleteNodeAndDependencies('node3')}" }            ]        }    ] } ``` [Back to Macros in Rules](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-macros.md) # Manage the Upload After you’ve created a header and uploaded the data parts by using the `InsightsExternalData` and InsightsExternalDataPart objects, update the Action field on the header object to `Process` to start processing the data. The following example sets the Action field and updates the row in the InsightsExternalData object. ```nolang SObject sobj = new SObject(); sobj.setType("InsightsExternalData"); sobj.setField("Action","Process"); sobj.setId(parentID); // This is the rowID from the previous example. SaveResult[] results = partnerConnection.update(new SObject[] { sobj }); for(SaveResult sv:results) if(sv.isSuccess()) rowId = sv.getId(); ``` When the Action field is set to `Process`, a dataflow job is created and marked active. You can monitor the Status field of the header object to determine when the file upload is completed. After the Action field is updated to request processing, no user edits are allowed on the objects. # Math Functions To perform numeric operations in a SAQL query, use math functions. You can use SAQL math functions in `foreach` statements and in the `filter by` clause after a `foreach` statement. You can't use math functions in a `group by` clause or in an `order by` clause. You also can't use math functions in the `filter by` clause before a `foreach` statement. - **[abs(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-abs.md)** Returns the absolute number of _n_ as a numeric value. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. This function can only be used in a `foreach` statement. - **[acos(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-acos.md)** Returns the arccosine value of radians value _n_. _n_ can be any real numeric value in the range of -1 \<= _n_ \<= 1. If `null` is passed as an argument, `acos()` returns `null`. This function can only be used in a `foreach` statement. - **[asin(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-asin.md)** Returns the arcsine value of radians value _n_. _n_ can be any real numeric value in the range of -1 \<= _n_ \<= 1. If `null` is passed as an argument, `asin()` returns `null`.This function can only be used in a `foreach` statement. - **[atan(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-atan.md)** Returns the arctangent value of radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `atan()` returns `null`. This function can only be used in a `foreach` statement. - **[ceil(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-ceil.md)** Returns the nearest integer of equal or greater value to _n_. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. This function can only be used in a `foreach` statement. - **[cos(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-cos.md)** Returns the cosine value of radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `cos()` returns `null`. This function can only be used in a `foreach` statement. - **[degrees(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-degrees.md)** Returns the degrees value of a radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `degrees()` returns `null`. This function can only be used in a `foreach` statement. - **[exp(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-exp.md)** Returns the value of Euler's number _e_ raised to the power of _n_, where _e_ = 2.71828183… The smallest value for _n_ that doesn’t result in 0 is 3e-324. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 700. This function can only be used in a `foreach` statement. - **[floor(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-floor.md)** Returns the nearest integer of equal or lesser value to _n_. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. This function can only be used in a `foreach` statement. - **[log(m, n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-log.md)** Returns the natural logarithm (base m) of a number _n_. The values _m_ and _n_ can be any positive, non-zero numeric value in the range 0 \< m, n \<= 1e308 and m ≠ 1. The smallest value for _m_ or _n_ that will not produce 0 is log(10, 0.3e-323). This function can only be used in a `foreach` statement. - **[pi()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-pi.md)** Returns the value of π, where π=3.14139265. This function can only be used in a `foreach` statement. - **[power(m, n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-power.md)** Returns _m_ raised to the _n_th power. _m_, _n_ can be any numeric value in the range of -1e308 \<= _m_, _n_ \<= 1e308. Returns `null` if _m_ = 0 and _n_ \< 0. This function can only be used in a `foreach` statement. - **[radians(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-radians.md)** Returns the radians value of a degrees value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `radians()` returns `null`. This function can only be used in a `foreach` statement. - **[round(n[, m])](bi-saql-functions-math-round.md)** Returns the value of _n_ rounded to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ rounded to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ rounded to the nearest integer. For tie-breaking, it follows round half way from zero convention. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. _m_ can be an integer value between -15 and 15, inclusive. This function can only be used in a `foreach` statement. - **[sign(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-sign.md)** Returns 1 if the numeric value, _n_ is positive. It returns -1 if the _n_ is negative, and 0 if _n_ is 0. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `sign()` returns `null`. This function can only be used in a `foreach` statement. - **[sin(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-sin.md)** Returns the sine value of radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `sin()` returns `null`. This function can only be used in a `foreach` statement. - **[sqrt(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-sqrt.md)** Returns the square root of a number _n_. The value _n_ can be any non-negative numeric value in the range of 0 \<= _n_ \<= 1e308. This function can only be used in a `foreach` statement. - **[tan(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-tan.md)** Returns the tangent value of radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `tan()` returns `null`. This function can only be used in a `foreach` statement. - **[trunc(n[, m])](bi-saql-functions-math-trunc.md)** Returns the value of the numeric expression _n_ truncated to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ truncated to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ truncated to the integer place. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. _m_ can be an integer value between -15 and 15 inclusive. This function can only be used in a `foreach` statement. # Math Functions SQL for CRM Analytics supports the following math functions. - **[abs(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-abs.md)** Returns the absolute number of _n_ as a numeric value. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. - **[acos(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-acos.md)** Returns the arccosine value of radians value `{n}`. `{n}` can be any real number in the range of -1 \<= `{n}` \<= 1. If `null` is passed as an argument, `acos()` returns `null`. - **[asin(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-asin.md)** Returns the arcsine value of radians value `{n}`. `{n}` can be any real number in the range of -1 \<= `{n}` \<= 1. If `null` is passed as an argument, `sin()` returns `null`. - **[atan(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-atan.md)** Returns the arctan value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `atan()` returns `null`. - **[ceil(n), ceiling(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-ceil.md)** Returns the nearest integer of equal or greater value to _n_. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. - **[cos(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-cos.md)** Returns the cosine value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `cos()` returns `null`. - **[degrees(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-degrees.md)** Returns the degrees value of `{n}` radians. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `radians()` returns `null`. - **[exp(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-exp.md)** Returns the value of Euler's number e raised to the power of _n_, where e = 2.71828183… The smallest value for _n_ that does not result in 0 is 3e-324. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 700. - **[floor(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-floor.md)** Returns the nearest integer of equal or lesser value to n. n can be any real numeric value in the range of -1.797e308\<= n \<= 1.797e308. - **[ln(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-ln.md)** Returns the base e (Euler's number) logarithm of a number _n_. The value _n_ can be any positive, non-zero numeric value in the range 0 \< _n_ \<= 1.797e308. - **[log(m,n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-log.md)** Returns the natural logarithm (base m) of a number n. The values m and n can be any positive, non-zero numeric value in the range 0 \< m, n \<= 1.797e308 and m ≠ 1. - **[log10(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-log10.md)** Returns the base 10 logarithm of a number _n_. The value _n_ can be any positive, non-zero numeric value in the range 0 \< _n_ \<= 1.797e308. - **[pi()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-pi.md)** Returns the value of constant π, where π=3.14159. - **[power(m,n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-power.md)** Returns _m_ raised to the _n_th power. _m_, _n_ can be any numeric value in the range of -1.797e308 \<= _m_, _n_ \<= 1.797e308. Returns null if _m_ = 0 and _n_ \< 0. - **[radians(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-radians.md)** Returns the radians value of `{n}` degrees. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `radians()` returns `null`. - **[round(n[,m])](bi-sql-math-round.md)** Returns the value of _n_ rounded to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ rounded to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ rounded to the nearest integer. For tie-breaking, it follows round half way from zero convention. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. _m_ can be an integer value between -15 and 15, inclusive. - **[sign(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-sign.md)** Returns 1 if the numeric value, `{n}` is positive. It returns -1 if the `{n}` is negative, and 0 if `{n}` is 0. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. - **[sin(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-sin.md)** Returns the sine value of radians value `{n}`. `{n}`can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `sin()` returns `null`. - **[sqrt(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-sqrt.md)** Returns the square root of a number _n_. The value _n_ can be any non-negative numeric value in the range of 0 \<= _n_ \<= 1.797e308. - **[tan(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-tan.md)** Returns the tan value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `tan()` returns `null`. - **[trunc(n[,m])](bi-sql-math-trunc.md)** Returns the value of the numeric expression _n_ truncated to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ truncated to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ truncated to the integer place. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. _m_ can be an integer value between -15 and 15 inclusive. # max() Returns the maximum value of a dimension or measure field. ## Example - Find the Largest Opportunity for Each Account ```nolang q = load "Ops"; q = group q by 'Account_Name'; q = foreach q generate 'Company' as 'Company', max('Amount') as 'Largest Deal'; ``` ## Example - Find the Last Value in List of Airline Destinations per Origin For dimensions, `max()` sorts the values alphabetically and the last value is returned. ```nolang q = load "Airlines"; q = group q by 'origin'; q = foreach q generate 'origin' as 'Origin', max('dest') as 'Max Destination'; ``` **See Also** - [min()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-min.md) # max() Returns the highest row value in a numeric column. `max()` follows this syntax. ```nolang SELECT max(COLUMN_NAME) FROM DATASET WHERE CONDITION; ``` # Measure and Group Bindings in Compact-Form and SAQL-Form Queries You can use bindings in compact-form queries and SAQL-form queries. Let's look at an example where the selections in two custom queries (`StaticSAQLMeasureNames` and `StaticSAQLGroupingNames`) determine the measure and grouping of a SAQL-form query. Notice that the bindings for both measures and groups are defined in two places. To learn more about strings, numbers, and groups fields, see [SAQL Step Type Properties](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_json.meta/bi_dev_guide_json/bi_dbjson_steps_types_saql.htm). ```json {     "label": "New dashboard",     "mobileDisabled": false,     "state": {         "steps": {             "lens_1": {                 "type": "saql",                 "query": "q = load \"OpportunityWithAccount\";\nq = group q by {{column(StaticSAQLGroupingNames.selection, [\"value\"]).asGrouping()}};\nq = foreach q generate {{row(StaticSAQLGroupingNames.selection, [], [\"expression\", \"alias\"]).asProjection()}}, {{row(StaticSAQLMeasureNames.selection, [], [\"expression\", \"alias\"]).asProjection()}};\nq = order q by ‘AccountId.Industry’ asc;\nq = limit q 2000;",                 "useGlobal": true,                 "numbers": "{{column(StaticSAQLMeasureNames.selection, [\"alias\"]).asObject()}}",                 "groups": "{{column(StaticSAQLGroupingNames.selection, [\"alias\"]).asObject()}}",                 "strings": "{{column(StaticSAQLGroupingNames.selection, [\"alias\"]).asObject()}}",                 "visualizationParameters": {},                 "selectMode": "single",                 "broadcastFacet": true,                 "receiveFacetSource": {                     "mode": "all",                     "steps": []                 }             },             "StaticSAQLMeasureNames": {                 "datasets": [],                 "dimensions": [],                 "isFacet": true,                 "isGlobal": false,                 "selectMode": "singlerequired",                 "start": {                     "display": [                         "Total Amount"                     ]                 },                 "type": "staticflex",                 "useGlobal": true,                 "values": [                     {                         "display": "Total Amount",                         "cf": [                             "sum",                             "Amount"                         ],                         "expression": "sum(‘Amount’)",                         "alias": "sum_Amount"                     },                     {                         "display": "Avg Amount",                         "cf": [                             "avg",                             "Amount"                         ],                         "expression": "avg(‘Amount’)",                         "alias": "avg_Amount"                     }                 ],                 "numbers": [],                 "strings": [],                 "groups": [],                 "columns": {},                 "broadcastFacet": true             },             "StaticSAQLGroupingNames": {                 "datasets": [],                 "dimensions": [],                 "isFacet": true,                 "isGlobal": false,                 "selectMode": "multirequired",                 "start": {                     "display": [                         "Country"                     ]                 },                 "type": "staticflex",                 "useGlobal": true,                 "values": [                     {                         "display": "Industry",                         "value": "AccountId.Industry",                         "expression": "‘AccountId.Industry’",                         "alias": "AccountId.Industry"                     },                     {                         "display": "Source",                         "value": "AccountId.AccountSource",                         "expression": "‘AccountId.AccountSource’",                         "alias": "AccountId.AccountSource"                     }                 ],                 "numbers": [],                 "strings": [],                 "groups": [],                 "columns": {},                 "broadcastFacet": true             }         },         "widgets": {             "pillbox_3": {                 "type": "pillbox",                 "parameters": {                     "compact": false,                     "showActionMenu": true,                     "exploreLink": false,                     "fontSize": 14,                     "textColor": "#0070D2",                     "selectedTab": {                         "textColor": "#FFFFFF",                         "backgroundColor": "#0070D2",                         "borderEdges": [                             "all"                         ],                         "borderColor": "#C6D3E1",                         "borderWidth": 1                     },                     "step": "StaticSAQLGroupingNames"                 }             },             "pillbox_4": {                 "type": "pillbox",                 "parameters": {                     "compact": false,                     "showActionMenu": true,                     "exploreLink": false,                     "fontSize": 14,                     "textColor": "#0070D2",                     "selectedTab": {                         "textColor": "#FFFFFF",                         "backgroundColor": "#0070D2",                         "borderEdges": [                             "all"                         ],                         "borderColor": "#C6D3E1",                         "borderWidth": 1                     },                     "step": "StaticSAQLMeasureNames"                 }             },             "chart_1": {                 "type": "chart",                 "parameters": {                     "visualizationType": "hbar",                     "title": {                         "label": "",                         "fontSize": 14,                         "subtitleLabel": "",                         "subtitleFontSize": 11,                         "align": "center"                     },                     "theme": "wave",                     "showValues": true,                     "axisMode": "multi",                     "autoFitMode": "keepLabels",                     "binValues": false,                     "bins": {                         "breakpoints": {                             "low": 0,                             "high": 100                         },                         "bands": {                             "low": {                                 "label": "",                                 "color": "#B22222"                             },                             "medium": {                                 "label": "",                                 "color": "#FFA500"                             },                             "high": {                                 "label": "",                                 "color": "#008000"                             }                         }                     },                     "dimensionAxis": {                         "showAxis": true,                         "showTitle": true,                         "title": "",                         "customSize": "auto",                         "icons": {                             "useIcons": false,                             "iconProps": {                                 "column": "",                                 "fit": "cover",                                 "type": "round"                             }                         }                     },                     "measureAxis1": {                         "sqrtScale": false,                         "showAxis": true,                         "customDomain": {                             "showDomain": false                         },                         "showTitle": true,                         "title": ""                     },                     "measureAxis2": {                         "sqrtScale": false,                         "showAxis": true,                         "customDomain": {                             "showDomain": false                         },                         "showTitle": true,                         "title": ""                     },                     "legend": {                         "show": true,                         "showHeader": true,                         "inside": false,                         "descOrder": false,                         "position": "right-top",                         "customSize": "auto"                     },                     "tooltip": {                         "customizeTooltip": false,                         "showDimensions": true,                         "dimensions": "",                         "showMeasures": true,                         "measures": "",                         "showPercentage": true,                         "showNullValues": true,                         "showBinLabel": true                     },                     "trellis": {                         "enable": false,                         "showGridLines": true,                         "flipLabels": false,                         "type": "x",                         "chartsPerLine": 4,                         "size": [                             100,                             100                         ]                     },                     "applyConditionalFormatting": true,                     "showActionMenu": true,                     "exploreLink": true,                     "step": "lens_1"                 }             }         },         "filters": [],         "gridLayouts": [             {                 "name": "Default",                 "numColumns": 12,                 "rowHeight": "normal",                 "version": 1,                 "pages": [                     {                         "label": "Untitled",                         "name": "36d03d4a-cdce-427e-b338-4ae29db1ba26",                         "widgets": [                             {                                 "row": 0,                                 "column": 6,                                 "rowspan": 2,                                 "colspan": 6,                                 "name": "pillbox_3",                                 "widgetStyle": {}                             },                             {                                 "row": 2,                                 "column": 6,                                 "rowspan": 2,                                 "colspan": 6,                                 "name": "pillbox_4",                                 "widgetStyle": {}                             },                             {                                 "row": 0,                                 "column": 0,                                 "rowspan": 4,                                 "colspan": 6,                                 "name": "chart_1",                                 "widgetStyle": {}                             }                         ],                         "navigationHidden": false                     }                 ],                 "selectors": [],                 "style": {                     "backgroundColor": "#F2F6FA",                     "gutterColor": "#C5D3E0",                     "cellSpacingX": 8,                     "cellSpacingY": 8,                     "fit": "original",                     "alignmentX": "left",                     "alignmentY": "top"                 }             }         ],         "dataSourceLinks": [],         "widgetStyle": {             "backgroundColor": "#FFFFFF",             "borderEdges": [],             "borderColor": "#E6ECF2",             "borderWidth": 1,             "borderRadius": 0         }     },     "datasets": [         {             "id": "Edgemart13",             "name": "OpportunityWithAccount",             "label": "Opportunity With Accounts",             "url": "../../WaveCommon/repo/edgemarts/OpportunityWithAccount/OpportunityWithAccountEM"         }     ] } ``` **note:** If you bind a measure or grouping in a compact-form or SAQL-form step used for a chart, you must also replace the `columnMap` section in the widget-level chart JSON with an empty `columns` array. For more information, see [Measure Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-measure.md) and [Group Interactions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-bindings/guide/bi-dashboard-bindings-wave-designer-use-case-group.md). **note:** If you provide an aggregate function for a measure, then the measure value must be a string, not an array. # Measure Interactions Bind the measure to allow the dashboard viewer to select which measures to show in a widget. For example, you can show different measures in a chart based on the selection in a toggle widget. To dynamically set the measure in a query based on a selection, complete these tasks. - Bind the `measures` property of the query. - If the query is used for a chart, replace the `columnMap` section of the widget with an empty `columns` array. Why? Because when you change the query, the set of fields is different from what’s in the `columnMap` section. When you replace the `columnMap` property with an empty `columns` array, the system remaps the columns based on the new query definition. - Binding isn’t allowed using the `columnMap` property. Let’s look at an example where we bind the measure for a donut chart based on the selection in the toggle widget. ![The toggle widgets allow you to choose a measure to display in the map chart.](https://developer.salesforce.com/docs/media/bi_dev_guide_bindings/bi_212_chart_bindings.png) The toggle widget uses this custom query. ```json "MeasuresController_1": { "type": "staticflex", "label": "MeasuresController", "values": [ { "display": "Total Amount", "step_property": [ "sum", "Amount" ] }, { "display": "Average Amount", "step_property": [ "avg", "Amount" ] }, { "display": "Count of Rows", "step_property": [ "count", "*" ] } ], "selectMode": "singlerequired", "start": { "display": [ "Total Amount" ] }, "broadcastFacet": true, "groups": [], "numbers": [], "strings": [] } ``` Each toggle option has one display label (`display`) that appears in the toggle. It also has one value (`step_property`) that determines the measure. Let’s bind the `step_property` field of the custom query (`MeasuresController_1`) to the measure in the donut chart’s step (`PieByProduct_2`). Any selection in the custom query passes the aggregation method (like sum or count) and the measure field to the `PieByProduct_2` query. ```json "PieByProduct_2": { "label": "PieByProduct_2", "query": { "measures": [ "{{ cell(MeasuresController_1.selection, 0, \\"step_property\\").asObject() }}" ], "groups": [ "Product" ] }, "visualizationParameters": { ... }, "receiveFacet": true, "selectMode": "single", "type": "aggregateflex", "isGlobal": false, "useGlobal": true, "broadcastFacet": true, "datasets": [ { "id": "0FbB00000000q5gKAA", "label": "Flexy Sales", "name": "Flexy_Sales", "url": "/services/data/v42.0/wave/datasets/0FbB00000000q5gKAA" } ] } ``` When you create the donut chart, by default, the widget (`chart_2`) contains the `columnMap` section that maps measures and groupings to chart attributes. ```json "chart_2": { "type": "chart", "parameters": { "visualizationType": "pie", "step": "PieByProduct_2", "columnMap": { "trellis": [], "dimension": [ "Product" ], "plots": [ "sum_Amount" ] }, ... } } } ``` **note:** The properties under the `columnMap` property vary based on the chart type. For the interaction to work correctly, replace the `columnMap` section with an empty `columns` array because interactions can’t be used to specify `columnMap`. ```json "chart_2": { "type": "chart", "parameters": { "visualizationType": "pie", "step": "PieByProduct_2", "columns" : [], ... } } } ``` # Measures and Derived Measures in XMD You can specify the format and multiplier for each measure. The XMD parameters are the same for measures and derived measures. This XMD snippet shows the parameters used with the `measures` XMD parameter. ```nolang "measures": [ { "description" : "Amount", "field" : "Amount", "format" : { "customFormat": "[\"$###0\",1]", "delimiters": "{}" }, "label" : "Amount", "showInExplorer" : true } ], ``` The `measures` and `derived measures` sections can have the following parameters. | Parameter | Description | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | customFormat | Specifies the format and multiplier of the measure or derived measure. `"customFormat": "[format,multiplier]"` For more examples, see [Format Fields and Field Values with XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-formatting-dataset-fields-and-values.md). | | delimiters | Allows custom delimiters to be specified for the decimal separator (.) and the thousands separator (,). Custom delimiters will replace the default delimiter values for the final formatted result. Custom delimiters are not honored in CSV downloads. Example: `"delimiters": {"thousands": ".", "decimal": ","}` | | description | Description of the dataset field, no more than 1,000 characters. Example: `"description": "Total value for the opportunity."` | | field | Identifier for the dataset field, which is the API name. | | format | Contains the `customFormat` and the `delimiters` parameters used to format the measure. | | label | Display name for the dataset field, up to 40 characters. Example: `"label": "Sales Amount"` | | showInExplorer | (Boolean) Indicates whether the dataset field can be selected from the dashboard designer or explorer when creating dashboards and lenses. Even if `showInExplorer` is `false`, you can still use the field for SAQL queries, manually adding it in JSON, and accessing it using the Analytics REST API. Example: `"showInExplorer": true` | The `customFormat` parameter uses the following values. ## format Format of the measure or derived measure. You can add a prefix, suffix, grouping separator, decimal separator, and leading and trailing zeros. You can also configure the number of digits. You can include any characters in prefixes and suffixes, such as minus signs or currency symbols. Use the following symbols to specify the format. - `0`—One digit. Use to add leading or trailing 0s. For example, when you apply the custom format `#,###.00` to 56375, the result is 56,375.00. - `#`—Adds zero or one digit. Use to show digits when applicable. For example, when you apply the custom format `#,###.##` to 56375.56, the result is 56,375.56. - `.`—Decimal separator, like in the number 375.56. The default separator is the decimal symbol (.) A custom separator can be defined in `delimiters` using the `decimal` attribute. The custom separator replaces the (.) for the final formatted result. - `,`—Grouping separator, like in 56,375. The default separator is the comma symbol (,). A custom separator can be defined in `delimiters` using the `thousands` attribute. The custom separator replaces the (,) for the final formatted result. Example: `"customFormat": "[\"-$#,###.00$\",1]"` ## multiplier Changes a field's values by the same factor—like multiplying by 100 to convert decimals to percents. The multiplier must be a positive number. Example: `"customFormat": "[\"#,###\",100]"` **See Also** - [Change Display Labels for Dataset Fields and Values](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-change-labels.md) - [Change the Label for the Row Count Measure](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-change-count-measure.md) - [Hide Dataset Fields from Lens and Dashboard](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-show-dataset-fields.md) - [Multiply Measures by a Fixed Amount](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-multiply-by-fixed-amount.md) - [Format Measures](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-format-currency.md) # median() Returns the median value of a measure field. ## Example - Find the Median Time to Close a Case Use `median()` to find the median amount of time it takes to resolve a case, grouped by company. ```nolang q = load "Case"; q = group q by 'Account_Name'; q = foreach q generate 'Account_Name' as 'Account_Name', median('CallDuration') as 'median_CallDuration'; q = order q by 'Account_Name' asc; ``` **See Also** - [avg() or average()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-avg.md) # Methods for Analytics Dashboards Aura Component To change the state of a CRM Analytics dashboard at runtime, use the Aura CRM Analytics dashboard component methods. - [`getState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-getstatemethod.md) - [`refresh` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-refreshmethod.md) - [`setState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-setstatemethod.md) # Methods for Analytics Dashboards Lightning Web Component To change the state of a CRM Analytics dashboard at runtime, use the Lightning web component CRM Analytics dashboard component methods. - [`getState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-getstatemethod.md) - [`setState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-setstatemethod.md) # min() Returns the minimum value of a dimension or measure field. ## Example - Find the Smallest Opportunity For Each Account ```nolang q = load "Ops"; q = group q by 'Account_Name'; q = foreach q generate 'Company' as 'Company', min('Amount') as 'Smallest Deal'; ``` ## Example - Find the First Value in List of Airline Destinations per Origin For dimensions, `min()` sorts the values alphabetically and the first value is returned. ```nolang q = load "Airlines"; q = group q by 'origin'; q = foreach q generate 'origin' as 'Origin', min('dest') as 'Min Destination'; ``` **See Also** - [max()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-max.md) # min() Returns the lowest row value in a numeric column. `min()` follows this syntax. ```nolang SELECT min(COLUMN_NAME) FROM DATASET WHERE CONDITION; ``` # month_days(date) Returns the number of days in the month for a specific date. ```nolang q = foreach q generate month_days(BillDate) as "Days in Billing Month"; ``` # month_first_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy object as input. Returns an object of the same type that corresponds to the first day of the month that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", month_first_day(OrderDate) as "month_first_day" FROM "dates_sample_data"; ``` | date | month_first_day | | ------------------- | ------------------- | | 2015-01-21 15:30:00 | 2015-01-01 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-01 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-01 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-01 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-01 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-01 00:00:00 | | 2015-12-03 00:00:00 | 2015-11-01 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-01 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-01 00:00:00 | # month_last_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the month that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", month_last_day(OrderDate) as "month_last_day" FROM "dates_sample_data"; ``` | date | month_last_day | | ------------------- | ------------------- | | 2015-01-21 15:30:00 | 2015-01-31 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-31 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-31 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-28 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-31 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-31 00:00:00 | | 2015-12-03 00:00:00 | 2015-12-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-31 00:00:00 | # Multiply Measures by a Fixed Amount You can multiply the values of a measure or derived measure by a fixed amount. For example, you can use the multiplier to convert a field’s decimal values to percents. In this example lens, the values in the Discount column are shown as decimal values. ![The values table shows the Discount field values in decimal form.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_multiply_by_amount_before.png) To change the decimal value to a percentage, modify the XMD file as shown in this example. Add “%” after the value, and change the field label to "Discount %". ```nolang { “Measures” : [ { "field": "Discount", "format": { "customFormat": "[\"##.##%\",100]" }, "label": "Discount %", "showInExplorer": true } ], ``` The Discount column now has the label Discount %, and the values are in percentages. ![The values table shows the Discount field values as a percent.](https://developer.salesforce.com/media/bi_dev_guide_xmd/bi_xmd_multiply_by_amount_after.png) **note:** If a measure field has a multiplier of “0”, downloading the data to an `.xls` or `.csv` file results in all values for that field displaying as “0”. A “0” multiplier has this format: `"format":{"customFormat":"[\"#,###\",0]}`. **See Also** - [Measures and Derived Measures in XMD](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/reference/bi-xmd-reference-measures.md) # Multivalue Field A multivalue field contains more than one value. ## Example One typical use case for multivalue fields is security. For example, you can have a dataset that contains various accounts, and each account has multiple owner IDs. We’ve created a sample dataset called OppRoles where `OwnerId` is a multivalue field. | Account ID | Amount | Owner.Name | Opportunity ID | Owner ID | Stage | | ------------------ | --------- | --------------- | ------------------ | ----------------------------------------------------------------------------- | ---------- | | 001R00000046CHdIAM | 1,900,013 | Emily Dickinson | 006R0000002OF6eIAG | 005R0000000VU9bIAG, 005R0000000VU9bIAH, 005R0000000VU9bIAI | Closed Won | | 001R00000046CV6IAM | 70,449 | Albert Einstein | 006R0000002OF6eIAG | 005R0000000VU9UIAW, 005R0000000VU9bIAG, 005R0000000VU9UIAX 005R0000000VU9UIAY | Closed Won | | 001R00000046CI6IAM | 4,206,995 | Indiana Jones | 006R0000002OF6eIAG | 006R0000002OF6gIAG, 005R0000000VU9RIAW, 005R0000000VU9SIAW | Closed Won | This query filters on an `OwnerId` to display only the accounts that it can access. ```nolang q = load "OppRoles"; q = filter q by 'OwnerId' in ["005R0000000VU9bIAG"]; q = foreach q generate 'AccountId' as 'AccountId', 'Amount' as 'Amount', 'Id' as 'Id', 'Owner.Name' as 'Owner.Name', 'OwnerId' as 'OwnerId', 'StageName' as 'StageName'; ``` **note:** When using comparison operators in the filter, use `in` and `not in` to return the correct values. Using `==` and `!=` returns unexpected values when null handling is enabled. See [`Group-by` with Null Values](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-groupby.md) for more information. | Account ID | Amount | Owner.Name | Opportunity ID | Owner ID | Stage | | ------------------ | --------- | --------------- | ------------------ | ------------------ | ---------- | | 001R00000046CHdIAM | 1,900,013 | Emily Dickinson | 006R0000002OF6eIAG | 005R0000000VU9bIAG | Closed Won | | 001R00000046CV6IAM | 70,449 | Albert Einstein | 006R0000002OF6eIAG | 005R0000000VU9bIAG | Closed Won | The `OwnerID` value `005R0000000VU9bIAG` has access to two of the three accounts, so two of the accounts are displayed. **important:** Limit multivalue field use to filtering only. Multivalue fields can behave unpredictably with `group` and `foreach`. **See Also** - [mv_to_string()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-string-mts.md) - [Comparison Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-comparison.md) - [Limit Multivalue Fields](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-performance-multivalue-fields.md) # mv_to_string() Converts multivalue fields to string fields. ## Syntax `mv_to_string`(_multivalue_column_name_, _delimeter_) | Parameter | Description | | ------------------------ | -------------------------------------------------------------------------------------------------------- | | _multivalue_column_name_ | Name of the multivalue field to be converted to a string. | | _delimiter_ | Optional. The characters used to delimit values in the converted string. Maximum length is 2 characters. | ## Usage Returns an alphabetically-sorted, delimited string representation of a multivalue field. The default delimiter is a comma followed by a space (, ). `mv_to_string()` applies to non-grouped streams only. You can run filtering or grouping on a multivalue field post-projection. To enable multivalue fields, you must select the **Enable indexing of multivalue fields in Analytics** preference in Setup. If you run `mv_to_string()` without the preference selected, the function returns the first value in the first field only. 1. From Setup, enter `Analytics` in the Quick Find box. 2. Select **Settings** from the list of Analytics options. 3. In Settings, click the checkbox for **Enable indexing of multivalue fields in CRM Analytics**. ## Example This query returns values of the `Accounts Team` as a string delimited by a comma and space, in alphabetical order. ```nolang q = load "account; q = foreach q generate 'Name' as 'Account', mv_to_string('Account_Team') as 'Account Team'; ``` | Account | Account Team | | --------------- | ----------------------------------------- | | Acme | Fred Williamson, Hank Chen, Sarah Vasquez | | DTC Electronics | Brian Alison, Tessa McNaley | | Salesforce | Nadia Smith | ## Example This query returns the values of `Accounts Team` as a string delimited by two semicolons (;;) in alphabetical order. ```nolang q = load "account"; q = foreach q generate 'Name' as 'Account', mv_to_string('Account_Team', ";;") as 'Account Team'; ``` | Account | Account Team | | --------------- | ----------------------------------------- | | Acme | Fred Williamson;;Hank Chen;;Sarah Vasquez | | DTC Electronics | Brian Alison;;Tessa McNaley | | Salesforce | Nadia Smith | **See Also** - [Multivalue Field](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-multivalue.md) # mv_to_string({multivalue_column_name}, [{delimeter}]) Converts multivalue fields to string fields. `MV_TO_STRING()` takes this syntax. `MV_TO_STRING({multivalue_column_name}, {delimeter})`- multivalue_column_name - : Name of the multivalue field to be converted to a string. - delimiter - : Optional. The characters used to delimit values in the converted string. Maximum length is 2 characters. Returns an alphabetically sorted, delimited string representation of a multivalue field. The default delimiter is a comma followed by a space (`,`). You can’t use `MV_TO_STRING()` in a `WHERE` or `GROUP BY` clause. Use it in the `SELECT` statement only. If you run `MV_TO_STRING()` on single-value dimensions or on unindexed multivalue dimensions, the function returns a single value. **note:** To enable multivalue fields, you must select the **Enable indexing of multivalue fields** in CRM Analytics preference in Setup. If you run `MV_TO_STRING()` without the preference selected, the function returns the first value in the first field only. 1. From Settings, in the Quick Find box, enter `Analytics`, and then select **Settings** from the list of Analytics options. 2. In Settings, select **Enable indexing of multivalue fields in CRM Analytics**. ![Image of checkbox to enable mv_to_string function in Settings](https://developer.salesforce.com/docs/media/bi_dev_guide_sql/bi_sql_enable_mv.png) ## Simple Example This query converts the multivalue field `flight_attendants` to a string and returns values that contain the name “maria.” ```nolang SELECT MV_TO_STRING(flight_attendants) as Flight_Attendants FROM "FlightsWithNullDim" WHERE "flight_attendants" IN ('maria') ``` | Flight_Attendants | | ------------------------------- | | kate, maria, mark, martin, sara | | maria, sarah | | kate, maria, mark, martin, sara | | maria, sarah | | kate, maria, mark, martin, sara | | maria, sarah | ## Example with Custom Delimeter This query returns all values of the `flight_classes` field and delimits them with “`;;`”. ```nolang SELECT MV_TO_STRING(flight_classes, ';;') as Flight_Classes FROM "FlightsWithNullDim" LIMIT 10; ``` | Flight_Classes | | ------------------------ | | business;;economy | | business;;economy;;first | | business;;economy | | business;;economy | | business;;economy | | business;;economy;;first | | business;;economy | | business;;economy | | business;;economy | | business;;economy;;first | ## Example with Grouping The custom delimeter example returns two result values: business;;economy and business;;economy;;first. Let's group by the `flight_classes` field and display the counts for each of these values. Since `MV_TO_STRING()` throws an error if included in a `GROUP BY` statement, we can nest the `SELECT` statement containing `MV_TO_STRING()` as a subquery and group the results in the outer query. ```nolang SELECT Flight_Classes, count() as cnt FROM ( SELECT MV_TO_STRING(flight_classes, ';;') as Flight_Classes FROM "FlightsWithNullDim" ) GROUP BY Flight_Classes; ``` | Flight_Classes | cnt | | ------------------------ | --- | | business;;economy | 18 | | business;;economy;;first | 6 | # Notifications Examples Learn how to refresh, create, edit, copy, and delete analytic notifications. Analytic notifications are surfaced in the Salesforce user interface as report subscriptions, dashboard subscriptions, or Analytics notifications. - **[Get Analytics Notifications](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/notifications/analytics-api-notification-example-get-notifications.md)** Return a list of analytics notifications using a GET request. - **[Create an Analytics Notification](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/notifications/analytics-api-notification-example-post-notifications.md)** Create an Analytics Notification using a POST request. - **[Save Changes to an Analytics Notification](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/notifications/analytics-api-notification-example-put-notifications.md)** Save Changes to an Analytics Notification using a PUT request. - **[Delete an Analytics Notification](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/notifications/analytics-api-notification-example-delete-notifications.md)** Delete an Analytics Notification using a DELETE request. Once deleted, the analytics notification can't be recovered. - **[Check Limits for Analytics Notifications](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/notifications/analytics-api-notification-example-get-notifications-limits.md)** Check analytics notification limits using a GET request. # now() Returns current datetime in the specified time zone. This function is valid only in a `foreach` statement. Display the number of days an account is opened. ```nolang q = foreach q generate Account, daysBetween('OrderDate', now()) as "daysOpened"; ``` **See Also** - [now()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-date-now.md) # now() Returns the current datetime in UTC. This function is only valid in a `foreach` statement. ## Syntax `now()` ## Usage This function is commonly used with `daysBetween(​)`, `date_diff(​)`, and `date_to_string()`. ## Example How long ago was each opportunity created, in weeks? Use `date_diff()`, _datepart_ = `week`, and `now()`. ```nolang q = load "DTC_Opportunity"; q = foreach q generate date_diff("week", toDate(CreatedDate_sec_epoch), now() ) as 'Weeks to Close'; q = order q by 'Weeks to Close'; ``` ## Example What is the date today? Use `now()` inside `date_to_string()`. ```nolang q = load "DTC_Opportunity"; -- Notice how the ' character is escaped with the \ character in 'Today\'s q = foreach q generate date_to_string(now(), "yyyy-MM-dd") as 'Today\'s Date'; ``` **See Also** - [date_diff()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date-diff.md) - [now()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-functions-timezone-now.md) # Null Operators Use `is null` and `is not null` to check whether a value is or is not null. `is null` returns `True` when a value is null. `is not null` returns `True` when a value is not null. This example returns rows that contain `Sub_Category` fields that are not null and the counts of rows that contain each field. ```nolang q = load "Superstore"; q = filter q by 'Sub_Category' is not null; q = group q by 'Sub_Category'; q = foreach q generate 'Sub_Category' as 'Sub_Category', count() as 'count'; q = limit q 2000; ``` | Sub-Category | Count of Rows | | ------------ | ------------- | | Accessories | 775 | | Appliances | 466 | | Art | 796 | | Binders | 1,523 | | Bookcases | 228 | | Chairs | 617 | | Copiers | 68 | | Envelopes | 254 | | Fasteners | 217 | | Furnishings | 957 | | Labels | 364 | | Machines | 115 | | Paper | 1,370 | | Phones | 889 | | Storage | 846 | | Supplies | 190 | | Tables | 319 | ## Replace Null Values with case Use `case` to replace null values with a value of your choice. This example labels the null `Sub-Category` field "Empty." ```nolang q = load "Superstore"; q = group q by 'Sub_Category'; q = foreach q generate case when 'Sub_Category' is null then "Empty" else 'Sub_Category' end as 'Sub_Category', count() as 'count'; q = limit q 2000; ``` | Sub-Category | Count of Rows | | ------------ | ------------- | | Accessories | 775 | | Appliances | 466 | | Art | 796 | | Binders | 1,523 | | Bookcases | 228 | | Chairs | 617 | | Copiers | 68 | | Envelopes | 254 | | Fasteners | 217 | | Furnishings | 957 | | Labels | 364 | | Machines | 115 | | Paper | 1,370 | | Phones | 889 | | Storage | 846 | | Supplies | 190 | | Tables | 319 | | Empty | 4 | **See Also** - [filter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-filter.md) - [group-by rollup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-groupby-rollup.md) - [group-by](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-groupby.md) # NULLIF() Use the `nullif()` function as shorthand for a searched case statement where two equal expressions return null. `nullif()` takes the following syntax. Its two arguments are the expressions that you want to compare. ```nolang nullif(fieldName1, fieldName2) ``` In this example, the query returns null for all City values that are Aberdeen. If the City value is not Aberdeen, then it returns the City value. Here’s how to write the query as a case statement. ```nolang SELECT CASE WHEN City='Aberdeen' THEN NULL ELSE City END AS City FROM "Superstore" GROUP BY City; ``` Here's how to write the same query using `nullif()`. ```nolang SELECT NULLIF(City, 'Aberdeen') as City FROM "Superstore" GROUP BY City; ``` | City | | ----------- | | Aberdeen | | Akron | | Albuquerque | | Alexandria | # Number Literals A number literal represents a number in your script. Some examples of number literals are 16 and 3.14159. You can’t explicitly assign a type (for example, integer or floating point) to a number literal. Scientific E notation isn’t supported. The responses to queries are in JSON. Therefore, the returned numeric field is a “number” class. # Number of Days in the Month, Quarter, or Year Returns the number of days in the month, quarter, or year for the specified date. ## month_days(date) Returns the number of days in the month for the specified date. ```nolang q = foreach q generate month_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Month'; ``` ## quarter_days(date) Returns the number of days in the quarter for the specified date. ```nolang q = foreach q generate quarter_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Quarter; ``` ## year_days(date) Returns the number of days in the year for the specified date. ```nolang q = foreach q generate year_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Year; ``` # number_to_string Converts a number literal to a string literal. ## Syntax `number_to_string`(_number_, _number_format_) ## Usage Returns the string representation of _number_. Use _number_format_ to specify the format of the string, for example as currency or with two decimal places. _number_format_ can specify seperate formats for positive and negative numbers: - `number_to_string`(_number_, _number_format_) The format specified by _number_format_ is used for both positive and negative numbers. - `number_to_string`(_number_, _\_;_\_) If _number_ is positive, the number format specified by _\_ is used. If _number_ is negative, the number format specified by _\_ is used. Note the semicolon separating the two specified formats. You can specify the format with these characters: - 0, \#, decimal point (.) - Thousands separator (,) - Percentage (%) - Leading and trailing characters: \$, +, -, (, ), :, !, ^,&,’,~,{,} ## Example Display the number amount as a string, formatted as currency: ```nolang q = foreach q generate 'Amount' as 'Amount', number_to_string('Amount',"$#,###.00") as 'NumberAmount'; ``` ![Picture of a table with a number formatted as currency.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_num2string.png) ## Example Suppose that you have a measure field with the format shown in **Number You Start With**. Use the format shown in **number_format** to display this number as a shown in **Resulting String**. | Initial Number | number_format | Resulting String | | -------------- | ------------- | ---------------- | | 1234.56 | ####.# | 1234.6 | | 8.9 | #.000 | 8.900 | | .631 | 0.# | 0.6 | | 12 | #.0# | 12.0 | | 1234.568 | #.0# | 1234.57 | | 12000 | #,### | 12,000 | | 12000 | #, | 12 | | 12200000 | 0.0,, | 12.2 | | 12 | 00000 | 00012 | | 0.03457 | #.00% | 3.46% | | 12.3 | $#.00;($#.00) | \$12.30 | | -12.3 | $#.00;($#.00) | (\$12.30) | | 32 | +;- | + | | -32 | +;- | - | # offset Use `offset` to page through the results of your query. ## Syntax ```nolang result = offset rows number; ``` ## Usage Skips over the specified number of rows when returning the results of a query. You typically use `offset` to paginate the query results. When using `offset` in your SAQL statements, be aware of these rules: - The order of `filter` and `order` can be swapped because it doesn't change the results - `offset` must be after `order` - `offset` must be before `limit` - There can be no more than one `offset` statement after a `foreach` statement ## Example - Return Rows 51–101 This example loads the opportunity dataset, sorts the rows in alphabetical order by account owner, and returns rows 51–101: ```nolang q = load "DTC_Opportunity"; q = order q by 'Account_Owner'; q = foreach q generate 'Account_Owner' as 'Account_Owner', 'Account_Type' as 'Account_Type', 'Amount' as 'Amount'; q = offset q 50; q = limit q 50; ``` **See Also** - [Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statements.md) # OFFSET Clause By default, a SQL query retrieves every row in your dataset. Use the optional `WHERE` clause to restrict your query results to a conditional expression. `OFFSET` takes the syntax `OFFSET {{start}}`. _Start_ refers to the number of rows to skip before returning rows. This example skips over rows 1-5. It returns the three subsequent rows, 6-8. ```nolang SELECT City FROM "Superstore" ORDER BY City OFFSET 5 LIMIT 3; ``` | City | | -------- | | Aberdeen | | Abilene | | Abilene | # order Sorts in ascending or descending order on one or more fields. ## Syntax ```nolang result = order rows by field [ asc | desc ]; result = order rows by (field [ asc | desc ], field [ asc | desc ]); result = order rows by field [ asc | desc ] nulls [first | last]; ``` `asc` or `desc` specifies whether the results are ordered in ascending (`asc`) or descending (`desc`) order. The default order is ascending. ## Usage Use `order` to sort the results in a data stream for display. You can use `order` with ungrouped data. You can also use `order` to sort grouped data by an aggregated value. Do not use `order` to specify the order that another SAQL statement or function will process records in. For example, do not use `order` before `timeseries` to change the order of processing. Instead, use `timeseries` parameters. By default, nulls are sorted last when sorting in ascending order and first when sorting in descending order. You can change the ordering of nulls using nulls `[first | last]`. **note:** Applying labels to dimension values in the XMD changes the displayed values, but doesn’t change the sort order. ## Example `q = order q by 'count' desc;` ## Example To `order` a stream by multiple fields, use this syntax: ```nolang a = load "0Fbxx000000002qCAA/0Fcxx000000002WCAQ"; b = group a by (year, month); c = foreach b generate year as year, month as month; d = order c by (year desc, month desc); ``` ## Example You can order a cogrouped stream before a `foreach` statement: ```nolang a = load "0Fbxx000000002qCAA/0Fcxx000000002WCAQ"; b = load "0Fayy000000002qCAA/0Fbyy000000002WCAQ"; c = cogroup a by year, b by year; c = order c by a.airlineName; c = foreach c generate year as year; ``` ## Example By default, nulls are sorted first when sorting in descending order. To change the null sort order to last, use this syntax: ```nolang q = order q by last_shipping_cost desc nulls last; ``` ## Example You can’t reference a preprojection ID in a postprojection `order` operation. (Projection is another term for a `foreach` operation.) This code throws an error: ```nolang q = load "0Fbxx000000002qCAA/0Fcxx000000002WCAQ"; q = group q by 'FirstName'; q = foreach q generate sum('mea_mm10M') as 'sum_mm10M'; q = order q by 'FirstName' desc; ``` This code is valid: ```nolang q = load "0Fbxx000000002qCAA/0Fcxx000000002WCAQ"; q = group q by 'FirstName'; q = foreach q generate 'FirstName' as 'User_FirstName', sum('mea_mm10M') as 'sum_mm10M'; q = order q by 'User_FirstName' desc; ``` **See Also** - [Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statements.md) # ORDER BY Clause `SELECT` returns rows in an unspecified order by default. To sort returned rows in ascending or descending order, use the `ORDER BY` clause. `ORDER BY` takes the following syntax. ```nolang ORDER BY field_name(s) [ ASC | DESC ] [ NULLS { FIRST | LAST }] ``` This example shows how `ORDER BY` works with multiple fields. ```nolang SELECT State, Category, Sub_Category FROM "Superstore" ORDER BY State, Category; ``` Here, the `SELECT` statement orders by the State and Category columns. Alabama and Furniture are the first alphabetized fields for their respective columns. For all of the rows where State is equal to Alabama and Category is equal to Furniture, SQL returns the Sub-Category column values without any order. When State is equal to Alabama, and Category has displayed all of the Furniture values, the Category column displays Office Supplies, the next value in alphabetical order. | State | Category | Sub-Category | | ------- | --------------- | ------------ | | Alabama | Furniture | Chairs | | Alabama | Furniture | Chairs | | Alabama | Furniture | Chairs | | Alabama | Furniture | Chairs | | Alabama | Furniture | Furnishings | | Alabama | Furniture | Tables | | Alabama | Furniture | Chairs | | Alabama | Furniture | Furnishings | | Alabama | Furniture | Tables | | Alabama | Furniture | Furnishings | | Alabama | Furniture | Tables | | Alabama | Furniture | Chairs | | Alabama | Office Supplies | Appliances | To order the columns in ascending or descending order, use the keywords `ASC` and `DSC`. The order is ascending by default. To sort fields that contain null values, specify `NULLS FIRST` or `NULLS LAST`. By default, null values are treated as the largest. In ascending order, they are ordered last. In descending order, they are first. # Order By Date You can order the result of your SAQL queries by `DateTime` or `DateOnly`. Use the date part to order by date before the projection. For example, you can order results by the year that they closed. ```nolang q = order q by year('CloseDate'); ``` To order by date after the projection, use the field you created by projecting a date part. For example, you can order results by the year that they closed. ```nolang q = foreach q generate year('CloseDate') as "Year Closed"; q = order q by 'Year Closed'; ``` # Order By Date Part To order by date part, use `EXTRACT()` on the date field with the `ORDER BY` clause. The query returns the count of rows containing these same values and orders the results by count descending. ```nolang SELECT EXTRACT(YEAR FROM CloseDate) AS CloseDate_Year, EXTRACT(MONTH FROM CloseDate) AS CloseDate_Month, COUNT(*) AS cnt FROM "OpportunityFiscalEMTimezoned" GROUP BY EXTRACT(YEAR FROM CloseDate), EXTRACT(MONTH FROM CloseDate) ORDER BY cnt DESC LIMIT 10; ``` | CloseDate_Year | CloseDate_Month | cnt | | -------------- | --------------- | --- | | 2015 | 1 | 3 | | 2015 | 3 | 2 | | 2015 | 4 | 2 | | 2015 | 5 | 2 | | 2014 | 12 | 1 | | 2015 | 2 | 1 | | 2015 | 6 | 1 | | 2015 | 8 | 1 | | 2015 | 10 | 1 | | 2015 | 11 | 1 | # Order Interactions Use the `asOrder()` serialization function to specify the sort order in a SAQL query. Let’s look at an example where the selection in a toggle widget determines the sort order in a SAQL query. Given this data from a source query: ```json [ {order: "first", direction: "desc"} {order: "second", direction: "asc"} ] ``` To order by a single field, apply this order logic. When you don’t specify the direction in the query, the default is ascending. ```javascript q = order q by {{cell(stepFoo.selection, 1, "order").asOrder()}}; ``` After CRM Analytics evaluates the interaction, the grouping becomes: ```javascript q = order q by 'second'; ``` To order by multiple fields, use this grouping logic. ```javascript q = order q by {{column(stepFoo.selection, ["order"]).asOrder()}}; ``` After CRM Analytics evaluates the interaction, the grouping becomes: ```javascript q = order q by ('first', 'second'); ``` To specify the order and the direction, use this grouping logic. ```javascript q = order q by {{row(stepFoo.selection, [], ["order", "direction"]).asOrder()}}; ``` After CRM Analytics evaluates the interaction, the grouping becomes: ```javascript q = order q by ('first' desc, 'second' asc); ``` # org-readiness.json Attributes The `org-readiness.json` file attributes are: ## Org Readiness Attributes | Attribute | Required | Description | | ---------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------- | | [`values`](#values-attributes) | No | The variable values to use for readiness checks. Values provided by the API call override these values. | | [`templateRequirements`](#templaterequirements-attributes) | Yes | An array that defines the requirements for the template to validate successfully. | | [`definition`](#definition-attributes) | Yes | The requirement definitions used by the template requirements. | ## values Attributes Each entry must match a variable from the `variables.json` file, with a defined value to use for the readiness validation. `values` can contain 0 or more variables. This example illustrates how to define values for different variable types. ```nolang "values": { "booleanVar" : true, "stringVar" : "My string", "numericVar" : 10, "sobjectFieldVar" : { "sobjectName": "Opportunity", "fieldName": "StageName" } } ``` ## templateRequirements Attributes An array of requirements to use for validating the template. A requirement uses a `definition` to evaluate at runtime. The optional `type`, `image`, `tags`, and `message` attributes define how the requirement results are displayed to end users. | Attribute | Required | Description | | ---------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `expression` | Yes | The expression to evaluate for validation. | | `type` | No | The readiness type of the requirement, which must match the `definition` type. In this context, it’s used by the UI for badging purposes. | | `image` | No | An image that best represents the template requirement. The image can be a static resource or a standard CRM Analytics image. | | `successMessage` | No | The message to display when the expression evaluates to `true`. EL expressions can be used to create dynamic messages. | | `failMessage` | No | The message to display when the expression evaluates to `false`. EL expressions can be used to create dynamic messages. | | `tags` | No | A collection of strings to use as categories to describe the template requirement. The tags are user-defined and are used to group multiple template requirements together into common themes. | This example illustrates how to define requirements of different complexity. ```nolang ”templateRequirements” : [ { "expression" : "${Readiness.numberOfAccounts > Variables.numericValue}", "type" : "SobjectRowCount", "image" : { "namespace" : "my_namespace", "name" : "accounts_required.jpg" }, "successMessage" : "Your org contains enough accounts to proceed.", "failMessage" : "You only have ${Readiness.numberOfAccounts} accounts. You must have ${Variables.numericValue} or more accounts to proceed." "tags" : ["Accounts", "Cases"] }, { "expression" : "${Readiness.numberOfCases > 5}", "failMessage" : "You must have 5 or more cases to proceed." } ] ``` ## definition Attributes Each entry defines a readiness check. There must be at least 1 `definition` that is used in the `templateRequirements`. The evaluated result of each definition is stored in the template context as `Readiness['']`. These examples illustrate definitions for different requirement types. The `OrgPreferenceCheck` validates one or more org preferences. ```nolang "Example Org Readiness Check": { "type" : "OrgPreferenceCheck", "names" : [ "DashboardSavedViewEnabled" ] } ``` ```nolang EL Expression: ${Readiness['Example Org Readiness Check'].DashboardSavedViewEnabled} ``` The `SobjectRowCount` performs a SOQL query to retrieve a row count for the specified sObject and optional filters. Both the `sobject` and `filter` attributes can contain EL expressions that are resolved at runtime. This example validates that there are a specific number of accounts with an annual revenue greater than the minimum value specified at runtime. This check is performed before app creation and the results are available for `templateReadiness`. ```nolang "Count of Accounts Revenue" : { "type" : "SobjectRowCount", "sobject" : "Account", "filters" : [ { "field" : "AnnualRevenue", "operator" : "GreaterThan", "value" : "${Variables.MinimumAnnualRevenue}" } ] } ``` ```nolang EL Expression: ${Readiness['Count of Accounts Revenue'] >= 500} ``` The `OrgDatasetRowCount` performs a SQL query on an existing dataset to determine row count based on the dataset id or name and optional filters. This check can query datasets outside of the scope of the current or future app, which is useful for templates that have template dependencies on other apps. This check is performed before app creation and the results are available for `templateReadiness`. ```nolang "Query Parent App Dataset" : { "type" : "OrgDatasetRowCount", "dataset" : "${Apps.parentTemplateApp.Datasets.quota.Id}", "filters" : [ { "field" : "QuotaDollarValue", "operator" : "LessThan", "value" : "100000" } ] } ``` ```nolang EL Expression: ${Readiness['Query Parent App Dataset'] >= 500} ``` The `AppDatasetRowCount` performs a SQL query on an existing dataset to determine row count based on the dataset id or name and optional filters. This check queries datasets that are created by the template. It validates if a dataset dependent asset, such as a dashboard or Einstein Discovery story can or should be created. This check is performed during app construction, after the datasets are created and recipes are run to populate the datasets. The results of this check can’t be referenced by `templateRequirements`, but they can be referenced by template asset conditions in `template-info.json`. ```nolang "Query App Dataset" : { "type" : "AppDatasetRowCount", "dataset" : "${App.Datasets.quota.Id}", "filters" : [ { "field" : "QuotaDollarValue", "operator" : "LessThan", "value" : "100000" } ] } ``` ```nolang EL Expression: ${Readiness['Query App Dataset'] >= 500} ``` The `ApexCallout` performs a check using a custom Apex method in the template’s implementation of `WaveTemplateConfigurationModifier`. The method must be a non-static, global method with an arbitrary number of arguments. The method return value is also arbitrary or void and is place into the template context for reference in the `templateRequirements` or in rules processing. ```nolang "Global Apex Method Readiness Check" : { "type" : "ApexCallout", "method" : "checkReadiness", "arguments" : { "booleanArg" : true } } ``` ```nolang EL Expression: ${Readiness['Global Apex Method Readiness Check'] == true} ``` Example Apex method for the readiness check ```nolang global Boolean checkReadiness(Boolean booleanArg) { if (booleanArg) { return true; } return false; } ``` The `DataCloudRowCount` performs a SQL query on an existing Data 360 object, DLO, DMO, or Calculated Insight, to determine row count based on the object name or id and optional filters. This check can query Data 360 objects outside of the scope of the current or future app. This check is for templates that have dependencies on the existence and status of specific Data 360 objects. This check is performed before app creation and the results are available for `templateReadiness`. ```nolang "Row Count of DMO" : { "type" : "DataCloudRowCount", "object" : "ssot__Account__dlm", "filters" : [ { "field" : "Id__c", "operator" : "In", "value" : ["001RO00004KkxxLxxx", "001RO00004KkxxMxxx"] } ] } ``` ```nolang EL Expression: ${Readiness['Row Count of DMO'] >= 0} ``` **See Also** - [Edit org-readiness.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-edit-org-readiness-json.md) # Organizations in XMD If your datasets combine records from multiple Salesforce orgs, map Salesforce orgs to their URLs. Analytics uses these mappings to locate a record in a multi-org environment. The organizations section is used for opening links, not performing Salesforce actions. This example shows the parameters for the `organizations` XMD parameter. The ID uses the 18-character format. ```nolang "organizations": [ { "id": "00DB00000003brXMAQ", "instanceUrl": "https://westregion.my.salesforce.com", "label": "West Region Org" }, { "id": "00DB0000000pqd1MAA", "instanceUrl": "https://eastregion.my.salesforce.com", "label": "East Region Org" }, { "id": "00DB0000000paacMAA", "instanceUrl": "https://southregion.my.salesforce.com", "label": "South Region Org" }, { "id": "00DB00000001234MAA", "instanceUrl": "https://northregion.my.salesforce.com", "label": "North Region Org" } ] ``` The `organizations` section can have the following parameters. | Parameter | Description | | ----------- | ------------------------------------------------------------------------------------------------- | | id | Org ID, up to 18 characters Example: `"id": "00DV0025306tGV5MAM"` | | label | Display name for the Salesforce org, up to 40 characters. Example: `"label": "Org1"` | | instanceUrl | The org’s My Domain login URL. Example: `"instanceUrl": "https://MyDomainName.my.salesforce.com"` | **See Also** - [Add Actions to Dimensions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-add-record-level-actions.md) # Other Widgets The Hello World example is a simplified scenario. The most common real world use cases are a custom data visualization, a selection widget, or even better, a widget that does both. With practice, you can add anything you want. To see a list, a third-party data visualization integration, a hierarchy, and more widgets, check out the example GitHub repository. ## GitHub Examples Clone the [GitHub example repository](https://github.com/forcedotcom/sfdx-analytics), `git clone https://github.com/forcedotcom/sfdx-analytics.git`. Open the repository in Visual Studio. The Lightning Web Component examples are in the `quick-start/main/default/lwc` directory and include: | Example | Description | Requirements | | ---------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `breadcrumb` | Leaves breadcrumbs as users navigate through a dashboard. | No step or attribute requirements | | `graph` | Render a graph. | Requires 2 attributes from step results:
  • `sourceField` - graph edge sources (Dimension)
  • `destinationField` - graph edge destinations (Dimension)
  • `valueField` - Optional numeric weight for an edge (Measure)
| | `hierarchy` | Render results into a hierarchical structure as a tree grid. | Requires 4 attributes from step results:
  • `idColumn` - primary key (Dimension)
  • `parentIdColumn` - self-reference to parent record (Dimension)
  • `labelColumn` - record label (Dimension)
  • `root` - root node (String)
| | `libsChartjs` | Render results using Chart.js. | Requires 2 attributes from step results:
  • `measureColumn` - segment size (Measure)
  • `labelColumn` - segment label (Dimension)
| | `list` | Render results in a list. | Requires a step, but no attributes. Set up the component with a simple step of `Count of Rows` on 1 field and it lists the field results. | | `playButton` | Play recording of dashboard selection changes. | Requires a step and 1 attribute.
  • `delay` - delay between selection steps in milliseconds (Integer)
| | `selectNavigate` | Navigate to another dashboard page. | Requires a step and 1 attribute.
  • `targetPage` - ID of page to navigate to on selection (String)
| | `tdxGanttChart` | Gantt chart example with multiple attributes exposed for user input in a CRM Analytics dashboard. | Requires 4 attributes from step results, plus formatting attributes:
  • `fromColumn` - start of segment (Dimension)
  • `toColumn` - end of segment (Dimension)
  • `labelColumn` - segment label (Dimension)
  • `colorColumn` - segment color (Dimension)
  • `axesType` - the type of axes: `linear` or `time` (String)
  • `title` - optional title for the chart (String)
  • `titleFontSize` - optional title font size for the chart (Integer)
  • `subtitle` - optional subtitle for the chart. (String)
  • `subtitleFontSize` - optional subtitle font size for the chart (Integer)
  • `theme` - theme to use for the chart (String)
  • `backgroundColor` - the background color for the chart (String)
  • `label` - the label for the chart (String)
| | `wordcloud2` | Render a word cloud. | Requires 2 attributes from step results, plus formatting attributes:
  • `wordColumn` - column with words to display (Dimension)
  • `measureColumn` - numerical value defining word size (Measure)
  • `height` - height of the canvas (Integer)
  • `width` - width of the canvas (Integer)
  • `minTextSize` - minimum size of the text in px (Integer)
| ## Using the Hierarchy Component To test and play with this component, create a custom static query in the dashboard editor. ![Custom static query for the hierarchy component](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_hierarchy_query.png) Drop a component on the dashboard, select **Hierarchy** from the **Lightning Components** list, and use **Existing Query** to set the custom static query as the component step. In the component properties menu, set the **Component Attributes** to these values. - **ID Column** - _ID_ - **Parent ID Column** - _ParentID_ - **Label Column** - _Display_ - **Root Node** - _0_ Save your work and preview the dashboard to see the working hierarchy component. If you make any updates to the component attributes, refresh the dashboard in preview mode to render the changes. ## Using the TDX Gantt Chart Demo Component To test and play with this component, create a custom query in the dashboard editor. Use the Opportunities dataset to create a values table query with six columns. The six columns are **CreatedDate**, **CloseDate**, **Opportunity Name**, **Opportunity Owner**, **Amount**, and **Stage**. ![Values table query for the TDX Gantt Chart Demo component](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_tdxganttchart_query.png) Drop a component on the dashboard, select **TDX Gantt Chart Demo** from the **Lightning Components** list, and use **Existing Query** to set the custom query as the component step. In the component properties menu, set the **Component Attributes** to these values. - **From Column** - _CreatedDate_ - **To Column** - _CloseDate_ - **Label Column** - _Opportunity Name_ - **Color Column** - _Stage_ - **Axes Type** - _time_ - **Title** - _Deals over Time_ - **Title Font Size** - _22_ - **Subtitle** - _Dealflow Analysis_ - **Subtitle Font Size** - _11_ - **Theme** - _Sunrise_ - **Background Color** - _\#FFFFFF_ Save your work and preview the dashboard to see the working Gantt chart component. If you make any updates to the component attributes, refresh the dashboard in preview mode to render the changes. ## Using the Word Cloud 2 Component To test and play with this component, create a custom query in the dashboard editor. Use the Opportunities dataset to create a compare table query with a column for Count of Rows and a column for **Scaled Size**. Make the **Scaled Size** column a formula of `A/10`. Group the columns by **Account.Industry**. ![Compare table query for the Word Cloud 2 component](https://developer.salesforce.com/media/bi_dev_guide_lwc_in_db/bi_lwc_in_db_wordcloud2_query.png) Drop a component on the dashboard, select **Word Cloud 2** from the **Lightning Components** list, and use **Existing Query** to set the custom static query as the component step. In the component properties menu, set the **Component Attributes** to these values. - **Words** - _Account.Industry_ - **Measure Column** - _Scaled Size_ - **Height** - _400_ - **Width** - _1000_ - **Min Text Size** - _20_ Save your work and preview the dashboard to see the working word cloud component. If you make any updates to the component attributes, refresh the dashboard in preview mode to render the changes. **note:** Creating a query first isn’t required. You can also create a query when the component is added to the dashboard. You have the choice to select fields from the existing dataset or to change the data source to another dataset and then select fields. **See Also** - [Component Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-attributes.md) - [CRM Analytics Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-config.md) - [Lightning Dashboards Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-lightning-dashboard-config.md) - [Query Data](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-query-data.md) # Overview The Reports and Dashboards REST API gives you programmatic access to your report and dashboard data as defined in the report builder and dashboard builder. The API lets you integrate the data into any web or mobile application, inside or outside the Salesforce platform. For example, you might use the API to trigger a Chatter post with a snapshot of top-performing reps each quarter. The Reports and Dashboards REST API is part of standard Salesforce functionality and doesn't require a separate add-on or license. The Reports and Dashboards REST API will revolutionize the way you access and visualize your data. You can: - Integrate report data into custom objects. - Define rich visualizations on top of the API to animate the data. - Build custom dashboards. - Automate reporting tasks. At a high level, the API resources let you query and filter report data. You can: - Run tabular, summary, or matrix reports synchronously or asynchronously. - Filter for specific data on the fly. - Query report metadata. You can also work with dashboard resources to: - Get a list of recently used dashboards. - Get dashboard metadata and data. - Query dashboard status. - Refresh dashboards. # Overview Use SAQL (Salesforce Analytics Query Language) to access data in CRM Analytics dataset. CRM Analytics uses SAQL behind the scenes in lenses, dashboards, and explorer to gather data for visualizations. Developers can write SAQL to directly access CRM Analytics data via: - CRM Analytics REST API Build your own app to access and analyze CRM Analytics data or integrate data with existing apps. - Dashboard JSON Create advanced dashboards. A dashboard is a curated set of charts, metrics, and tables. - Compare Table Use SAQL to perform calculations on data in your tables and add the results to a new column. - Transformations During Data Flow Use SAQL to perform manipulations or calculations on data when bringing it in to CRM Analytics. * **[Introduction](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-overview-intro.md)** Most actions you take in Analytics result in one or more SAQL queries. Every lens, dashboard, and explorer action generates and executes a SAQL query to build the data needed for the visualization. - **[Use SAQL in the CRM Analytics Dashboard](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/task/bi-saql-ui.md)** Use the CRM Analytics Studio user interface to modify existing SAQL queries or write new ones. Writing SAQL queries in the user interface is the easiest way to get started. - **[SAQL Null Measures and Dimensions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-null-measures-and-dimensions.md)** With CRM Analytics, you can use null measure handling to add null as the default value for numeric columns in datasets. Use null dimensions to return grouped null values from your SAQL queries. - **[Analytics SAQL Release Notes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-releasenotes.md)** Use the Salesforce Release Notes to learn about the most recent updates and changes to Analytics SAQL. **See Also** - [Analytics REST API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/) - [Analytics Dashboard JSON Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_json.meta/bi_dev_guide_json/) # Package Your Tableau Next App After creating Tableau Next assets in your scratch org and adding them to a data kit, you're ready to package and deploy. 1. From the CLI, run the following command to create a beta Salesforce managed package that points to your data kit metadata folder: ```bash sf package create -n PACKAGE_NAME -t Managed -v DEVHUB_ALIAS -p PATH_TO_DATA_KIT ``` Beta packages can only be installed in scratch orgs. See [`package create`](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm#cli_reference_package_create_unified). 2. If your Data 360 app builds on the Data Cloud Single Source of Truth (SSOT) package, you must declare the SSOT package as a dependency in your `sfdx-project.json` file. Find the latest SSOT package ID on the [Salesforce Partner Community](https://partners.salesforce.com) site. For example, if your package includes a CRM data stream that maps to a standard data model object (DMO), include the SSOT package as a dependency. ```json { "versionName": "ver 0.1", "versionNumber": "0.1.0.NEXT", "path": "data-cloud-app", "default": false, "package": "PACKAGE_NAME", "versionDescription": "", "dependencies": [ { "package": "0123456789abcdef" } ] } ``` 3. Creating the managed package produces a `0ho` ID. Copy that ID. Next, create a managed package version with the `0ho` ID. 4. Use the following command to create the package version: ```bash `sf package version create -v DEVHUB_ALIAS -k INSTALLATION_KEY -p 0ho_ID -w 45 -f config/project-scratch-def.json` ``` See [`package create`](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm#cli_reference_package_create_unified). 5. To distribute the package, promote the package version to a released version. The released version can be installed in a production org. See [Release a Second-Generation Managed Package](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_create_pkg_ver_promote.htm). # Packaging Considerations for XMD The Standard User XMD file defines custom formatting for dataset fields and values in CRM Analytics. You can upload the Standard User XMD file through the UI or [Xmd REST Resource](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_resources_xmd_main.htm). ```nolang /wave/datasets//versions//xmds/main ``` ```nolang /wave/datasets//versions//xmds/system ``` ```nolang /wave/datasets//versions//xmds/user ``` The Standard User XMD file can’t be used in a Salesforce package because it’s tied to a dataset version that isn’t packageable. To support packaging, an alternative Primary XMD file is available. The Primary XMD file can be included in packages because it’s tied to a dataset container instead of a dataset version. The following properties apply to the Primary User XMD file: - You can update the Primary User XMD by deploying the WaveXmd metadata through MDAPI or by setting the userXmd property through the [Dataset REST Resource](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_resources_dataset_id.htm): ```nolang /wave/datasets/ ``` - The Primary User XMD is applied to a dataset only after a dataflow that updates the dataset runs (because the dataflow sets the Standard User XMD for the new dataset version). - Changes to the Primary User XMD don’t affect the Standard User XMD. - If you update the Standard User XMD, the Primary User XMD is updated automatically. - An MDAPI retrieve operation returns the Primary User XMD file only if the file was deployed using MDAPI. - If you do either of the following, the MDAPI retrieve operation returns an empty XMD file: - Update the Primary User XMD file using REST API. - Update the Standard User XMD file through the UI or REST API. This result occurs even if the files were originally deployed using MDAPI. # Page Condition Syntax for ui.json You can make a page's appearance conditional on the value of a variable. For example, if the user answers "No" when asked if there is a Products dimension, you can use a conditional to ensure that no Products-related page displays in the wizard. Adding page conditions enables wizard page flow. If the condition is met, then the page with the condition will display; if the condition is not met, the page will not display. Use the following syntax to instruct which conditionals control the display of pages. | Variable Type | Supported Operations | Example | | ---------------------------- | ---------------------- | ------------------------------------ | | `StringType` | `==, !=` | `{{Variables.x == 'Yes'}}` | | `BooleanType` | `==, !=` | `{{Variables.x == true}}` | | `NumberType` | `==, !=, <, <=, >, >=` | `{{Variables.x == 5}}` | | `SobjectType` | `==, !=` | `{{Variables.x.sobjectName == 'x'}}` | | `SobjectFieldType` | `==, !=` | `{{Variables.x.fieldName == 'x'}}` | | `ArrayType` --> `StringType` | `contains` | `{{Variables.x contains 'x'`123}}` | | `ArrayType` --> `NumberType` | `contains` | `{{Variables.x contains 5}}` | # pages Properties The `pages` key contains properties that determine the placement of each widget in the dashboard layout. Currently, the Dashboard Designer supports only one page for each layout. | Property Name | Type | Details | | ------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `label` | String | Label of the page in the dashboard layout. Included in the Dashboard Designer's user interface. | | `name` | String | ID of the page in the dashboard layout. Not included in the Dashboard Designer's user interface. | | `widgets` | Array | Contains properties that determine the height and width of each widget, and where it's placed on the dashboard layout. Not included in the Dashboard Designer's user interface. | - **[widgets Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-gridlayout-widgets-properties.md)** The `widgets` key contains properties that determine the height and width of each widget, and where it's placed on the dashboard layout. Because the Dashboard Designer uses a grid, you specify the properties in terms of rows and columns. For example, you specify the number of columns to determine the width of a widget. # parameters Properties The `parameters` key contains a list of properties that control the appearance of the widget. Each widget type, including each chart type, contains a unique set of properties. **note:** You can dynamically set properties for number and chart widgets in CRM Analytics dashboards based on the selection or results of another step. For example, you can change the map type in a chart based on a selection in a toggle widget. For more information, see the [Analytics Bindings Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_bindings.meta/bi_dev_guide_bindings/bi_dbjson_bindings.htm). Chart widgets have many properties that vary based on the chart type. For chart-specific properties for CRM Analytics dashboards, see [Visualizing Data with Charts](https://help.salesforce.com/apex/HTViewHelpDoc?id=bi_visualize.htm). These sections describe the widget properties that are set in the `parameters` property. ## absoluteModeEnabled **Type:** Boolean Show absolute dates in the date widget when users view the dashboard. `true`, by default. Default is `true`. Available for this widget: `dateselector` Exposed in the Dashboard Designer's user interface. ## alignmentX **Type:** String Indicates the horizontal alignment of the image in the widget. Valid values are: `left` (default), `center`, and `right`. Available for this widget: `image` Exposed in the Dashboard Designer's user interface. ## alignmentX **Type:** String Indicates the horizontal alignment of the image in the widget. Valid values are: `left` (default), `center`, and `right`. Available for this widget: `image` Exposed in the Dashboard Designer's user interface. ## alignmentY **Type:** String Indicates the vertical alignment of the image in the widget. Valid values are: `top` (default), `center`, and `bottom`. Available for this widget: `image` Exposed in the Dashboard Designer's user interface. ## calendarTypeSwitchingAllowed **Type:** Boolean Indicates whether the dashboard viewer can switch between the fiscal and calendar year in the date widget. Default is `false`. Available for this widget: `dateselector` Exposed in the Dashboard Designer's user interface. ## columns **Type:** Array List of API names of step fields to include in the widget. Use this property to include specific fields in the widget or to change the field order for the widget. This property appears when you reorder or hide a field while editing a widget that’s based an `aggregateflex` (for a compare table) or a `saql` step type. To specify the fields or change their order for widgets based on other step types, you have to manually add and set this property in the JSON. Example: A step returns data in the following fields: Id, Name, Amount, and Profit. To hide the Id and Profit fields from the chart widget (chart_2), set the “columns” property. ```nolang "chart_2": { "parameters": { "columns": [ "Name", "Amount" ], "visualizationType": "hbar", "step": "Amount_Prob_1", ... }, "type": "chart", .... } ``` Available for this widget: - `chart` - `table` Exposed in the Dashboard Designer's user interface (for `aggregateflex` and `saql` step types only) ## columnProperties **Type:** Object An object representation of the column properties. This includes the`type` enum with valid values of `bar`, `image`, and `text`. For each type, the `parameters` object specifies addtional attributes. - **parameters (bar)** — A bar column type. This type contains the following parameter: - `width`(integer) - The column’s width. - **parameters (image)** — An image column type. This type contains the following parameters: - `alignment` (enum) - The column’s width. - `height` (integer) - The image’s height. - `width` (integer) - The column’s width. Available for this widget: table Exposed in the Dashboard Designer's user interface. This example shows the `bar` type: ```nolang "columnProperties": [ { "type": "Bar", "parameters": { "width": 100 } } ] ``` This example shows the `image`type. ```nolang "columnProperties": [ { "type": "Image", "parameters": { "alignment": "Center|Left|Right", "height": 100, "width": 100 } } ] ``` This example shows the `text`type. ```nolang "columnProperties": [ { "type": "Text", "parameters": { "alignment": "Center|Left|Right", "styles": [ { "bold": false, "linkColor": "#0000FF" } ] "width": 100 } } ] ``` ## compact **Type:** Boolean Indicates whether displayed numbers are abbreviated (`true`) or not (`false`). For example, if `true`, the number 48,081 appears as 48k. Although the number appears to be rounded, it is not. The value 48,081 is preserved in charts and when performing calculations. If `false`, then 48,081 appears as 48,081. For number widgets, shortened numbers are rounded to the nearest 10th. Default is `false`. Available for this widget: - `listselector` - `number` - `pillbox` Exposed in the Dashboard Designer's user interface. ## computeTotal **Type:** Boolean Indicates whether to include the total measure column (`true`) or not (`false`). Default is `true`. Available for this widget: `chart` (only when `visualizationType` is `stackwaterfall` and `waterfall`) Exposed in the Dashboard Designer's user interface. ## containedWidgets **Type:** List A list of all widgets inside the container widget. Available for this widget: `container` Exposed in the Dashboard Designer's user interface. This example shows 2 widgets (`meafilter_1` and `chart_1`) included in the container widget (`container_1`). ```nolang "container_1": { "type": "container", "position":{ "x": 0, "y": 0 }, "parameters":{ "containedWidgets": [ "meafilter_1", "chart_1" ] } } ``` ## customBulkActions **Type:** Boolean Specifies these details about custom bulk action. - **label** — Display label for the button in the table widget’s action menu. The dashboard viewer clicks the button to execute the action. - **visualforce** — The name and namespace prefix of the Visualforce page that defines the bulk action. Namespace prefix is optional. Available for this widget: `table` Exposed in the Dashboard Designer's user interface. ```nolang "customBulkActions": [ { "label": "Generate Opportunities", "visualforce": { "name": "VF_Create_Opportunities", "namespace": "Prefix" } } ] ``` ## defaultFiscalMode **Type:** Boolean Indicates whether the date widget displays dates using the fiscal year, by default. If not, then it uses the calendar year. Default is `false`. Available for this widget: `dateselector` Exposed in the Dashboard Designer's user interface. ## destination **Type:** String The ID of the dashboard, lens, step, or page. Default is null. Available for this widget: `link` Exposed in the Dashboard Designer's user interface. ## destinationLink **Type:** String The object to which you are linking. One of the following properties identifies the linked object. - `name` — The ID of the dashboard, lens, step, or page. Default is null. - `url` — The URL that the link points to. - `tooltip` — The tooltip that displays when you hover over a link to a URL. Available for this widget: `link` Exposed in the Dashboard Designer's user interface. ## destinationType **Type:** String The destination type of a link. Possible values are: - **`dashboard`** — a dashboard - **`explore`** — a step - **`lens`** — a lens - **`page`** — a page - **`url`** — a website Default is `lens`. Available for this widget: `link` Exposed in the Dashboard Designer's user interface. ## displayTemplate **Type:** String Specifies the string of grouping and measure fields to display in the widget. Fields must be enclosed in square brackets. By default, all groupings are included. Available for this widget: - `listselector` - `pillbox` Exposed in the Dashboard Designer's user interface. This example displays the value for the Account.Type dimension, Account.BillingCountry dimension, and Amount measure. ```nolang "displayTemplate": "[Account.Type] - [Account.BillingCountry] ([avg_Amount])" ``` ## documentId **Type:** String The 15-character document Id of the image file that you want to apply as the background. To ensure security, the image file must be uploaded to Salesforce as a document and the **Externally Available Image** option must be selected. If this option is not selected or the referenced document is not an image, the image doesn’t show up in the widget. Default is null. Available for this widget: `image` Exposed in the Dashboard Designer's user interface. This example image widget (`image_1`) displays an image with ID `015R0000000DClP`. ```nolang "image_1": { "type": "image", "parameters": { "documentId": "015R0000000DClP", "fit": "stretch", "alignmentX": "center", "alignmentY": "center" } } ``` ## dualAxis **Type:** Boolean Indicates whether to include an axis for each of the two measures (`true`) or not (`false`). Default is `true`. Available for this widget: `chart` (only when `visualizationType` is `combo`) Exposed in the Dashboard Designer's user interface. ## exploreLink **Type:** Boolean Indicates whether the widget shows the explore icon that dashboard viewers can click to explore the widget as a lens (`true`) or not (`false`). This option only applies to widgets based on steps in compact form. You can’t explore widgets that are built on SAQL form steps. Default is `true`. Mobile devices display the icon, regardless of this setting. Available for this widget: - `chart` - `comparetable` - `listselector` - `number` - `pillbox` - `valuestable` Exposed in the Dashboard Designer's user interface. ## filterItemOptions **Type:** List Details about each global filter shown in the global filter panel widget. You can configure the following details, which are also available in the user interface. - **`propertyColor`** — Color of the field name - **`valueColor`** — Color of the field value - **`backgroundColor`** — Color of the filter background - **`borderColor`** — Color of the filter border - **`borderWidth`** — Width of the filter border - **`borderRadius`** — Radius of the filter border Available for this widget: `filterpanel` Exposed in the Dashboard Designer's user interface. ## fit (for chart widgets) **Type:** Boolean Indicates whether the axis of a chart is in the center of the data (`true`) or at (0, 0) (`false`). Default is `false`. Available for this widget: `chart` (only when `visualizationType` is `scatter`) Exposed in the Dashboard Designer's user interface. ## fit (for image widgets) **Type:** String Indicates how to scale the image. Valid values are: - `original` (default) - `stretch` - `tile` - `fitwidth` - `fitheight` - `image` Available for this widget: Exposed in the Dashboard Designer's user interface. ## fontSize **Type:** Integer The font size of a number or of text. Defaults are: - `number`: `36` - `text`: `26` Available for this widget: - `link` - `number` - `text` Exposed in the Dashboard Designer's user interface. ## hideHeaderColumn **Type:** Boolean Indicates whether the first column in a raw data table—which is simply a count of rows—is hidden (`true`) or not (`false`). Default is `false`. This setting doesn’t apply when viewing the widget on mobile devices. Available for this widget: - `chart` - `valuestable` Not exposed in the Dashboard Designer's user interface. Only editable via JSON. ## image **Type:** Array Identifies the image using the following properties. - **name** — Name of the image. - **namespace** — Optional. Namespace of the image. Default is null. Available for this widget: - `container` - `image` Exposed in the Dashboard Designer's user interface. ```nolang "image": { "name": "My_Corporate_Logo", "namespace": "" } ``` ## includeState **Type:** Boolean If set to `true`: - CRM Analytics passes selections in chart, list, toggle, range, and date widgets as selections in the linked asset if they apply. For example, you select North America in a list widget based on the Region dataset field. CRM Analytics applies that same selection to faceted queries in the linked dashboard that have a grouping based on the Region field in the same dataset. - CRM Analytics passes global filters as filters to a linked asset as long as the filters apply. CRM Analytics ignores a global filter if the linked asset doesn’t use the dataset that the global filter is defined on. If the global filter is locked and the incoming filter is defined on the same field, CRM Analytics ignores the incoming filter. If it’s unlocked, the incoming filter overrides the global filter defined in the dashboard. Default is `false`. Available for this widget: `link` Exposed in the Dashboard Designer's user interface. ## instant **Type:** Boolean Indicates whether other faceted widgets immediately update (`true`) or not (`false`) when a dashboard viewer makes a selection in this widget. When `false`, dashboard viewers must click **Update** for their changes to cascade to faceted widgets. When `true`, the **Update** button is hidden. Defaults are: - **`dateselector`** — `false` - **`listselector`** — `true` - **`rangeselector`** — `false` For list, range, or date widgets that are expanded in the dashboard designer, this widget property is always enabled. Selections in these widgets instantly update other widgets. While these widgets are expanded, you can’t change this setting. The Update Instantly property is available when the widget is collapsed, but not when expanded. Available for this widget: - `dateselector` - `listselector` - `rangeselector` Exposed in the Dashboard Designer's user interface. ## itemsPerRow **Type:** Integer Number of global filters to show per row in the global filter panel. Default is `6`. Available for this widget: `filterpanel` Exposed in the Dashboard Designer's user interface. ## legend **Type:** Boolean Indicates whether to display a legend (`true`), or not (`false`). Default is `false` for all chart types, except `pivottable`. Mobile devices can only display legends for `pie` widgets. Available for this widget: `chart` (only when `visualizationType` is `hbar`, `vbar`, `stackhbar`, `stackvbar`, `pie`, `scatter`, `time`, `time-bar`, `time-combo`, `hdot`, `vdot`, `matrix`, `calheatmap`, `heatmap`, `parallelcoords`, `stackwaterfall`, `funnel`, or `choropleth`) Exposed in the Dashboard Designer's user interface. ## legendHideHeader **Type:** Boolean Indicates whether the legend has a title (`true`) or not (`false`). The title is always the name of the dimension that the legend describes. Default is `false` for all chart types except `pivottable`. This setting doesn’t apply when viewing the widget on mobile devices. Available for this widget: `chart` (only when `visualizationType` is `hbar`, `vbar`, `stackhbar`, `stackvbar`, `pie`, `scatter`, `time`, `time-bar`, `time-combo`, `hdot`, `vdot`, `matrix`, `calheatmap`, `heatmap`, `stackwaterfall`, `combo`, `combo`, or `parallelcoords`) Not exposed in the Dashboard Designer's user interface. Only editable via JSON. ## legendWidth **Type:** Integer The width of the legend area in pixels. Default is `145` for all chart types except `pivottable`. This setting doesn’t apply when viewing the widget on mobile devices. Available for this widget: `chart` (only when `visualizationType` is `hbar`, `vbar`, `stackhbar`, `stackvbar`, `pie`, `scatter`, `time`, `time-bar`, `time-combo`, `hdot`, `vdot`, `matrix`, `calheatmap`, `heatmap`, `stackwaterfall`, `combo`, or `parallelcoords`) Not exposed in the Dashboard Designer's user interface. Only editable via JSON. ## measureField **Type:** String The mathematical function performed on data. Specify the `measureField` in this format: _\_\\_. _\_ must match one of the formulas specified in the `measures` step property. Possible values for _\_ are: - **`avg`** — calculate the mathematical average (mean) - **`max`** — the maximum value - **`min`** — the minimum value - **`sum`** — add all the values - **`unique`** — count the number of unique values. For example, use to count the number of unique dimensions. The _\_ paired with the _\_ must match the field name that is specified in `measures`. For example, if the `measures` step property is: ```nolang "measures”: [ [ "sum", "Profit" ], [ "avg", "Discount" ], [ "count", "ModelNumber" ] ] ``` Then `measureField` must be `sum_Profit`, `avg_Discount`, or `unique_ModelNumber`. The `measureField` can’t be `avg_Profit` because `avg` and `Profit` aren’t paired together in the `measures` step property. Unlike for measures, a count on a dimension in the user interface calculates the number of unique dimension values. As a result, `measureField` in the underlying JSON shows the `unique` formula, like `unique_`. Default is null. Available for this widget: - `listselector` - `number` - `pillbox` Exposed in the Dashboard Designer's user interface. ## multiMetrics **Type:** Boolean Indicates whether two or more measures are displayed as adjacent bars under each grouping (`true`) or as individual, adjacent graphs (`false`). Default is `false` (available only for bar charts and column charts). Available for this widget: `chart` (only when `visualizationType` is `hbar` or `vbar`) Exposed in the Dashboard Designer's user interface. ## negativeColor **Type:** String The color of the measure columns that have decreased in value in the chart. Specify the color in this format: `rgb({a}, {b}, {c}, {d})`. Using a number between zero and 255, `{a}` indicates how much red is in the color, `{b}` how much green, and `{c}` how much blue. A value of 0 indicates the absence of a color, and a value of 255 indicates the full expression of a color. Using a number between zero and one, `{d}` indicates the level of transparency. A value of `0` is invisible and `1` is opaque. For example, `rgb(0, 0, 0, 0.93)` sets the color to a nearly opaque black. `rgb(255, 0, 0, 0.14)` sets the color to a nearly invisible red. Alternatively, the color can be set using hexadecimal notation. When using hexadecimal notation, transparency can’t be set. All hexadecimal colors default to opaque. `#000000` indicates black in hexadecimal. `#ff0000` indicates red. Available for this widget: `chart` (only when `visualizationType` is `waterfall`) Exposed in the Dashboard Designer's user interface. ## normalize **Type:** Boolean Indicates whether charts are displayed using a logarithmic scale (`true`) or a linear scale (false). Default is `false` (available only for `stackhbar` and `stackvbar`). Available for this widget: `chart` (only when `visualizationType` is `stackhbar` or `stackvbar`) Exposed in the Dashboard Designer's user interface. ## numberColor **Type:** String The font color of the number. Specify the color in this format: `rgb({a}, {b}, {c}, {d})`. Using a number between zero and 255, `{a}` indicates how much red is in the color, `{b}` how much green, and `{c}` how much blue. A value of 0 indicates the absence of a color, and a value of 255 indicates the full expression of a color. Using a number between zero and one, `{d}` indicates the level of transparency. A value of `0` is invisible and `1` is opaque. For example, `rgb(0, 0, 0, 0.93)` sets the color to a nearly opaque black. `rgb(255, 0, 0, 0.14)` sets the color to a nearly invisible red. Alternatively, the color can be set using hexadecimal notation. When using hexadecimal notation, transparency can’t be set. All hexadecimal colors default to opaque. `#000000` indicates black in hexadecimal. `#ff0000` indicates red. Default is `#000`. Available for this widget: `number` Exposed in the Dashboard Designer's user interface. ## numberSize **Type:** Integer The font size of the number. Default is 26. Available for this widget: `number` Exposed in the Dashboard Designer's user interface. ## pivoted **Type:** Boolean Indicates whether the table is pivoted. A pivot table requires the underlying step to have at least one grouping. CRM Analytics pivots the table on the last defined grouping. Default is `false`. Available for this widget: `table` Exposed in the Dashboard Designer's user interface. ## positiveColor **Type:** String The color of the measure columns that have increased in value or remained the same in the chart. Specify the color in this format: `rgb({a}, {b}, {c}, {d})`. Using a number between zero and 255, `{a}` indicates how much red is in the color, `{b}` how much green, and `{c}` how much blue. A value of 0 indicates the absence of a color, and a value of 255 indicates the full expression of a color. Using a number between zero and one, `{d}` indicates the level of transparency. A value of `0` is invisible and `1` is opaque. For example, `rgb(0, 0, 0, 0.93)` sets the color to a nearly opaque black. `rgb(255, 0, 0, 0.14)` sets the color to a nearly invisible red. Alternatively, the color can be set using hexadecimal notation. When using hexadecimal notation, transparency can’t be set. All hexadecimal colors default to opaque. `#000000` indicates black in hexadecimal. `#ff0000` indicates red. Available for this widget: `chart` (only when `visualizationType` is `waterfall`) Exposed in the Dashboard Designer's user interface. ## presetsEnabled **Type:** Boolean Show preset dates in the date widget when users view the dashboard. `true`, by default. Default is `true`. Available for this widget: `dateselector` Exposed in the Dashboard Designer's user interface. ## relativeModeEnabled **Type:** Boolean Show relative dates in the date widget when users view the dashboard. `true`, by default. Default is `true`. Available for this widget: `dateselector` Exposed in the Dashboard Designer's user interface. ## showValues **Type:** Boolean Indicates whether to display the values of each measure column (`true`) or not (`false`). Default is `true`. Available for this widget: `chart` (only when `visualizationType` is `stackwaterfall` or `waterfall`) Exposed in the Dashboard Designer's user interface. ## splitAxis **Type:** Boolean Indicates whether each dimension in a chart is measured on its own axis (`true`) or a shared axis (`false`). Only applicable when `multiMetrics` is `true`. Default is `false` (available only for bar charts and column charts). This setting doesn’t apply when viewing the widget on mobile devices. Available for this widget: `chart` Exposed in the Dashboard Designer's user interface. ## sqrt **Type:** Boolean Indicates whether charts are displayed using a logarithmic scale (`true`) or a linear scale (false). Default is `false` (available only for bar charts, column charts, line charts, and time series). This setting doesn’t apply when viewing the widget on mobile devices. Available for this widget: `chart` (only when `visualizationType` is `parallelcoords`, `hdot`, `vdot`, `time`, `time-bar`, `time-combo`, `scatter`, `stackhbar`, `stackvbar`, `hbar`, `stackwaterfall`, or `vbar`) Exposed in the Dashboard Designer's user interface. ## startColor **Type:** String The color of the first measure column in the chart. Specify the color in this format: `rgb({a}, {b}, {c}, {d})`. Using a number between zero and 255, `{a}` indicates how much red is in the color, `{b}` how much green, and `{c}` how much blue. A value of 0 indicates the absence of a color, and a value of 255 indicates the full expression of a color. Using a number between zero and one, `{d}` indicates the level of transparency. A value of `0` is invisible and `1` is opaque. For example, `rgb(0, 0, 0, 0.93)` sets the color to a nearly opaque black. `rgb(255, 0, 0, 0.14)` sets the color to a nearly invisible red. Alternatively, the color can be set using hexadecimal notation. When using hexadecimal notation, transparency can’t be set. All hexadecimal colors default to opaque. `#000000` indicates black in hexadecimal. `#ff0000` indicates red. Available for this widget: `chart` (only when `visualizationType` is `waterfall`) Exposed in the Dashboard Designer's user interface. ## step **Type:** String The name of the step that supplies data for the widget. Default is null. Available for this widget: - `chart` - `comparetable` - `dateselector` - `globalfilters` - `listselector` - `number` - `pillbox` - `rangeselector` - `valuestable` Exposed in the Dashboard Designer's user interface. ## stretch **Type:** Boolean Indicates whether an image’s width and height are set to the same values of the widget’s width and height (`true`) or not (`false`). Default is `false`. Available for this widget: `box` Exposed in the Dashboard Designer's user interface. ## stretchImage **Type:** Boolean Indicates whether an image’s width and height are set to the same values of the widget’s width and height (`true`) or not (`false`). Default is `false`. Available for this widget: `container` Exposed in the Dashboard Designer's user interface. ## text **Type:** String The message rendered in a text widget. For example, if `text` is assigned the value `“Hello, World!”`, then “Hello, World!” appears in the text widget. Default is null. Available for this widget: - `link` - `text` Exposed in the Dashboard Designer's user interface. ## textAlignment **Type:** String The alignment of text. Possible values include `left`, `center`, and `right`. If no value is specified, text alignment defaults to center. Defaults are: - `number`: `right` - `text`: `center` Available for this widget: - `link` - `number` - `text` Exposed in the Dashboard Designer's user interface. ## textColor **Type:** String The font color of text. Specify the color in this format: `rgb({a}, {b}, {c}, {d})`. Using a number between zero and 255, `{a}` indicates how much red is in the color, `{b}` how much green, and `{c}` how much blue. A value of 0 indicates the absence of a color, and a value of 255 indicates the full expression of a color. Using a number between zero and one, `{d}` indicates the level of transparency. A value of `0` is invisible and `1` is opaque. For example, `rgb(0, 0, 0, 0.93)` sets the color to a nearly opaque black. `rgb(255, 0, 0, 0.14)` sets the color to a nearly invisible red. Alternatively, the color can be set using hexadecimal notation. When using hexadecimal notation, transparency can’t be set. All hexadecimal colors default to opaque. `#000000` indicates black in hexadecimal. `#ff0000` indicates red. Default is `#000`. Available for this widget: - `link` - `text` Exposed in the Dashboard Designer's user interface. ## title (For widgets except global filter panel) **Type:** String The title of a widget. Default is null. Available for this widget: - `dateselector` - `listselector` - `number` - `pillbox` - `rangeselector` Exposed in the Dashboard Designer's user interface. ## title (for global filter panel widgets only) **Type:** List Details about the title of the global filter panel widget. You can configure the following details, which are also available in the user interface. - `visible` — Indicates whether the title is visible when viewing the dashboard - `text` — Details about the title: title (`label`), color of title (`color`), font size of title (`fontSize`), and horizontal alignment (`align`) - `separatorColor` — Color of the line that separates the widget title from the global filters Available for this widget: `filterpanel` Exposed in the Dashboard Designer's user interface. ## titleColor **Type:** String The font color of the title. Specify the color in this format: `rgb({a}, {b}, {c}, {d})`. Using a number between zero and 255, `{a}` indicates how much red is in the color, `{b}` how much green, and `{c}` how much blue. A value of 0 indicates the absence of a color, and a value of 255 indicates the full expression of a color. Using a number between zero and one, `{d}` indicates the level of transparency. A value of `0` is invisible and `1` is opaque. For example, `rgb(0, 0, 0, 0.93)` sets the color to a nearly opaque black. `rgb(255, 0, 0, 0.14)` sets the color to a nearly invisible red. Alternatively, the color can be set using hexadecimal notation. When using hexadecimal notation, transparency can’t be set. All hexadecimal colors default to opaque. `#000000` indicates black in hexadecimal. `#ff0000` indicates red. Default is `#000`. Available for this widget: `number` Exposed in the Dashboard Designer's user interface. ## titleSize **Type:** Integer The font size of the title. Default is 26. Available for this widget: `number` Exposed in the Dashboard Designer's user interface. ## tooltip **Type:** String Text that appears when you hover over the widget while viewing the dashboard. Use a tooltip to add context to the text or image. Available for this widget: - `image` - `text` Exposed in the Dashboard Designer's user interface. ## totalColor **Type:** String The color of the total measure column in the chart. Specify the color in this format: `rgb({a}, {b}, {c}, {d})`. Using a number between zero and 255, `{a}` indicates how much red is in the color, `{b}` how much green, and `{c}` how much blue. A value of 0 indicates the absence of a color, and a value of 255 indicates the full expression of a color. Using a number between zero and one, `{d}` indicates the level of transparency. A value of `0` is invisible and `1` is opaque. For example, `rgb(0, 0, 0, 0.93)` sets the color to a nearly opaque black. `rgb(255, 0, 0, 0.14)` sets the color to a nearly invisible red. Alternatively, the color can be set using hexadecimal notation. When using hexadecimal notation, transparency can’t be set. All hexadecimal colors default to opaque. `#000000` indicates black in hexadecimal. `#ff0000` indicates red. Available for this widget: `chart` (only when `visualizationType` is `waterfall`) Exposed in the Dashboard Designer's user interface. ## totals **Type:** Boolean Indicates whether to include a row that displays the sum of all the values in each measure column (`true`) or not (`false`). Default for `chart` is `false` (available only for `pivottable`). This setting doesn’t apply when viewing the widget on mobile devices. Available for this widget: `chart` (only when `visualizationType` is `pivottable`) Exposed in the Dashboard Designer's user interface. ## trellis **Type:** Boolean Indicates whether the last grouping displays on its own axis (`true`) if a step has multiple groupings and one measure. If `false`, it displays all groupings on the same axis. Default for `chart` is `false` (available only for bar charts and column charts). This setting doesn’t apply when viewing the widget on mobile devices. Available for this widget: `chart` Exposed in the Dashboard Designer's user interface. ## videoSize **Type:** String The dimensions of a YouTube video. Possible values are: - `(4/3) 240 x 180` - `(4/3) 420 x 315` - `(4/3) 480 x 360` - `(4/3) 640 x 480` - `(4/3) 960 x 720` - `(16/9) 320 x 180` - `(16/9) 560 x 315` - `(16/9) 640 x 360` - `(16/9) 853 x 480` - `(16/9) 1280 x 720` Default is `(4/3) 240 x 180`. Mobile devices don’t display `url` widgets. Available for this widget: `url` Exposed in the Dashboard Designer's user interface. ## visualizationType **Type:** String The type of chart used to show data. Possible values are: - **`calheatmap`**— calendar heat map - **`choropleth`** — choropleth (map) - **`combo`** — lines and bars to show multiple metrics - **`flatgauge`** — flat gauge - **`funnel`** — funnel - **`hbar`** — horizontal bar - **`hdot`** — horizontal dot plot - **`heatmap`**— heat map - **`matrix`**— matrix - **`parallelcoords`** — parallel coordinates - **`pie`** — donut - **`pivottable`** — pivot table - **`polargauge`** — polar gauge - **`pyramid`** — pyramid - **`rating`** — rating - **`scatter`** — scatter plot - **`stackhbar`** — stacked horizontal bar - **`stackpyramid`** — stacked pyramid - **`stackvbar`** — stacked vertical bar - **`stackwaterfall`** — stacked waterfall - **`time`** — timeline - **`time-bar`** — time bar - **`time-combo`** — time bar - **`vbar`** — vertical bar - **`vdot`** — vertical dot plot - **`waterfall`** — waterfall Available for this widget: `chart` Exposed in the Dashboard Designer's user interface. ## url **Type:** ConnectUri The URL of a YouTube video. Default is null. Mobile devices don’t display `url` widgets. Available for this widget: `url` Exposed in the Dashboard Designer's user interface. # percentile_cont Calculates a percentile based on a continuous distribution of the column value. `percentile_disc()` follows this syntax. ```nolang SELECT percentile_cont(PERCENTAGE) WITHIN GROUP (ORDER BYFIELD1) FROM DATASET; ``` # percentile_cont() Calculates a percentile based on a continuous distribution of the column value. ```nolang percentile_cont(p) within group (order by expr [asc | desc]) ``` `percentile_cont()` accepts a numeric grouped expression _expr_ and sorts it in the specified order. If order is not specified, the default order is ascending. It returns the value behind which (100\*_p_)% of values in the group fall in the sorted order, ignoring null values. _p_ can be any real numeric value between 0 and 1. _expr_ can be any identifier, such as 'xInt' or 'price', but cannot be a complex expression, such as price/100 or ceil(distance), or a literal, such as 2.5. If _expr_ contains no value that falls exactly at the 100\*p-th percentile mark, `percentile_cont()` returns a value interpolated from the two closest values in _expr_. For example, if `Mea1` contains the values `[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]` then: ```nolang percentile_cont(0.25) within group (order by Mea1 asc) = 3.25 percentile_cont(0.25) within group (order by Mea1 desc) = 9.75 percentile_cont(0) within group (order by Mea1 asc) = 0 percentile_cont(1) within group (order by Mea1 asc) = 13 ``` ## Example - Display the Interpolated Value of the Bottom 15% of Deals Suppose that you want to see the bottom 15% of deals for each rep. You don't need to see the actual deal size - just the 'average' size of the bottom 15%. Use `percentile_cont(.15)`. ![Diagram showing percentile continuous.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_perc.png) **See Also** - [percentile_disc()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-pd.md) # percentile_disc Returns the value corresponding to a given percentile. Accepts measure fields as input. `percentile_cont()` follows this syntax. ```nolang SELECT percentile_disc(PERCENTAGE) WITHIN GROUP (ORDER BYFIELD1) FROM DATASET; ``` # percentile_disc() Returns the value corresponding to the specified percentile. ```nolang percentile_disc(p) within group (order by expr [asc | desc]) ``` `percentile_disc()` accepts a numeric grouped expression _expr_ and sorts it in the specified order. If order is not specified, the default order is ascending. It returns the value behind which (100\*_p_)% of values in the group fall in the sorted order, ignoring null values. _p_ can be any real numeric value between 0 and 1, and is accurate to 8 decimal places of precision. _expr_ can be any identifier, such as 'xInt' or 'price', but cannot be a complex expression, such as price/100 or ceil(distance), or a literal, such as 2.5. If _expr_ contains no value that falls exactly at the 100\*p-th percentile mark, `percentile_disc()` returns the next value from _expr_ in the sort order. For example, if `Mea1` contains the values [54, 35, 15, 15, 76, 87, 78] then: ```nolang percentile_disc(0.5) within group (order by Mea1) == 54 percentile_disc(0.72) within group (order by Mea1) == 78 ``` ## Example - Rank Your Reps by Top Quartile of Deal Size Suppose that you want to see which reps close the biggest deals. (The result may be different than the sum of deal amount, if some reps close a lot of smaller deals). You also want the chart to display the size of actual deals, not an average of deal size. Use `percentile_disc(.25)` to look at the top quarter of the deal size for each rep. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by 'Account_Owner'; q = foreach q generate 'Account_Owner' as 'Account_Owner', percentile_disc(0.25) within group (order by 'Amount' desc) as 'Amount'; q = order q by 'Amount' desc; ``` You can see that 25% of Julie Chavez's deals are bigger than $2.4 million, and 25% of Kelly Frazier's deals are bigger than $2.2 million. You also know that Julie closed a deal worth\$2.4 million, and that number isn't an average. ![Diagram showing percentile continuous.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_perd.png) **See Also** - [percentile_cont()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-pc.md) - [Show the Top and Bottom Quartile](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-topbotquartile.md) # pi() Returns the value of π, where π=3.14139265. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate pi() as pi; ``` # pi() Returns the value of constant π, where π=3.14159. `PI()` takes the following syntax. ```nolang SELECT PI() as ALIAS FROM DATASET; ``` ## Example ```nolang SELECT PI() as piValue FROM "Opportunity" LIMIT 1; ``` | piValue | | ------- | | 3.14159 | # position({search_str} IN {source_str}) Returns an integer that indicates the first occurrence of a substring in a given string. If the substring is not found, the function returns 0. ## Example This example returns the position of the substring “der” in the City field. ```nolang SELECT City, POSITION('der' IN City) as "Pos" FROM "Superstore" LIMIT 5; ``` | City | Pos | | --------------- | --- | | Henderson | 4 | | Henderson | 4 | | Los Angeles | 0 | | Fort Lauderdale | 9 | | Fort Lauderdale | 9 | # power({m},{n}) Returns _m_ raised to the _n_th power. \_m_, _n_ can be any numeric value in the range of -1.797e308 \<= _m_, _n_ \<= 1.797e308. Returns null if _m_ = 0 and _n_ \< 0. - If _m_ = 0, _n_ must be a non-negative value. - If _m_ \< 0, _n_ must be an integer value. - The result of power(_m_, _n_) must be within the range expressed by a float64 number. `power({m},{n})` takes the following syntax. ```nolang SELECT power(M,N) as AliasName FROM dataset; ``` ## Example This example returns 2 raised to the 5th power. ```nolang SELECT power(2, 5) as powerExample FROM Superstore LIMIT 1; ``` | powerExampe | | ----------- | | 32.0 | # power(m, n) Returns _m_ raised to the _n_th power. \_m_, _n_ can be any numeric value in the range of -1e308 \<= _m_, _n_ \<= 1e308. Returns `null` if _m_ = 0 and _n_ \< 0. This function can only be used in a `foreach` statement. - If _m_ = 0, _n_ must be a non-negative value. - If _m_ \< 0, _n_ must be an integer value. - The result of power(_m_, _n_) must be within the range expressed by a float64 number. ## Example ```nolang q = foreach q generate power(length, 2) as area, length; q = filter q by power(length, 2) > 10; ``` # Prepare Data Files To upload external data from .csv files into a dataset, first prepare your data files. External data can be loaded into a dataset by preparing two files. - A data file, which contains the external data, in comma-separated value (CSV) format - An optional metadata .json file, which describes the structure of the data file **note:** Providing a metadata file is recommended. The data and metadata files are used to populate a dataset with the external data. For detailed information about formatting CSV data and JSON metadata, see the [External Data Metadata Overview](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_ext_data.meta/bi_dev_guide_ext_data/bi_ext_data_schema_overview). # Prerequisites Complete these prerequisites before you begin the quick start. Become familiar with: - Either Workbench or cURL. Workbench is a tool that includes a REST explorer that allows you to make HTTP requests to Salesforce and receive responses through a Web browser interface. cURL is a command-line tool that serves as a client application that makes HTTP requests to Salesforce. cURL is an open-source tool and isn’t supported by Salesforce. - JavaScript Object Notation (JSON), which is the data format returned in this quick start. - OAuth 2.0, which is the framework Salesforce uses for authentication. The quick start provides the steps, but it would be helpful to familiarize yourself with OAuth terms and concepts. # Prerequisites Take care of these tasks before creating CRM Analytics templates. Licenses and Permission Sets Make sure you and members of your team each have a CRM Analytics platform license--either CRM Analytics Growth or CRM Analytics Plus. Assign the following permission sets to yourself and members of your team: - For CRM Analytics Growth licenses, CRM Analytics Admin - For CRM Analytics Plus licenses, CRM Analytics Plus Admin Org preferences Set your Org Preferences to enable CRM Analytics templates. In the Admin Setup page, under Settings, select Enable CRM Analytics Templates. You must enable this preference to create CRM Analytics templates. Developer Edition Org Namespace Set up a namespace for your development org to enable the use of Managed Packages. Set up your namespace before creating any CRM Analytics assets. CLI Developers To use CLI for template development, enable the Dev Hub, which lets you create and manage scratch orgs. Also, install the Analytics CLI Plugin. 1. Enable Dev Hub in your org. See [Enable Dev Hub in Your Org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm). 2. Install the Salesforce Command-Line Interface (CLI). See [Install the Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm). 3. Create a Salesforce DX project. See [Create a Salesforce DX Project](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_create_new.htm). 4. Create a scratch org. See [Create Scratch Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_create.htm). 5. Install the CLI Analytics plugin by running the command `sf plugins install @salesforce/analytics`. 6. Verify the installation by listing the available analytics commands. Run the command `sf analytics --help`. For a reference to all available Analytics CLI commands, see the [Salesforce Analytics CLI Plugin Command Reference](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_cli_reference.meta/bi_dev_guide_cli_reference/bi_cli_reference.htm). Visual Studio Code Developers Use VS Code as your template IDE for template customization. VS Code provides the CLI commands from the Command Palette and content assist and validation for the template json files. For more information, see [Use Visual Studio (VS) Code and the Salesforce Extensions for CRM Analytics Template Development](https://help.salesforce.com/s/articleView?id=analytics.bi_templatesdev_vs_code_intro.htm&type=5). CRM Analytics REST API access Refer to the documentation on [Authentication to the CRM Analytics REST API](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_rest_authentication.htm) to access and use the API. Source app and its ID Typically, you build an app and it becomes a source app when you create a template from it. You can also use a template to create a source app. However you create the app, note the 18-character app ID in the URL. It’s shown here in boldface:`https://salesforce.com/analytics/wave/wave.apexp?tsid=2x0x0002xxx#application/00l0b000002AynIAAS`. The ID becomes the `folderId` you use as you work with the WaveTemplate object. Create a Source App From Scratch Use CRM Analytics Studio to build an app with lenses, dashboards, datasets, recipes, and the default Salesforce dataflow. Create a Source App From a Template 1. Create an app from the template using the wizard. Use the Analytics CLI to create the app if you must set variables that the wizard doesn't expose. In the CLI, use an `analytics app create` command. 2. Next, turn the app into the source app by coupling it with the template. With the Analytics CLI, use `analytics template update` with the `folderSourceID`. See [Step 8: Update an Existing Template.](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-update-template.md) Now, the new app becomes the source app in the org. Any updates made to the folder assets in the new source app are tied to the template. Org Data Considerations Creating a template from your app isn’t a way to move data from one org to another. Datasets are templatized with header references. For datasets built by recipes and dataflows, they’re populated with data from the user org when the app is created. For external datasets created by CSV uploads, only minimal data is present when a new app is created from the template. For example, if the source app contains a dataset created with a CSV upload, the template is created with a sample CSV that is only one dataset part of the original CSV. When a user creates an app from the template, they must upload their own CSV or a CSV provided to them to update and complete the dataset. # Project a Custom Fiscal Date Part To project a custom fiscal date part, pass custom fiscal date parts to the `EXTRACT()` function. ```nolang SELECT EXTRACT(FISCAL_YEAR FROM CloseDate) AS CloseDate_Fiscal_Year, EXTRACT(FISCAL_QUARTER FROM CloseDate) AS CloseDate_Fiscal_Quarter, EXTRACT(FISCAL_MONTH FROM CloseDate) AS CloseDate_Fiscal_Month, EXTRACT(FISCAL_WEEK FROM CloseDate) AS CloseDate_Fiscal_Week FROM "OpportunityFiscalEMTimezoned" LIMIT 10; ``` | CloseDate_Fiscal_Year | CloseDate_Fiscal_Quarter | CloseDate_Fiscal_Month | CloseDate_Fiscal_Week | | --------------------- | ------------------------ | ---------------------- | --------------------- | | 2015 | 4 | 11 | 49 | | 2015 | 4 | 11 | 49 | | 2015 | 4 | 12 | 49 | | 2015 | 4 | 12 | 53 | | 2015 | 4 | 12 | 54 | | 2016 | 1 | 1 | 5 | | 2016 | 1 | 2 | 9 | | 2016 | 1 | 2 | 9 | | 2016 | 1 | 3 | 13 | | 2016 | 1 | 3 | 13 | # Project a Date Field To project a date field of type `DateTime`, use the `EXTRACT()` function on the date field in the `SELECT` statement. ```nolang SELECT CloseDate FROM "OpportunityFiscalEMTimezoned" LIMIT 1; ``` | CloseDate | | ------------------- | | 2014-12-30 16:00:00 | This example projects only the year from the `DateTime` field. ```nolang SELECT EXTRACT(Year FROM CloseDate) As CloseDate_Year FROM "OpportunityFiscalEMTimezoned" LIMIT 1; ``` | CloseDate_Year | | -------------- | | 2014 | # Projection Interactions Use the `asProjection()` serialization function to specify the projection of a field in a SAQL query. Given this data from a source query: ```json [ {expression: "first", alias: "foo"} {expression: "second", alias: "bar"} ] ``` You can bind the projection of a field in a target query. ```javascript q = foreach q generate {{row(stepFoo.selection, [0], ["expression", "alias"]).asProjection()}}; ``` After CRM Analytics evaluates the interaction, the projection becomes: ```javascript q = foreach q generate first as 'foo'; ``` To return all rows in the interaction, create this filter. ```javascript q = foreach q generate {{row(stepFoo.selection, [], ["expression", "alias"]).asProjection()}}; ``` After CRM Analytics evaluates the interaction, the filter becomes: ```javascript q = foreach q generate first as 'foo', second as 'bar'; ``` # quarter_days(date) Returns the number of days in the quarter for a specific date. ```nolang q = foreach q generate quarter_days(BillDate) as "Days in Billing Quarter"; ``` # quarter_first_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day of the quarter that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", quarter_first_day(OrderDate) as "quarter_first_day" FROM "dates_sample_data"; ``` | date | quarter_first_day | | ------------------- | ------------------- | | 2015-01-21 15:30:00 | 2015-01-01 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-01 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-01 00:00:00 | | 2015-02-03 15:30:00 | 2015-01-01 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-01 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-01 00:00:00 | | 2015-12-03 00:00:00 | 2015-10-01 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-01 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-01 00:00:00 | # quarter_last_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the quarter that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", quarter_last_day(OrderDate) as "quarter_last_day" FROM "dates_sample_data"; ``` | date | quarter_last_day | | ------------------- | ------------------- | | 2015-01-21 15:30:00 | 2015-03-31 00:00:00 | | 2015-01-21 00:00:00 | 2015-03-31 00:00:00 | | 2015-01-31 10:00:30 | 2015-03-31 00:00:00 | | 2015-02-03 15:30:00 | 2015-03-31 00:00:00 | | 2016-01-21 23:59:59 | 2016-03-31 00:00:00 | | 2015-10-31 23:59:59 | 2015-12-31 00:00:00 | | 2015-12-03 00:00:00 | 2015-12-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-03-31 00:00:00 | | 2016-01-11 03:30:00 | 2016-03-31 00:00:00 | # quarter_last_day(date) Returns the date of the last day of the quarter for a specific date. ```nolang q = foreach q generate quarter_last_day('BillDate') as "Quarter Last Day"; ``` # Query Returns report data without saving changes to an existing report or creating a new one. ## Resource URL ```nolang /services/data//analytics/reports/query ``` ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |POST|Run a report without creating or saving the report. Customize your report using `reportMetadata` that you specify in the request body. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-report-query-example.md).| ## Request Body **Report metadata** |Property|Type|Description| |--------|----|-----------| |`aggregates`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field can be referenced in a row-level formula (true) or not (false).| |`buckets`|[Bucket field](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a bucket field.| |`chart`|[Chart[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Details about the chart used in a report.| |`crossFilters`|[Cross filter](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|Cross filters applied to the report.| |`customDetailFormula`|[Custom Detail Formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|An array of objects that describes row-level formulas.| |`customSummaryFormula`|[Custom summary formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a custom summary formulas.| |`currency`|String|Report currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is `null` if the organization does not have Multi-Currency enabled.| |`dashboardSetting`|Name/value pair|Allows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The `Name` and `Value` fields in `dashboardSetting` are used as Grouping and Aggregate in dashboard components.| |`detailColumns`|Array of strings|Unique API names for the fields that have detailed data.| |`developerName`|String|Report API name.| |`division`|String|Determines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.| |`folderId`|String|ID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.| |`groupingsAcross`|[Groupings across[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.| |`groupingsDown`|[Groupings down[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each row grouping in a report. The identity is `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for grouping.| |`hasDetailRows`|Boolean|Indicates whether to include detailed data with the summary data.| |`hasRecordCount`|Boolean|Indicates whether the report shows the record count.| |`historicalSnapshotDates`|Array of strings|List of historical snapshot dates.| |`id`|String|Unique report ID.| |`name`|String|Display name of the report.| |`presentationOptions`|[Report presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Display options in the Lightning Report Builder.| |`reportBooleanFilter`|String|Logic to parse custom field filters. Value is `null` when filter logic is not specified.| |`reportFilters`|[Filter details[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of each custom filter in the report along with the field name, filter operator, and filter value.| |`reportFormat`|String|Format of the report. Possible values are `TABULAR`, `SUMMARY`, `MATRIX`, or `MULTI_BLOCK`. The `MULTI_BLOCK` property is available in API version 43.0 and later.| |`reportType`|Report type|Unique API name and display name for the report type. `type` (string) is the unique identifier of the report type. `label` (string) is the display name of the report type.| |`scope`|String|Defines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`showGrandTotal`|Boolean|Indicates whether the report shows the grand total.| |`showSubtotals`|Boolean|Indicates whether the report shows subtotals, such as column or row totals.| |`sortBy`|Array of strings|API name of the field on which the report is sorted and the direction of the sort (asc or desc).| |`standardDateFilter`|Array of strings|Standard date filters available in reports. Each standard date filter contains the following properties: `column` (API name of the date field on which you filter the report data), `durationValue` (the range for which you want to run the report; the value is a date literal or 'CUSTOM.'), `startDate` (start date), and `endDate` (end date).| |`standardFilters`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsRoleHierarchy`|Boolean|Indicates whether the report type supports role hierarchy filtering (true) or not (false).| |`topRows`|[Top rows](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a row limit filter applied to the report.| |`userOrHierarchyFilterId`|String|Unique user or role ID of the user or role used by the report's role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!{_column_name_} represents a unique count of values for the specified {_column_name_}. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.” ```nolang { ... "reportBooleanFilter": "(1 OR 2) AND 3", "reportFilters": [ { "value": "Analyst,Integrator,Press,Other", "column": "TYPE", "operator": "notEqual" }, { "value": "100,000", "column": "SALES", "operator": "greaterThan" }, { "value": "Small", "column": "Size", "operator": "notEqual" } ] } } ``` Example sortBy: ```nolang "sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}] ``` **Chart** |Property|Type|Description| |--------|----|-----------| |`chartType`|String|Type of chart.| |`groupings`|String|Report grouping.| |`hasLegend`|Boolean|Indicates whether the report has a legend.| |`showChartValues`|Boolean|Indicates whether the report shows chart values.| |`summaries`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`summaryAxisLocations`|String|Specifies the axis that shows the summary values. Valid values are `X` and `Y`.| |`title`|String|Name of the chart.| Example summaries identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. **Groupings down** |Property|Type|Description| |--------|----|-----------| |`name`|String|API name of the field used as a row grouping.| |`sortOrder`|String|Order in which data is sorted within a row grouping. Value can be `asc` for ascending order or `desc` for descending order.| |`dateGranularity`|String|Interval set on a date field that’s used as a row grouping. Value can be Day, Calendar Week, Calendar Month, Calendar Quarter, Calendar Year, Fiscal Quarter, Fiscal Year, Calendar Month in Year, or Calendar Day in Month.| |`sortAggregate`|String|Summary field that’s used to sort data within a grouping in a report that’s in summary format. Applies if you have the Aggregate Sort feature enabled as part of its pilot program. The value is null when data within a grouping is not sorted by a summary field. In this example, data grouped by Account Owner is sorted by the sum of Annual Revenue.| Example sortAggregate: ```nolang { "aggregates": ["s!SALES","RowCount"], "groupingsDown": [ { "name": "USERS.NAME", "sortOrder": "Desc", "dateGranularity": "None", "sortAggregate": "s!SALES" } ] } ``` **Report presentation options** |Property|Type|Description| |--------|----|-----------| |`hasStackedSummaries`|Boolean|Indicates whether stacked summaries are enabled in the report.| |`historicalColumns`|[Historical column presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Presentation options of the historical column.| Example historicalColumns presentation options: ```nolang "presentationOptions" : { "historicalColumns" : { "Opportunity__hd.CloseDate__hst" : { "decreaseIsPositive" : false, "showChanges" : false }, "Opportunity__hd.Amount__hst" : { "decreaseIsPositive" : false, "showChanges" : true } } } ``` **Historical column presentation options** |Property|Type|Description| |--------|----|-----------| |`decreaseIsPositive`|Boolean|Indicates whether a negative change (decrease in value) is displayed in green instead of red in Lightning Report Builder.| |`showChanges`|Boolean|Indicates whether to display a change column for a given historical column.| **Groupings across** |Property|Type|Description| |--------|----|-----------| |`name`|String|API name of the field used as a column grouping.| |`sortOrder`|String|Order in which data is sorted within a column grouping. Value can be `asc` for ascending order or `desc` for descending order.| |`dateGranularity`|String|Interval set on a date field used as a column grouping. Value can be Day, Calendar Week, Calendar Month, Calendar Quarter, Calendar Year, Fiscal Quarter, Fiscal Year, Calendar Month in Year, or Calendar Day in Month.| **Filter details** |Property|Type|Description| |--------|----|-----------| |`column`|String|Unique API name for the field that’s being filtered.| |`filterType`|String|Describes the type of value used to filter report data. Valid values are `fieldToField` (filters report data by comparing values of one field with the values of a second field), `fieldValue` (filters report data by comparing values of a field with a defined value), or `null` (if null, the `filterType` defaults to `fieldValue`).| |`isRunPageEditable`|Boolean|Indicates if this is an editable filter in the user interface.| |`operator`|String|Unique API name for the condition used to filter a field such as “greater than” or “not equal to.” Filter conditions depend on the data type of the field. Valid values are `equals`, `notEqual`, `lessThan`, `greaterThan`, `lessOrEqual`, `greaterOrEqual`, `contains`, `notContain`, `startsWith`, `includes`, `excludes`, or `within` (`DISTANCE` criteria only).| |`value`|String|Value by which a field is filtered. For example, the field Age can be filtered by a numeric value. For datetime fields, if you make a POST request and specify a calendar date without including a time, then a default time gets included. The time defaults to midnight minus the difference between your timezone and Greenwich Mean Time (GMT). For example, if you specify 8/8/2015 and your timezone is Pacific Standard Time (GMT-700), then the API returns 2015-08-08T07:00:00Z.| Example filterType. In this example, the first filter is a field-to-field filter that compares the Amount field with Projected Amount field. The second filter is a field filter that returns records for which a row-level formula returns more than 0. ```nolang "reportFilters" : [ { "column" : "AMOUNT", "filterType" : "fieldToField", "isRunPageEditable" : true, "operator" : "notEqual", "value" : "PROJECTED_AMOUNT" }, { "column" : "CDF1", "filterType" : "fieldValue", "isRunPageEditable" : true, "operator" : "greaterThan", "value" : "0" } ] ``` **Bucket field** |Property|Type|Description| |--------|----|-----------| |`bucketType`|BucketType|The type of bucket. Possible values are `number`, `percent`, and `picklist`| |`developerName`|String|API name of the bucket.| |`label`|String|User-facing name of the bucket.| |`nullTreatedAsZero`|Boolean|Specifies whether null values are converted to zero (`true`) or not (`false`).| |`otherBucketLabel`|String|Name of the fields grouped as “Other” (in buckets of `BucketType` `PICKLIST`).| |`sourceColumnName`|String|Name of the bucketed field.| |`values`|Array of BucketTypeValues|Describes the values included in the bucket field..| **Bucket field value** |Property|Type|Description| |--------|----|-----------| |`label`|String|The user-facing name of the bucket.| |`sourceDimensionValues`|String|A list of the values from the source field included in this bucket category (in buckets of type `PICKLIST` and buckets of type `TEXT`).| |`rangeUpperBound`|Double|The greatest range limit under which values are included in this bucket category (in buckets of type `NUMBER`).| **Cross filter** |Property|Type|Description| |--------|----|-----------| |`criteria`|Array of [Filter details[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Information about how to filter the `relatedEntity`. Use to relate the primary entity with a subset of the `relatedEntity`.| |`includesObject`|Boolean|Specifies whether objects returned have a relationship with the `relatedEntity` (true) or not (`false`).| |`primaryEntityField`|String|The name of the object on which the cross filter is evaluated.| |relatedEntity|String|The name of the object that the `primaryEntityField` is evaluated against. (The right-hand side of the cross filter).| |relatedEntityJoinField|String|The name of the field used to join the `primaryEntityField` and `relatedEntity`.| **Custom Detail Formula** |Property|Type|Description| |--------|----|-----------| |`decimalPlaces`|Integer|Formats the value returned by the row-level formula. It is required for numeric return values, invalid for non-numeric return values.| |`description`|String|User-defined description of the row-level formula.| |`formula`|String|Specifies the formula expression to be evaluated. All report type fields, except bucketed fields and historical tracking fields can be referenced.| |`formulaType`|String|Specifies the return type of the formula. Valid values include date, datetime, number, or text.| |`label`|String|Specifies a name for the row-level formula.| **Custom summary formula** |Property|Type|Description| |--------|----|-----------| |`label`|String|The user-facing name of the custom summary formula.| |`description`|String|The user-facing description of the custom summary formula.| |`formulaType`|String|The format of the numbers in the custom summary formula. Possible values are `number`, `currency`, and `percent`.| |`decimalPlaces`|Integer|The number of decimal places to include in numbers.| |`downGroup`|String|The name of a row grouping when the `downGroupType` is `CUSTOM`. `Null` otherwise.| |`downGroupType`|String|Where to display the aggregate of the custom summary formula. Possible values are `all`, `custom`, and `grand_total`.| |`acrossGroup`|String|The name of a column grouping when the `accrossGroupType` is `CUSTOM`. `Null` otherwise.| |`acrossGroupType`|String|Where to display the aggregate of the custom summary formula. Possible values are `all`, `custom`, and `grand_total`.| |`formula`|String|The operations performed on values in the custom summary formula.| **Top rows** |Property|Type|Description| |--------|----|-----------| |`rowLimit`|Integer|The number of rows returned in the report.| |`direction`|String|The sort order of the report rows.| ## Response Body |Property|Type|Description| |--------|----|-----------| |`allData`|Boolean|When True, all report results are returned. When False, results are returned for the same number of rows as a report run in Salesforce. For reports that have too many records, use filters to refine results.| |`attributes`|[Attributes](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md)|Key report attributes and child resource URLs.| |`factMap`|[Fact map](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md)|Summary level data or both summary and detailed data for each row or column grouping. Detailed data is available if `hasDetailRows` is `true`. Each row or column grouping is represented by combination of row and column grouping keys defined in [Groupings down](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md) and [Groupings across](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md). See these [examples of fact map keys](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-factmap-example.md).| |`groupingsAcross`|[Groupings across](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md)|Collection of column groupings, keys, and their values.| |`groupingsDown`|[Groupings down](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md)|Collection of row groupings, keys, and their values.| |`hasDetailRows`|Boolean|When true, the fact map returns values for both summary level and record level data. When false, the fact map returns summary values.| |`hasExceededTabularRowLimit`|Boolean|When True, returns results for the same number of rows as a report run in Salesforce. For a report on Salesforce Objects, total and subtotal rows don't count toward this limit. For a report on Data 360 Objects, total and subtotal rows do count toward this limit. When False, all report results are returned.| |`reportExtendedMetadata`|[Report extended metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Additional information about columns, summaries, and groupings.| |`reportMetadata`|[Report metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Unique identifiers for groupings and summaries.| **Attributes** |Property|Type|Description| |--------|----|-----------| |`describeUrl`|String|Resource URL to get report metadata.| |`instancesUrl`|String|Resource URL to run a report asynchronously. The report can be run with or without filters to get summary or both summary and detailed data. Results of each instance of the report run are stored under this URL.| |`type`|String|API resource format.| |`reportName`|String|Display name of the report.| |`reportId`|String|Unique report ID.| **Fact map** |Property|Type|Description| |--------|----|-----------| |`rows`|[Data cells[]](sforce-analytics-rest-api-getreportrundata.md#execute-sync)|Array of detailed report data listed in the order of the detail columns provided by the report metadata.| |`aggregates`|[Aggregates[]](sforce-analytics-rest-api-getreportrundata.md#execute-sync)|Summary level data including record count for a report.| **Data cells** |Property|Type|Description| |--------|----|-----------| |`value`|[Detail column info data type](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|The value of a specified cell. If the response is an empty string, then API version 36.0 and earlier returns null. API version 37.0 and later returns an empty string.| |`label`|String|Display name of the value as it appears for a specified cell in the report.| **Aggregates** |Property|Type|Description| |--------|----|-----------| |`value`|Number|Numeric value of the summary data for a specified cell.| |`label`|String|Formatted summary data for a specified cell.| **Groupings across** |Property|Type|Description| |--------|----|-----------| |`groupings`|[Groupings[]](sforce-analytics-rest-api-getreportrundata.md#execute-sync)|Information for each column grouping as a list.| **Groupings** |Property|Type|Description| |--------|----|-----------| |`value`|String|Value of the field used as a row or column grouping. The value depends on the field’s data type.| |`key`|String|Unique identity for a row or column grouping. The identity is used by the [fact map](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md) to specify data values within each grouping.| |`label`|String|Display name of a row or column grouping. For date and time fields, the label is the localized date or time.| |`groupings`|Array|Second or third level row or column groupings. If there are none, the value is an empty array.| |`dategroupings`|Array|Start date and end date of the interval defined by `date granularity`.| Grouping value by field data type: - Currency fields: `amount` (currency; value of a data cell) and `currency` (picklist; the ISO 4217 currency code, if available—for example, USD for US dollars or CNY for Chinese yuan; if the grouping is on the converted currency, this is the currency code for the report and not for the record). - Picklist fields: API name. For example, a custom picklist field, Type of Business with values 1, 2, 3 for Consulting, Services, and Add-On Business, has `1`, `2`, or `3` as the grouping value. - ID fields: API name. - Record type fields: API name. - Date and time fields: Date or time in ISO-8601 format. - Lookup fields: Unique API name. For example, for the Opportunity Owner lookup field, the ID of each opportunity owner’s Chatter profile page can be a grouping value. **Groupings down** |Property|Type|Description| |--------|----|-----------| |`groupings`|[Groupings[]](sforce-analytics-rest-api-getreportrundata.md#execute-sync)|Information for each row grouping as a list.| # Query Data Let’s learn how to inject query results into your running Lightning Web Component code. **note:** This doesn't apply to custom Lightning web components in Lightning dashboards as they don't query data. To start, modify your Hello World component to use a step by setting `hasStep` to `true` in the `js-meta.xml`. ```xml true ``` Add the results wiring into your `.js` file. ```javascript import { LightningElement, api } from "lwc"; export default class HelloWorld extends LightningElement { @api title; @api results; get stringResults() { return JSON.stringify(this.results); } } ``` To view the query results as text, update your `.html` file. ```html ``` Deploy the changes to your component to your org. Refresh your dashboard to pick up any updates to the component code. After refreshing the dashboard, edit the dashboard and click your component. You’re now prompted to select a data source. You can select a dataset to create a query or select an existing query. Make your selection and watch the query results appear in your dashboard. **See Also** - [Component Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-attributes.md) - [CRM Analytics Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-config.md) - [Lightning Dashboards Configuration](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-lightning-dashboard-config.md) - [Other Widgets](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-other.md) # Query Performance Here are some guidelines for structuring your queries to improve performance. - **[Speed Up Queries with Dataflow Transformations](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-dataflow-transformations.md)** To speed up your queries and reduce the number of network round trips, perform data transformations in the ELT process instead of in the query. - **[Limit Multivalue Fields](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-multivalue-fields.md)** Multivalue fields can cause poor performance. The behavior of these fields is undefined for `group-by` and `foreach` statements. If possible, write your query so that the fields are referenced only in filters. - **[Use Group and Filter Pre-projection](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-group-filter.md)** Improve query performance by moving group and filter operations on simple fields before the `foreach` statement. A simple field is projected as-is and doesn't have additional expressions. - **[Remove Redundant Projections](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-redundant-projections.md)** To improve memory usage and performance costs, remove unnecessary projections from your queries and load only the data required. If you have to perform an operation, include pre-projection statements as needed. - **[Check for Redundant Filters](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-redundant-filters.md)** Binding and faceting in your dashboard design can generate redundant filters. Check the SAQL queries that your dashboard produces to remove unnecessary filters. Consider how a filter in your dashboard UI interacts with one in your query and vice versa. - **[Limit the Use of unique()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-unique.md)** `unique()` can affect query performance for large datasets that have over 100 million rows and include more than one million unique values. For large datasets, `unique()` is faster for measures than for dimensions. If counting the number of unique string values causes performance issues, convert the string to a number. For example, use a hash of the string value or refer to the index of the string in a sorted list of string values. - **[arimax Show Parameters Query Tool](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-arimax-show-parameters.md)** The `showParams` parameter is provided for you as a query developer tool. It allows you to run an `arimax` query and review the model parameters and Bayesian Information Criteria (BIC) to understand the data better and improve query efficiency. # Quick Start Connect to Salesforce and authenticate, then run a report using the Reports and Dashboards REST API. # Quick Start Get up to speed quickly with these easy SAQL examples. - **[Write Your First Query](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/task/bi-saql-first-query.md)** Let's walk through each part of a simple SAQL query. - **[Create a Derived Measure](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-derived-measure.md)** Perform calculations on existing measures and use the result to create a new, or derived, measure. - **[Create a Derived Dimension](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-derived-dimension.md)** Perform string manipulations on existing dimensions to create a new, or derived, dimension. # Quick Start: Run Your First Query Let’s write a basic query for SQL for CRM Analytics in Analytics Studio. 1. In CRM Analytics Studio, open a Lens on a dataset. 2. Click the **Query Mode** button. ![Query mode icon on a New Lens screen](https://developer.salesforce.com/docs/media/bi_dev_guide_sql/bi_sql_query_mode.png) 3. SAQL is the default query language. To use SQL, click **Switch to SQL**. ![Switch to SQL in Query Mode](https://developer.salesforce.com/docs/media/bi_dev_guide_sql/bi_sql_query_switch.png) 4. Switching to SQL provides a warning that switching clears your current query. If you don't want to lose the SAQL query, copy it. Then click **Switch to SQL**. ![Switch Query Mode modal](https://developer.salesforce.com/docs/media/bi_dev_guide_sql/bi_sql_query_modal.png) **note:** To return to SAQL query language, click the **Chart Mode** button, then click the **Query Mode** button. If you return to SAQL, you lose any SQL query changes that you made. 5. The default query for SQL is the row count in your dataset. Let's update the query to count the number of times a category occurs for each city. To run the query, click the **Run Query** button. Because we limit the results to 10 rows, the results display the first 10 cities in the furniture category. ![Run SQL query](https://developer.salesforce.com/docs/media/bi_dev_guide_sql/bi_sql_run_query.png) ```nolang SELECT Category, City, count(*) as "count" FROM "Superstore" GROUP BY Category, City LIMIT 10; ``` | Category | City | count | | --------- | ------------ | ----- | | Furniture | Akron | 2 | |   | Alexandria | 3 | |   | Allen | 1 | |   | Allentown | 1 | |   | Amarillo | 4 | |   | Anaheim | 8 | |   | Andover | 1 | |   | Apopka | 1 | |   | Apple Valley | 2 | |   | Arlington | 13 | # Quoted String Escape Sequences Strings can be escaped with the backslash character. You can use the following string escape sequences: | Sequence | Meaning | | -------- | -------------------------- | | `\n` | New line | | `\r` | Carriage return | | `\t` | Tab | | `\'` | One single-quote character | | `\"` | One double-quote character | | `\\` | One backslash character | # radians({n}) Returns the radians value of `{n}` degrees. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `radians()` returns `null`. `radians({n})` takes the following syntax. ```nolang SELECT RADIANS(N) as ALIAS FROM DATASET; ``` ## Example This example returns the radians of 90 degrees. ```nolang SELECT RADIANS(90) as radiansValue FROM "Opportunity" LIMIT 1; ``` | radiansValue | | ------------ | | 1.57079 | # radians(n) Returns the radians value of a degrees value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `radians()` returns `null`. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate radians(degrees) as radians; ``` # Range Filter Interactions Use the `asRange()` serialization function to bind filters based on numeric ranges. Let’s look at some examples with inclusive ranges. The source query for an interaction produces these results. ```json [ {grouping: "first", measure: 19} {grouping: "second", measure: 32} ] ``` You can bind the filter using this syntax. ```javascript q = filter q by {{row(stepFoo.selection, [0], ["min", "max"]).asRange("bar")}}; ``` After evaluating the interaction, CRM Analytics produces this range filter. ```javascript q = filter q by bar >= 19 && bar <= 32; ``` # Reading the Template Debug Logs Each `Analytics Templated App Poller` log contains multiple log lines generated from different log events. Multiple logs are written out during the templated app lifecycle of create, reset, or upgrade, usually 3–4 separate logs containing different details from the processing. Each log is a `Analytics Templated App Poller` log. **note:** Each log entry has a 2-MB limit controlled by org limits and is truncated when the limit is exceeded. The `Analytics Templated App Poller` log includes these details. | Log Level | Apex Log Event | Details | Example Log Line | | --------- | --------------------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Info` | `WAVE_APP_LIFECYCLE` | The app action, app lifecycle phase, app id, and app name. | `14:04:00.399 (51399277642)​|WAVE_APP_LIFECYCLE​|CREATE​|CREATE_UPDATE_DASHBOARDS​|00lRM000000gP2LYAU​|Sales Analytics Test` | | `Error` | `TEMPLATE_PROCESSING_ERROR` | Displays any template processing errors. | `13:06:42.63 (2341994782)​|TEMPLATE_PROCESSING_ERROR​|CREATE​|Application Sales Analytics Test (00lRM000000gP2LYAU) failed` | | `Fine` | `APP_CONTAINER_INITIATED` | The template values and variables. | `14:01:55.50 (15050452403)​|APP_CONTAINER_INITIATED​|{"User":{"Id":"005xx00000xxxxx”,”UserName”:”admin@na44stmfa.com","FirstName":"Admin","LastName":"User"},"Org":{"Id":"00DRM000000xxxx”,”Name”:”STMFA”,”Namespace":""},"Apps":{},"App":{"Dashboards":{},"Lenses":{},"Datasets":{},"Images":{},"StoredQueries":{}},"Variables":{"autoconfig":"false","DefaultsVisible":true,…}}` | | `Fine` | `TEMPLATED_ASSET` | The app asset status, which is created, updated, or deleted. | `14:03:24.627 (15627342211)​|TEMPLATED_ASSET​|Successfully created/updated dashboard [Executive Overview(Exec_Overview_Pipeline_Performance1)]...` | | `Fine` | `TRANSFORMATION_SUMMARY` | The template asset name and type being transformed to an app asset. | `14:03:25.684 (16692521613)​|TRANSFORMATION_SUMMARY​|ASSET_CREATE_UPDATE​|Transforming template with name [Account_Summary] and type [dashboardTemplate]` | | `Fine` | `RULES_EXECUTION_SUMMARY` | The rule name, `appliesTo` types, actions, and any conditions. | `14:03:15.266 (7081461905)​|RULES_EXECUTION_SUMMARY​|ASSET_CREATE_UPDATE, Processing action [Action {action='delete', path='$.workflowDefinition..[?(@.name=='HasRevenueSchedule')]', value='null', description='delete node from workflow'}]` | | `Fine` | `ASSET_DIFF_SUMMARY` | The summary of differences for an asset on an app reset or upgrade. | `15:09:24.682 (9748463760)​|ASSET_DIFF_SUMMARY​|Action: UPDATE, Reason: DIFFERENCES_DETECTED, Asset ID: 0FKRM0000000boU4AQ, Label: Trending, Type: dashboard, Template: Trending (Sales_Rep_Pipeline_Changes)` | | `Fine` | `JSON_DIFF_SUMMARY` | The summary of differences for JSON on an app reset or upgrade. | `15:09:21.493 (6865203874)​|JSON_DIFF_SUMMARY​|ASSET_DIFF​|Found [106] differences between existing dashboard and new dashboard [0FKRM0000000boN4AQ] [Summary of Account]` | | `Finer` | `RULES_EXECUTION_DETAIL` | The rule results for each action of a rule. | `14:03:35.872 (26905199214)​|RULES_EXECUTION_DETAIL​|ASSET_CREATE_UPDATE, set, $['state']['gridLayouts'][0]['pages'][0]['widgets'][33]['column'], 20` | | `Finest` | `JSON_DIFF_DETAIL` | The detailed difference for JSON on an app upgrade or reset. | `15:09:24.682 (9729246304)​|JSON_DIFF_DETAIL​|ASSET_DIFF​|Action {action='set', path='$.Extract_Account.parameters.fields[8].name', value='BillingPostalCode', description='Change 11: 'String values are not equal: new [BillingPostalCode] old [BillingCountry]''}` | Setting the `Wave` category log level to `Finest` includes all the log events in the log file. ## Example A sample `Analytics Templated App Poller` log file: ![Sample templated app debug log file](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_debug_log_detail.png) **note:** The templated app debug log files are also visible via the Salesforce Dev Console after the debug trace flags are created. # Recently Created Reports Get the list of recently created reports for a particular report type for the current user or any other users. ## Syntax **URI:** `/services/data//analytics/report-types//recent-reports` **Formats:** JSON **HTTP Methods** |Method|Description| |------|-----------| |`GET`|Returns a list of recently created reports for a specific report type.| **Parameters** |Parameter|Description| |---------|-----------| |`pageSize`|`Integer` Required for `GET` calls. Specifies number of recently created reports to return.| |`isCurrentUser`|`Boolean` Optional for `GET` calls. Specifies if results are limited to current user (`true`) or all other users (`false`). Default value is `false`.| |`offset`|`Integer` Optional for `GET` calls. Specifies offset of returned report list. Default value is `0`.| ## GET Response Body The response body is a list of the recently created reports for the report type. |Property|Description| |--------|-----------| |`createdByUser`|Name of user who created report.| |`createdDate`|Timestamp of report creation.| |`id`|Id of report.| |`name`|Name of report.| ## Example **Sample Request** ```nolang analytics/report-types/AccountList/recent-reports?pageSize=3&isCurrentUser=true&offset=3 ``` **Sample Response** ```nolang [ { "createdByUser" : "Admin User", "createdDate" : "2021-11-03T17:31:53.000+0000", "id" : "00Oxx0000011ghvEAA", "name" : "New Accounts Report1" }, { "createdByUser" : "Admin User", "createdDate" : "2021-10-19T17:20:44.000+0000", "id" : "00Oxx0000011gLVEAY", "name" : "Sample Report: # of Accounts" } ] ``` # Recently Used Report Types Get the list of report types used in the 50 reports most recently created by the current user. ## Syntax **URI:** `/services/data//analytics/report-types/recent/by-user` **Formats:** JSON **HTTP Methods** |Method|Description| |------|-----------| |`GET`|Returns a list of report types used by reports recently created by the current user.| ## GET Response Body The response body is a list of the report types used in reports recently created by the user. |Property|Description| |--------|-----------| |`describeUrl`|A URL link to the report type’s metadata.| |`isCustomReportType`|Indicates whether a report type is custom (`true`) or not (`false`).| |`isHidden`|Indicates whether an administrator has hidden the report type (`true`) or not (`false`). Hidden report types don’t appear in the report builder when creating a report.| |`isHistorical`|Indicates whether it’s a historical tracking report type (`true`) or not (`false`).| |`label`|The display name of the report type.| |`lastUsedDate`|Timestamp when the report type was last used.| |`supportsJoinedFormat`|Indicates whether a report type is compatible with joined reports (`true`) or not (`false`).| |`type`|The API name of the report type.| ## Example **Sample Request** ```nolang analytics/report-types/AccountList/recent-reports?pageSize=3&isCurrentUser=true&offset=3 ``` **Sample Response** ```nolang [ { "createdByUser" : "Admin User", "createdDate" : "2021-11-03T17:31:53.000+0000", "id" : "00Oxx0000011ghvEAA", "name" : "New Accounts Report1" }, { "createdByUser" : "Admin User", "createdDate" : "2021-10-19T17:20:44.000+0000", "id" : "00Oxx0000011gLVEAY", "name" : "Sample Report: # of Accounts" } ] ``` # Reference Curious about a property in the Reports and Dashboards REST API? This reference details each property, method, and URL parameter for each Reports and Dashboards REST API resource. # Reference Detailed reference for Lightning Web Components in Analytics dashboards. ## Component Configuration Description of attributes for the component `js-meta.xml` file. **`analytics__Dashboard` Target** To allow the component to be used in Analytics dashboards, add this target to the list of `targets`. ```nolang analytics__Dashboard ``` To customize how the component appears in Analytics dashboards, add a `targetConfig` to `targetConfigs`. ```nolang ``` **`` tag** In an `analytics__Dashboard` target config, you can choose to include the `true` attribute. For Lightning dashboards, the \ tag is always set to false. ```nolang true ``` This attribute indicates that your component requires a dashboard step to function as expected. With this tag, the dashboard builder UI prompts the user to attach an existing step or to create a step to an instance of the component. Components with an attached step have access to step specific API hooks like `results` and `selection`. **Measure and Dimension Attribute Data Types** Attributes specified in an `analytics__Dashboard` target config are displayed in the Analytics dashboard builder UI for configuration. In addition to the common data types, this target also supports `Measure` and `Dimension` data types for components with `true`. The dashboard builder is able to choose a column of the given data type from the results of the attached step. ```nolang true ``` ## API Hooks Overview **note:** These API hooks aren’t supported for Lightning dashboards. | Name | Description | Available for Use in LWC | | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | | `results` | An array of objects. | Requires `true`. | | `metadata` | An object with three arrays: `groups`, `strings`, and `numbers`. Each array is the field name of each type from the associated query. | Requires `true`. | | `selectMode` | Returns the selection mode of the associated query. Valid values are:
  • `single`
  • `multi`
  • `singlerequired`
  • `multirequired`
  • `none`
| Requires `true`. | | `selection` | The current selection of the associated step. | Requires `true`. | | `setSelection` | Use this function to modify the current selection on the associated step and inform the parent dashboard. | Requires `true`. | | `getState` | Use this function to retrieve the entire parent dashboard state as a JSON document. | Always available. | | `setState` | Use this function to modify the dashboard state. | Always available | | `refresh` | Use this function to refresh the dashboard state. | Always available | ## API Hooks Details **Results** The results are rows returned by the query represented as an array of maps. ```json [ { "columnOne": "one", "columnTwo": 123 }, { "columnOne": "two", "columnTwo": 456 } ] ``` **Metadata** Metadata describes the shape of the results using lists of column developer names organized into `groups`, `numbers`, and `strings`. - `Groups` - Grouped dimensions. Typically, all grouped columns can be used together as a primary key for the row. - `Strings` - All text fields, also known as `Strings` or `Dimensions`. - `Numbers` - All numeric fields, also known as `Measures`. ```json { "groups": [], "strings": ["columnOne"], "numbers": ["columnTwo"] } ``` **`selectMode`** Returns the select mode specified for the associated step. Valid values are: - `single` - `multi` - `singlerequired` - `multirequired` - `none` ```javascript isMultiSelect() { return this.selectMode.includes('multi'); } ``` **`selection`** The current selection of the associated step as an Array of objects, with each object being one or more selected rows from `results`. Use the `setSelection` function to update the dashboard selection. ```nolang return new Map((this.selection ?? []).map((row) => [this.hash(row), row])); ``` **`setSelection`** The `setSelection` function is a callback passed in that allows the component to update the attached step's selection in Analytics. In doing so, it potentially applies filters to the rest of the dashboard's contents depending on how the queries are configured. ```javascript this.setSelection(this.isMultiSelect() ? [...selectedRowsByHash.values(), row] : [row]); ``` **`getState` and `setState`** Use `getState` to retrieve the current state of the dashboard. Use `setState` to modify the current state of the dashboard. Fetch and modify all the current selections, filters, and the currently viewed page. Use these functions to add custom logic and behavior that's not standard in the dashboard runtime. ```javascript if (!this.getState().pageId == this.targetPage) { this.priorPage = this.getState().pageId; this.setState({ ...this.getState(), pageId: this.targetPage, replaceState: true }); } ``` Learn more about selection syntax with [Filter and Selection Syntax for Embedded Dashboards](https://help.salesforce.com/articleView?id=bi_embed_filters.htm). **`refresh`** Use `refresh` to rerun either all the queries on the dashboard or a particular query. To rerun a specific query, use the `config` argument with the step id of the query. ```javascript this.refresh({ step: this.step }); ``` ## Custom Lifecycle Methods **`stateChangedCallback`** Use `stateChangedCallback`, a built-in callback method, to inform the component whenever the state of the dashboard changes. Use `stateChangedCallback` to compare the current state with the new state and then rerender if necessary. ```javascript stateChangedCallback(prevState, newState) { // perform comparison logic and set the new state to the current state to trigger a rerender of the component this.currentState = newState; } ``` For an example of this callback in action, see the [Breadcrumb](https://github.com/forcedotcom/sfdx-analytics/tree/main/quick-start/main/default/lwc/breadcrumb) javascript in the GitHub example repository. This callback method is available in v55 and later. # Reference for Analytics Dashboards Aura Component Use the attributes and methods of the `wave:waveDashboard` Aura component to change the state of a CRM Analytics dashboard. - [Attributes for Analytics Dashboards Aura Component](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-attributes.md) - [Methods for Analytics Dashboards Aura Component](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-methods.md) # Reference for Analytics Dashboards Lightning Web Component The Lightning web component for CRM Analytics dashboards has attributes that can be set programmatically so you can create, render, and interact with a CRM Analytics dashboard on a page at runtime. A majority of the attributes are present for both the Lightning and Experience Cloud components, but there are a few differences that are noted. ## Attributes | Name | Type | Required or Optional | Description | | -------------------------- | ----------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `context` | string | Optional | Specifies the context for the dashboard. | | `dashboard` | string | Required if `developer-name` isn’t specified. | Specifies the unique ID of the dashboard. You can get a dashboard’s ID, an 18-character code beginning with `0FK`, from the dashboard’s URL, or you can request it through the API. You can use this attribute instead of `developer-name`, but you can’t include `dashboard` if the name has been set. Either the `developer-name` attribute or the `dashboard` attribute is required. | | `dashboard-metadata` | object | Optional | Specifies the metadata for the dashboard. | | `developer-name` | string | Required if `dashboard` isn’t specified. | Specifies the unique developer name of the dashboard. You can request the developer name through the API. You can use this attribute instead of `dashboard`, but you can’t include `developer-name` if the ID has been set. Either the `developer-name` attribute or the `dashboard` attribute is required. | | `enable-notifications` | boolean | Optional | Indicates whether users can set and manage notifications on widgets (`true`) or not (`false`). The default is `false`. | | `enable-subscriptions` | boolean | Optional | Indicates whether users can subscribe to widgets and manage their subscriptions (`true`) or not (`false`). The default is `false`. | | `height` | integer | Optional | Specifies the height of the dashboard in pixels. The default is 300. | | `hide-on-error` | boolean | Optional | Indicates whether users see a dashboard that has an error (`true`) or not (`false`). When this attribute is set to `true`, if the dashboard has an error it doesn’t appear on the page. When set to `false`, the dashboard appears but doesn’t show any data. An error can occur if a user doesn’t have access to the dashboard or the dashboard is deleted. The default is `false`.| | `is-loaded` | boolean | Optional | Indicates whether the dashboard is fully loaded on the page (`true`) or not (`false`). The default is `false`. | | `open-location` | string | Optional | Specifies where the dashboard opens if the user chooses to launch the dashboard in its own page.| | `page-id` | string | Optional | Specifies the initial dashboard page to show. | | `record-id` | string | Optional | Specifies the ID of the current entity in the context of which the dashboard is being shown.| | `show-header` | boolean | Optional | Indicates whether the dashboard displays a header bar that includes dashboard information and controls (`true`) or not (`false`). The header bar automatically appears when either `show-sharing` or `show-title` is `true`. The default is `false`.| | `show-post-to-slack`| boolean | Optional | Indicates whether the Post to Slack icon appears in the dashboard header (`true`) or not (`false`). **This attribute isn’t available for the `wave-community-dashboard` component.**| | `show-sharing` | boolean | Optional | Indicates whether to show the Share icon for a dashboard (`true`) or not (`false`). If set to `true` and the dashboard is shareable, then the dashboard shows the Share icon. If you choose to show the Share icon in the dashboard, the smallest supported frame size is 800x612 pixels. The default is `false`.| | `show-title` | boolean | Optional | Indicates whether to show the dashboard's title above the dashboard (`true`) or not (`false`). The default is `false`.| | `state` | string | Optional | Specifies the state of the dashboard including any filters or selections that have been applied. See [Filter and Selection Syntax for Embedded Dashboards](https://help.salesforce.com/articleView?id=bi_embed_filters.htm).| | `width` | integer | Optional | Specifies the width of the dashboard in pixels.| ## Lightning Page Example: Attributes for a CRM Analytics Dashboard Component ```xml ``` ## Experience Cloud Page Example: Attributes for a CRM Analytics Dashboard Component ```xml ``` # Reference for Analytics Dashboards Lightning Web Component Use the attributes and methods of the `wave-wave-dashboard-lwc` and `wave-community-dashboard` components to customize and change the state of the CRM Analtyics dashboard. - [Attributes for Analytics Dashboards Lightning Web Component](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-attributes.md) - [Methods for Analytics Dashboards Lightning Web Component](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-methods.md) # Refresh a Dashboard You can refresh a dashboard by using a PUT Dashboard Results request. Dynamic dashboards can also be refreshed via the REST API. Use a PUT request on the [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) resource to trigger a refresh of a dashboard. The refresh response returns the URL of the status resource after the refresh is triggered. If filter parameters are included in the PUT request, only the filtered data will be refreshed. For more information on filtering, see [Filter Dashboard Results](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-dashboard-filter-results.md). ## Example Usage The following PUT request refreshes the dashboard with the ID of `01ZD00000007S89MAE`. ```nolang /services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE ``` ## Example Request Body None required. ## Example Response Body The response contains the status URL for the refreshed dashboard: ```nolang { "statusUrl" : "/services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE/status" } ``` **See Also** - [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) # refresh Method Use the `refresh` method to rerun all of the queries for an Aura component for CRM Analytics dashboards or for a specific query. ## Arguments | Argument Name | Description | | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `config` | The optional configuration for the `refresh` call. This value is a JSON object that sets parameters for the call. For `refresh`, the `config` is used when refresh is called for a single query on the dashboard. To specify which query to rerun, use the `step` parameter. | ## Example Add your implementation of the `refresh` call into the controller.js for your Aura component. The optional `config` JSON is created with the `step` attribute to rerun the query for a specific step. To rerun all the queries for a dashboard, call `refresh` without the `config` attribute. ```javascript ({ refresh: function (component, event, helper) { var dashboard = component.find("myDashboard"); var config = { step: "step_id", }; dashboard.refresh(config); }, }); ``` **See Also** - [`getState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-getstatemethod.md) - [`setState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-setstatemethod.md) # regr_intercept() Uses two numerical fields to calculate a trend line, then returns the y-intercept value. Use this function to find out the likely value of _field_y_ when _field_x_ is zero. ```nolang regr_intercept(field_y, field_x) ``` _field_y_ is a grouped dependent numeric expression and _field_x_ is a grouped independent numeric expression. `regr_intercept(field_y, field_x)` uses simple linear regression to calculate the trend line. The input fields (_field_y_, _field_x_) must contain at least two pairs of non-null values. This function works with simple grouped values but not with cogroups. ## Example - What Is the Likely Amount Won If the Number of Activities Is Zero? Suppose that you have a dataset that includes the number of activities (such as meetings) and the won opportunity amount. ![Sample scatter plot.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_regint.png) What size of deal can you expect to win if you don't have any activities with an account? `regr_intercept` performs a linear analysis on your data then calculates the y-intercept (that is, the value of Amount Won when Number of Activities is zero). ```nolang q = load "Data"; q = group q by all; --trunc() truncates the result to two decimal places q = foreach q generate trunc(regr_intercept('Amount', 'NumActivities'),2) as intercept; ``` The projected deal size with no activities is \$15.04 million dollars. ![Diagram showing y intercept of a regression line.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_y_int.png) **See Also** - [regr_slope()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-rs.md) # regr_intercept() Returns the y-intercept value of a regression line. `regr_intercept()` follows this syntax. ```nolang SELECT regr_intercept(FIELD1, FIELD2) FROM DATASET; ``` # regr_r2() Uses two numerical fields to calculate R-squared, or goodness of fit. Use `regr_r2()` to understand how well the trend line fits your data. ```nolang regr_r2(field_y, field_x) ``` _field_y_ is a grouped dependent numeric expression and _field_x_ is a grouped independent numeric expression. `regr_r2(field_y, field_x)` uses simple linear regression to calculate a trend line, then calculates R-squared. If the returned value is small, then functions like `regr_slope()` and `regr_intercept()` are likely to return accurate results. The input fields (_field_y_, _field_x_) must contain at least two pairs of non-null values. This function works with simple grouped values but not with cogroups. ## Example - How Well Does the Calculated Trend Line Fit My Data Suppose that you have a dataset that includes the number of activities (such as meetings) and the won opportunity amount. ![Sample scatter plot.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_regint.png) You want to check the calculated trend line for 'goodness of fit' to see how accurate the results from other statistical functions are. ```nolang q = load "regression"; q = group q by all; q = foreach q generate trunc(regr_r2('Amount', 'NumActivities'),2) as 'R Squared'; ``` The value of R squared is 0.95. ![Diagram showing R squared result.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_r2.png) # regr_r2() Returns the R-squared, or goodness-of-fit value for a regression. `regr_r2()` follows this syntax. ```nolang SELECT regr_r2(FIELD1, FIELD2) FROM DATASET; ``` # regr_slope() Uses two numerical fields to calculate a trend line, then returns the slope. Use this function to learn more about the relationship between two numerical fields. ```nolang regr_slope(field_y, field_x) ``` _field_y_ is a grouped dependent numeric expression and _field_x_ is a grouped independent numeric expression. `regr_slope(field_y, field_x)` uses simple linear regression to calculate the trend line. The input fields (_field_y_, _field_x_) must contain at least two pairs of non-null values. This function works with simple grouped values but not with cogroups. ## Example - Calculate the Relationship Between Number of Activities and Deal Amount Suppose that you have a dataset that includes the number of activities (such as meetings) and the won opportunity amount. ![Sample scatter plot.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_regint.png) How much bigger will the deal size be for each extra activity? `regr_slope` performs a linear analysis on your data then calculates the slope (that is, the increased amount you win for each extra activity). ```nolang q = load "data/sales"; q = group q by all; --trunc() truncates the result to two decimal places q = foreach q generate trunc(regr_slope('Amount', 'NumActivities'),2) as 'Gain per Activity'; ``` Based on your existing data, every extra activity that you have tends to increase the deal size by \$1.45 million, on average. ![Diagram showing slope of a regression line.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_fn_agg_slope.png) **See Also** - [regr_intercept()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-ri.md) - [Calculate the Slope of the Regression Line](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-examples-stats.md) # regr_slope() Returns the slope of a regression line between two numerical fields. `regr_slope()` follows this syntax. ```nolang SELECT regr_slope(FIELD1, FIELD2) FROM DATASET; ``` # Release Notes Use the Salesforce Release Notes to learn about the most recent updates and changes to the Analytics External Data API. For a list of all current developer changes, including Analytics External Data API, see [CRM Analytics](https://help.salesforce.com/s/articleView?id=release-notes.rn_bi_analytics_cloud.htm) in the Salesforce Release Notes. **note:** If the Analytics Development section in the Salesforce Release Notes isn’t present, there aren’t any updates for that release. # Release Notes Use the Salesforce Release Notes to learn about the most recent updates and changes to Lightning Web Components in CRM Analytics Dashboards. For a list of all current developer changes, including Lightning Web Components in CRM Analytics Dashboards, see [CRM Analytics](https://help.salesforce.com/s/articleView?id=release-notes.rn_bi_analytics_cloud.htm) in the Salesforce Release Notes. **note:** If the Analytics Development section in the Salesforce Release Notes isn’t present, there aren’t any updates for that release. # Remove Redundant Projections To improve memory usage and performance costs, remove unnecessary projections from your queries and load only the data required. If you have to perform an operation, include pre-projection statements as needed. Here's an example of a query with an unnecessary projection. ```nolang q = load "Superstore"; q = foreach q generate 'Category'; q = group q by 'Category'; q = foreach q generate 'Category', count() as 'count'; ``` The first `foreach` statement projects the `Category` field, which is already included in the dataset. Since we're not performing any operation on the field, we can remove it. ```nolang q = load "Superstore"; q = group q by 'Category'; q = foreach q generate 'Category', count() as 'count'; ``` Here's an example with an implicit `cogroup`. ```nolang a = load "Customer_Data"; a = foreach a generate 'Customer_Name'; b = load "Superstore"; b = foreach b generate 'Customer_Name'; a = group a by 'Customer_Name' full, b by 'Customer_Name'; a = foreach a generate coalesce(a.'Customer_Name', b.'Customer_Name') as 'Customer_Name', count('a') as 'Superstore', count('b') as 'Customer_data'; ``` In this example, the `foreach` statements that follow loading the “Customer_Data” and the “Superstore” datasets are unnecessary, since they’re projecting the `Customer_Name` fields without any additional action. You can group the fields pre-projection. ```nolang a = load “Customer_Data”; b = load “Superstore”; a = group a by ‘Customer_Name’ full, b by 'Customer_Name'; a = foreach a generate coalesce(a.'Customer_Name', b.'Customer_Name') as 'Customer_Name', count('a') as 'Superstore', count('b') as 'Customer_data'; ``` # Replace Null Values with coalesce() When you use a left outer or full outer `cogroup` To blend data, unmatched data comes through as null. Use `coalesce()` To replace null values with the value of your choice. For information about how to use the `coalesce()` Function, see [coalesce](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-coalesce.md). ## Example: Left Outer Cogroup with coalesce() A left outer cogroup blends the right data stream with the left data stream. If a record on the left stream does not have a match on the right stream, The missing right value comes through as null. To replace null values with A different value, use `coalesce()`. For example, suppose that you have a dataset of meeting information from the Salesforce Event object, and you join it with data from the Salesforce Opportunity object. This shows amount won with the total time spent in meetings. ```nolang ops = load "Ops"; meetings = load "Meetings"; q = cogroup ops by 'Account' left, meetings by 'Company'; q = foreach q generate ops.'Account' as 'Account', sum(ops.'Amount') as 'sum_Amount', sum(meetings.'MeetingDuration') as 'TimeSpent'; ``` It looks like we had no meetings with Zen Retreats. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_coalesce_1.png) Let's use `coalesce()` to change that null value to a zero. ```nolang ops = load "Ops"; meetings = load "Meetings"; q = cogroup ops by 'Account' left, meetings by 'Company'; --use coalesce() to replace null values with zero q = foreach q generate ops.'Account' as 'Account', sum(ops.'Amount') as 'sum_Amount', coalesce(sum(meetings.'MeetingDuration'), 0) as 'TimeSpent'; ``` ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_coalesce_2.png) ## Example: Right Outer Cogroup with coalesce() A right outer cogroup blends the left data stream with the right data stream. When a record on the right stream has no matching record on the left stream, The left-side fields return null. To replace null values with a different value, Use `coalesce()`. In this example, accounts is the primary (right) dataset. Opportunities are Blended into accounts. All accounts are preserved. Accounts with no matching Opportunities return null for Sum of Amount. ```nolang q = load "opportunity"; q2 = load "account"; q = cogroup q by 'AccountId' right, q2 by 'AccountId'; q = foreach q generate q2.'AccountId' as 'AccountId', sum(q.'Amount') as 'Sum of Amount', sum(q2.'AnnualRevenue') as 'Sum of AnnualRevenue'; ``` It looks like 0010900000CdEfGCCX and 0010900000EfGhIEEV have no matching opportunities. ![Table showing account IDs with sum of amount and sum of annual revenue before coalesce.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_right_join_before_coalesce.png) Let's use `coalesce()` to change those null values to zero. ```nolang q = load "opportunity"; q2 = load "account"; q = cogroup q by 'AccountId' right, q2 by 'AccountId'; --use coalesce() to replace null values with zero q = foreach q generate q2.'AccountId' as 'AccountId', coalesce(sum(q.'Amount'), 0) as 'Sum of Amount', sum(q2.'AnnualRevenue') as 'Sum of AnnualRevenue'; ``` ![Table showing account IDs with sum of amount and sum of annual revenue after coalesce.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_right_join_after_coalesce.png) **note:** In a right outer cogroup, every row is guaranteed to have a value from the Right data stream. Use the right dataset's field directly for the group-by Column, `q2.'AccountId'` in this example, Without wrapping it in `coalesce()`. Only The left stream's aggregated values require `coalesce()` Because those are the fields that can be null. ## Troubleshooting Null Values in Blended Datasets _Null Values Display Instead of Zeros After a Blend_ Left and right blends use outer join semantics. When a row in one dataset has No matching row in the other, the unmatched fields return null, not zero. To replace null values with zero, use `coalesce()` In your SAQL query. _The Null Measure Handling Setting Doesn't Affect SAQL Results_ The Null Measure Handling setting controls how null values are displayed in Table and chart widgets. It doesn't modify the underlying SAQL query Results. If your query returns null, that null is passed to the widget Before the display setting is applied—so calculations that depend on those Values still treat them as null. To fix null values at the query level, use `coalesce()`. _Null Values in Calculations Return Null, Not Zero_ Null values propagate through arithmetic. For example: - `null + 5 = null` - `null / 2 = null` Wrap the affected field in `coalesce()` to Substitute zero before the calculation runs. ```nolang coalesce(sum(q.'Amount'), 0) / sum(q2.'AnnualRevenue') ``` **See Also** - [cogroup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-cogroup.md) # replace() Replaces a substring with the specified characters. ## Syntax `replace`(_string, searchStr, replaceStr_) ## Usage This function replaces _searchStr_ with _replaceStr_, then returns the modified string. If any of the parameters are `null`, then the function returns `null`. If _searchStr_ is an empty string, the function returns `null`. This function is case-sensitive. ## Example ```nolang replace("Watson, come quickly.", "quickly", "slowly") == "Watson, come slowly." replace("Watson, come quickly.", "o", "a") == "Watsan, came quickly." replace("Watson, come quickly.", "", "Mr.") == null ``` # replace({str}, {old_str}, {new_str}) Replaces all occurrences in string _str_ of a substring _old_str_ with a new substring _new_str_. Returns a new string. ## Example This example replaces instances of 'Al' with 'AL' in the City column. The query returns the first five entries. ```nolang SELECT replace(City, 'Al', 'AL') as "City" From "Superstore" GROUP BY City LIMIT 5; ``` | City | | ----------- | | Aberdeen | | Abilene | | Akron | | ALbuquerque | | ALexandria | # Report Saves changes to a report or deletes a report. ## Resource URL |Data|URL| |----|---| |Summary|`/services/data//analytics/reports/`| ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |PATCH|Saves changes to a report. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-save-report.md).| |DELETE|Deletes a report. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-delete-report.md).| ## PATCH Request Body |Property|Type|Description| |--------|----|-----------| |`aggregates`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field can be referenced in a row-level formula (true) or not (false).| |`buckets`|[Bucket field](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a bucket field.| |`chart`|[Chart[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Details about the chart used in a report.| |`crossFilters`|[Cross filter](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|Cross filters applied to the report.| |`customDetailFormula`|[Custom Detail Formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|An array of objects that describes row-level formulas.| |`customSummaryFormula`|[Custom summary formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a custom summary formulas.| |`currency`|String|Report currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is `null` if the organization does not have Multi-Currency enabled.| |`dashboardSetting`|Name/value pair|Allows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The `Name` and `Value` fields in `dashboardSetting` are used as Grouping and Aggregate in dashboard components.| |`detailColumns`|Array of strings|Unique API names for the fields that have detailed data.| |`developerName`|String|Report API name.| |`division`|String|Determines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.| |`folderId`|String|ID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.| |`groupingsAcross`|[Groupings across[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.| |`groupingsDown`|[Groupings down[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each row grouping in a report. The identity is `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for grouping.| |`hasDetailRows`|Boolean|Indicates whether to include detailed data with the summary data.| |`hasRecordCount`|Boolean|Indicates whether the report shows the record count.| |`historicalSnapshotDates`|Array of strings|List of historical snapshot dates.| |`id`|String|Unique report ID.| |`name`|String|Display name of the report.| |`presentationOptions`|[Report presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Display options in the Lightning Report Builder.| |`reportBooleanFilter`|String|Logic to parse custom field filters. Value is `null` when filter logic is not specified.| |`reportFilters`|[Filter details[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of each custom filter in the report along with the field name, filter operator, and filter value.| |`reportFormat`|String|Format of the report. Possible values are `TABULAR`, `SUMMARY`, `MATRIX`, or `MULTI_BLOCK`. The `MULTI_BLOCK` property is available in API version 43.0 and later.| |`reportType`|Report type|Unique API name and display name for the report type. `type` (string) is the unique identifier of the report type. `label` (string) is the display name of the report type.| |`scope`|String|Defines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`showGrandTotal`|Boolean|Indicates whether the report shows the grand total.| |`showSubtotals`|Boolean|Indicates whether the report shows subtotals, such as column or row totals.| |`sortBy`|Array of strings|API name of the field on which the report is sorted and the direction of the sort (asc or desc).| |`standardDateFilter`|Array of strings|Standard date filters available in reports. Each standard date filter contains the following properties: `column` (API name of the date field on which you filter the report data), `durationValue` (the range for which you want to run the report; the value is a date literal or 'CUSTOM.'), `startDate` (start date), and `endDate` (end date).| |`standardFilters`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsRoleHierarchy`|Boolean|Indicates whether the report type supports role hierarchy filtering (true) or not (false).| |`topRows`|[Top rows](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a row limit filter applied to the report.| |`userOrHierarchyFilterId`|String|Unique user or role ID of the user or role used by the report's role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!{_column_name_} represents a unique count of values for the specified {_column_name_}. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.” ```nolang { ... "reportBooleanFilter": "(1 OR 2) AND 3", "reportFilters": [ { "value": "Analyst,Integrator,Press,Other", "column": "TYPE", "operator": "notEqual" }, { "value": "100,000", "column": "SALES", "operator": "greaterThan" }, { "value": "Small", "column": "Size", "operator": "notEqual" } ] } } ``` Example sortBy: ```nolang "sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}] ``` ## PATCH Response Body |Property|Type|Description| |--------|----|-----------| |`reportMetadata`|[Report metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Unique identifiers for groupings and summaries.| |`reportTypeMetadata`|[Report type metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Fields in each section of a report type plus filter information for those fields.| |`reportExtendedMetadata`|[Report extended metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Additional information about summaries and groupings.| **Report metadata** |Property|Type|Description| |--------|----|-----------| |`aggregates`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field can be referenced in a row-level formula (true) or not (false).| |`buckets`|[Bucket field](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a bucket field.| |`chart`|[Chart[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Details about the chart used in a report.| |`crossFilters`|[Cross filter](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|Cross filters applied to the report.| |`customDetailFormula`|[Custom Detail Formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|An array of objects that describes row-level formulas.| |`customSummaryFormula`|[Custom summary formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a custom summary formulas.| |`currency`|String|Report currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is `null` if the organization does not have Multi-Currency enabled.| |`dashboardSetting`|Name/value pair|Allows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The `Name` and `Value` fields in `dashboardSetting` are used as Grouping and Aggregate in dashboard components.| |`detailColumns`|Array of strings|Unique API names for the fields that have detailed data.| |`developerName`|String|Report API name.| |`division`|String|Determines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.| |`folderId`|String|ID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.| |`groupingsAcross`|[Groupings across[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.| |`groupingsDown`|[Groupings down[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each row grouping in a report. The identity is `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for grouping.| |`hasDetailRows`|Boolean|Indicates whether to include detailed data with the summary data.| |`hasRecordCount`|Boolean|Indicates whether the report shows the record count.| |`historicalSnapshotDates`|Array of strings|List of historical snapshot dates.| |`id`|String|Unique report ID.| |`name`|String|Display name of the report.| |`presentationOptions`|[Report presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Display options in the Lightning Report Builder.| |`reportBooleanFilter`|String|Logic to parse custom field filters. Value is `null` when filter logic is not specified.| |`reportFilters`|[Filter details[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of each custom filter in the report along with the field name, filter operator, and filter value.| |`reportFormat`|String|Format of the report. Possible values are `TABULAR`, `SUMMARY`, `MATRIX`, or `MULTI_BLOCK`. The `MULTI_BLOCK` property is available in API version 43.0 and later.| |`reportType`|Report type|Unique API name and display name for the report type. `type` (string) is the unique identifier of the report type. `label` (string) is the display name of the report type.| |`scope`|String|Defines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`showGrandTotal`|Boolean|Indicates whether the report shows the grand total.| |`showSubtotals`|Boolean|Indicates whether the report shows subtotals, such as column or row totals.| |`sortBy`|Array of strings|API name of the field on which the report is sorted and the direction of the sort (asc or desc).| |`standardDateFilter`|Array of strings|Standard date filters available in reports. Each standard date filter contains the following properties: `column` (API name of the date field on which you filter the report data), `durationValue` (the range for which you want to run the report; the value is a date literal or 'CUSTOM.'), `startDate` (start date), and `endDate` (end date).| |`standardFilters`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsRoleHierarchy`|Boolean|Indicates whether the report type supports role hierarchy filtering (true) or not (false).| |`topRows`|[Top rows](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a row limit filter applied to the report.| |`userOrHierarchyFilterId`|String|Unique user or role ID of the user or role used by the report's role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!{_column_name_} represents a unique count of values for the specified {_column_name_}. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.” ```nolang { ... "reportBooleanFilter": "(1 OR 2) AND 3", "reportFilters": [ { "value": "Analyst,Integrator,Press,Other", "column": "TYPE", "operator": "notEqual" }, { "value": "100,000", "column": "SALES", "operator": "greaterThan" }, { "value": "Small", "column": "Size", "operator": "notEqual" } ] } } ``` Example sortBy: ```nolang "sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}] ``` **Chart** |Property|Type|Description| |--------|----|-----------| |`chartType`|String|Type of chart.| |`groupings`|String|Report grouping.| |`hasLegend`|Boolean|Indicates whether the report has a legend.| |`showChartValues`|Boolean|Indicates whether the report shows chart values.| |`summaries`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`summaryAxisLocations`|String|Specifies the axis that shows the summary values. Valid values are `X` and `Y`.| |`title`|String|Name of the chart.| Example summaries identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. **Groupings down** |Property|Type|Description| |--------|----|-----------| |`name`|String|API name of the field used as a row grouping.| |`sortOrder`|String|Order in which data is sorted within a row grouping. Value can be `asc` for ascending order or `desc` for descending order.| |`dateGranularity`|String|Interval set on a date field that’s used as a row grouping. Value can be Day, Calendar Week, Calendar Month, Calendar Quarter, Calendar Year, Fiscal Quarter, Fiscal Year, Calendar Month in Year, or Calendar Day in Month.| |`sortAggregate`|String|Summary field that’s used to sort data within a grouping in a report that’s in summary format. Applies if you have the Aggregate Sort feature enabled as part of its pilot program. The value is null when data within a grouping is not sorted by a summary field. In this example, data grouped by Account Owner is sorted by the sum of Annual Revenue.| Example sortAggregate: ```nolang { "aggregates": ["s!SALES","RowCount"], "groupingsDown": [ { "name": "USERS.NAME", "sortOrder": "Desc", "dateGranularity": "None", "sortAggregate": "s!SALES" } ] } ``` **Report presentation options** |Property|Type|Description| |--------|----|-----------| |`hasStackedSummaries`|Boolean|Indicates whether stacked summaries are enabled in the report.| |`historicalColumns`|[Historical column presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Presentation options of the historical column.| Example historicalColumns presentation options: ```nolang "presentationOptions" : { "historicalColumns" : { "Opportunity__hd.CloseDate__hst" : { "decreaseIsPositive" : false, "showChanges" : false }, "Opportunity__hd.Amount__hst" : { "decreaseIsPositive" : false, "showChanges" : true } } } ``` **Historical column presentation options** |Property|Type|Description| |--------|----|-----------| |`decreaseIsPositive`|Boolean|Indicates whether a negative change (decrease in value) is displayed in green instead of red in Lightning Report Builder.| |`showChanges`|Boolean|Indicates whether to display a change column for a given historical column.| **Groupings across** |Property|Type|Description| |--------|----|-----------| |`name`|String|API name of the field used as a column grouping.| |`sortOrder`|String|Order in which data is sorted within a column grouping. Value can be `asc` for ascending order or `desc` for descending order.| |`dateGranularity`|String|Interval set on a date field used as a column grouping. Value can be Day, Calendar Week, Calendar Month, Calendar Quarter, Calendar Year, Fiscal Quarter, Fiscal Year, Calendar Month in Year, or Calendar Day in Month.| **Filter details** |Property|Type|Description| |--------|----|-----------| |`column`|String|Unique API name for the field that’s being filtered.| |`filterType`|String|Describes the type of value used to filter report data. Valid values are `fieldToField` (filters report data by comparing values of one field with the values of a second field), `fieldValue` (filters report data by comparing values of a field with a defined value), or `null` (if null, the `filterType` defaults to `fieldValue`).| |`isRunPageEditable`|Boolean|Indicates if this is an editable filter in the user interface.| |`operator`|String|Unique API name for the condition used to filter a field such as “greater than” or “not equal to.” Filter conditions depend on the data type of the field. Valid values are `equals`, `notEqual`, `lessThan`, `greaterThan`, `lessOrEqual`, `greaterOrEqual`, `contains`, `notContain`, `startsWith`, `includes`, `excludes`, or `within` (`DISTANCE` criteria only).| |`value`|String|Value by which a field is filtered. For example, the field Age can be filtered by a numeric value. For datetime fields, if you make a POST request and specify a calendar date without including a time, then a default time gets included. The time defaults to midnight minus the difference between your timezone and Greenwich Mean Time (GMT). For example, if you specify 8/8/2015 and your timezone is Pacific Standard Time (GMT-700), then the API returns 2015-08-08T07:00:00Z.| Example filterType. In this example, the first filter is a field-to-field filter that compares the Amount field with Projected Amount field. The second filter is a field filter that returns records for which a row-level formula returns more than 0. ```nolang "reportFilters" : [ { "column" : "AMOUNT", "filterType" : "fieldToField", "isRunPageEditable" : true, "operator" : "notEqual", "value" : "PROJECTED_AMOUNT" }, { "column" : "CDF1", "filterType" : "fieldValue", "isRunPageEditable" : true, "operator" : "greaterThan", "value" : "0" } ] ``` **Bucket field** |Property|Type|Description| |--------|----|-----------| |`bucketType`|BucketType|The type of bucket. Possible values are `number`, `percent`, and `picklist`| |`developerName`|String|API name of the bucket.| |`label`|String|User-facing name of the bucket.| |`nullTreatedAsZero`|Boolean|Specifies whether null values are converted to zero (`true`) or not (`false`).| |`otherBucketLabel`|String|Name of the fields grouped as “Other” (in buckets of `BucketType` `PICKLIST`).| |`sourceColumnName`|String|Name of the bucketed field.| |`values`|Array of BucketTypeValues|Describes the values included in the bucket field..| **Bucket field value** |Property|Type|Description| |--------|----|-----------| |`label`|String|The user-facing name of the bucket.| |`sourceDimensionValues`|String|A list of the values from the source field included in this bucket category (in buckets of type `PICKLIST` and buckets of type `TEXT`).| |`rangeUpperBound`|Double|The greatest range limit under which values are included in this bucket category (in buckets of type `NUMBER`).| **Cross filter** |Property|Type|Description| |--------|----|-----------| |`criteria`|Array of [Filter details[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Information about how to filter the `relatedEntity`. Use to relate the primary entity with a subset of the `relatedEntity`.| |`includesObject`|Boolean|Specifies whether objects returned have a relationship with the `relatedEntity` (true) or not (`false`).| |`primaryEntityField`|String|The name of the object on which the cross filter is evaluated.| |relatedEntity|String|The name of the object that the `primaryEntityField` is evaluated against. (The right-hand side of the cross filter).| |relatedEntityJoinField|String|The name of the field used to join the `primaryEntityField` and `relatedEntity`.| **Custom Detail Formula** |Property|Type|Description| |--------|----|-----------| |`decimalPlaces`|Integer|Formats the value returned by the row-level formula. It is required for numeric return values, invalid for non-numeric return values.| |`description`|String|User-defined description of the row-level formula.| |`formula`|String|Specifies the formula expression to be evaluated. All report type fields, except bucketed fields and historical tracking fields can be referenced.| |`formulaType`|String|Specifies the return type of the formula. Valid values include date, datetime, number, or text.| |`label`|String|Specifies a name for the row-level formula.| **Custom summary formula** |Property|Type|Description| |--------|----|-----------| |`label`|String|The user-facing name of the custom summary formula.| |`description`|String|The user-facing description of the custom summary formula.| |`formulaType`|String|The format of the numbers in the custom summary formula. Possible values are `number`, `currency`, and `percent`.| |`decimalPlaces`|Integer|The number of decimal places to include in numbers.| |`downGroup`|String|The name of a row grouping when the `downGroupType` is `CUSTOM`. `Null` otherwise.| |`downGroupType`|String|Where to display the aggregate of the custom summary formula. Possible values are `all`, `custom`, and `grand_total`.| |`acrossGroup`|String|The name of a column grouping when the `accrossGroupType` is `CUSTOM`. `Null` otherwise.| |`acrossGroupType`|String|Where to display the aggregate of the custom summary formula. Possible values are `all`, `custom`, and `grand_total`.| |`formula`|String|The operations performed on values in the custom summary formula.| **Top rows** |Property|Type|Description| |--------|----|-----------| |`rowLimit`|Integer|The number of rows returned in the report.| |`direction`|String|The sort order of the report rows.| # Report Error Codes Errors can occur at the report level. Report-level error messages are returned in the response header When a report-level error occurs, the response header contains an HTTP response code and one of the following error messages: |HTTP Response Code|Error Message| |------------------|-------------| |400|The specified start date of `` specified for the standard date filter is invalid.| |400|The specified end date of `` specified for the standard date filter is invalid.| |400|The column `` specified for the standard date filter is invalid.| |400|The column `` cannot be a standard date filter because it is not a date column.| |400|The duration `` specified for the standard date filter is invalid.| |400|The report folder ID must be a valid folder ID.| |400|The report folder ID can't be null.| |400|The report name can't be null.| |400|Column sorting isn't supported for matrix reports.| |400|The sort column name must be from a selected column.| |400|The sort column name can't be null.| |400|A report can only be sorted by one column.| |400|A snapshot date is not in the correct format. Accepted formats are one of the rolling dates defined or yyyy-MM-dd.| |400|The request is invalid because reports that are not historical trending reports cannot have historical snapshot dates.| |400|The request is invalid because there are no historical snapshot dates in the request body. Specify historical snapshot dates, or set historical snapshot dates as an empty array to omit them.| |400|Only a report with fewer than 100 columns can be run. The columns are fields specified as detail columns, summaries, or custom summary formulas. Remove unneeded columns from the report and try again.| |400|Can’t run the report because it doesn’t have any columns selected. Be sure to add fields as columns to the report through the user interface.| |400|The request is invalid because there are no filters. Specify filters or set filters as an empty array to omit them.| |400|The filter value for ID `` is incorrect. Specify an ID that is 15 or 18 characters long, such as 006D000000CrRLw or 005U0000000Rg2CIAS.| |400|Specify a valid filterable column because `` is invalid.| |400|Specify a valid condition because \ is invalid.| |400|Filter the date in the correct format. Accepted formats are yyyy-MM-dd'T'HH:mm:ss'Z' and yyyy-MM-dd.| |400|The date formula is too large. Specify a reasonable value.| |400|The request is invalid because there is no metadata. Specify metadata in the request body.| |400|The clone request must contain a valid cloneId parameter.| |403|The report can't be deleted because there are one or more dashboards referencing it.| |403|You don't have permission to create reports in the given folder.| |403|You don’t have permission to edit reports in the given folder.| |403|The report definition is obsolete. Your administrator has disabled all reports for the custom object, or its relationships have changed.| |403|You don’t have permission to run reports. Check that you have the Run Reports user permission.| |403|You don’t have sufficient privileges to perform this operation.| |403|Reports and Dashboards REST API can't process the request because it can accept only as many as \ requests at a time to get results of reports run asynchronous​ly.| |403|Reports and Dashboards REST API can't process the request because it can accept only as many as \ requests at a time to run reports synchronousl​y.| |403|You can't run more than `` reports synchronously every 60 minutes. Try again later.| |404|Use a valid URL, for example, `/services/data/(apiversion)/analytics/reports/(reportID)/`describe, to retrieve report metadata.| |404|The data you’re trying to access is unavailable.| |410|The requested resource has been retired or removed. Delete or update any references to the resource.| |415|The Reports and Dashboards REST API only supports JSON content type in both request and response bodies. Specify requests with content type as `application/​json`.| |500|We ran into an error when fetching this report’s metadata. Try to re-submit your query.| |500|We ran into an error when running this report. Try to re-submit your query.| |500|The request body is either invalid or incomplete.| |500|Results for this instance are unavailable because the report's metadata has changed from when the report was last run. To get results, run the report again or undo changes to the report's metadata.| |500|The report failed to be deleted.| |500|The report failed to be created.| |500|The report failed to be saved.| |501|You’re requesting data for an unsupported report format.| |501|Historical trend data is unavailable in the report format requested. Change the report format to matrix and try again.| # Report Fields The Report Fields resource returns report fields available for specified reports. Use the resource to determine the best fields for use in dashboard filters by seeing which fields different source reports have in common. Available in API version 40.0 and later. ## Resource URL ```nolang /services/data//analytics/reports//fields ``` ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |POST|If the request body is empty, returns a list of all possible report fields. Otherwise, returns a list of fields that specified reports share.| ## POST Request Body |Property|Type|Description| |--------|----|-----------| |intersectWith|Array of Report IDs|An array of unique report IDs.| ## POST Response Body |Property|Type|Description| |--------|----|-----------| |displayGroups|Array of Fields|Fields available when adding a filter.| |equivalentFields|Array of Fields|Fields available for each specified report. Each object in this array is a list of common fields categorized by report type.| |equivalentFieldIndices|Map of Fields|Map of each field’s API name to the index of the field in the `equivalentFields` array.| |mergedGroups|Array of Fields|Merged fields.| ## Example Request Body ```nolang { "intersectWith": ["00OR0000000P3RVMA0"] } ``` ## Example Response Body ```nolang { "displayGroups" : { "Opportunity" : [ { "columns" : { "ACCOUNT_CREATED_DATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Account: Created Date", "maxLength" : null }, "ACCOUNT_LAST_ACTIVITY" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Account: Last Activity", "maxLength" : null }, "ACCOUNT_LAST_UPDATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Account: Last Modified Date", "maxLength" : null }, "ACCOUNT_OWNER" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Account Owner", "maxLength" : null }, "ACCOUNT_OWNER_ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : true, "label" : "Account Owner Alias", "maxLength" : 8 } }, "label" : "Account: General", "labelSuffix" : "(Opportunities)" }, { "columns" : { "CLOSE_DATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Close Date", "maxLength" : null }, "CLOSE_DATE2" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Close Date (2)", "maxLength" : null }, "CLOSE_MONTH" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Close Month", "maxLength" : null }, "CREATED_ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : true, "label" : "Created Alias", "maxLength" : 8 }, "CREATED" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Created By", "maxLength" : null }, "CREATED_DATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Created Date", "maxLength" : null }, "LAST_ACTIVITY" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Last Activity", "maxLength" : null }, "LAST_UPDATE_BY_ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : true, "label" : "Last Modified Alias", "maxLength" : 8 }, "LAST_UPDATE_BY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Last Modified By", "maxLength" : null }, "LAST_UPDATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Last Modified Date", "maxLength" : null }, "LAST_STAGE_CHANGE_DATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Last Stage Change Date", "maxLength" : null } }, "label" : "Opportunity Information", "labelSuffix" : "(Opportunities)" }, { "columns" : { "FULL_NAME" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Opportunity Owner", "maxLength" : null }, "OWNER_MANAGER" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Opportunity Owner: Manager", "maxLength" : null }, "ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : true, "label" : "Opportunity Owner Alias", "maxLength" : 8 }, "ROLLUP_DESCRIPTION" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : true, "label" : "Owner Role", "maxLength" : 80 } }, "label" : "Opportunity Owner Information", "labelSuffix" : "(Opportunities)" } ], "LeadList" : [ { "columns" : { "EMAIL_BOUNCED_DATE" : { "dataType" : "datetime", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Email Bounced Date", "maxLength" : null } }, "label" : "Lead: Ph/Fax/Email", "labelSuffix" : "(Leads)" }, { "columns" : { "CREATED_ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : true, "label" : "Created Alias", "maxLength" : 8 }, "CREATED_DATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Create Date", "maxLength" : null }, "CREATED" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Created By", "maxLength" : null }, "CREATED_MONTH" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Created Month", "maxLength" : null }, "LAST_ACTIVITY" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Last Activity", "maxLength" : null }, "LAST_UPDATE" : { "dataType" : "date", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Last Modified", "maxLength" : null }, "LAST_UPDATE_BY_ALIAS" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : true, "label" : "Last Modified Alias", "maxLength" : 8 }, "LAST_UPDATE_BY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : false, "label" : "Last Modified By", "maxLength" : null }, "OWNER_ROLE_DISPLAY" : { "dataType" : "string", "filterValues" : [ ], "filterable" : true, "isLookup" : true, "label" : "Owner Role Display", "maxLength" : 80 } }, "label" : "Lead General", "labelSuffix" : "(Leads)" } ] }, "equivalentFieldIndices" : { "ACCOUNT_CREATED_DATE" : 19, "ACCOUNT_LAST_UPDATE" : 19, "ACCOUNT_OWNER" : 15, "CREATED_ALIAS" : 16, "CREATED_DATE" : 19, "LAST_UPDATE_BY_ALIAS" : 16, "ALIAS" : 16, "EMAIL_BOUNCED_DATE" : 19, "CLOSE_MONTH" : 17, "LAST_UPDATE_BY" : 15, "CREATED_MONTH" : 17, "LAST_ACTIVITY" : 17, "ACCOUNT_LAST_ACTIVITY" : 17, "CLOSE_DATE" : 17, "CREATED" : 15, "LAST_UPDATE" : 19, "CLOSE_DATE2" : 17, "OWNER_MANAGER" : 15, "LAST_STAGE_CHANGE_DATE" : 19, "ROLLUP_DESCRIPTION" : 7, "FULL_NAME" : 15, "ACCOUNT_OWNER_ALIAS" : 16, "OWNER_ROLE_DISPLAY" : 7 }, "equivalentFields" : [ { "LeadList" : [ { "name" : "CREATED" }, { "name" : "LAST_UPDATE_BY" } ], "Opportunity" : [ { "name" : "CREATED" }, { "name" : "LAST_UPDATE_BY" }, { "name" : "FULL_NAME" }, { "name" : "OWNER_MANAGER" }, { "name" : "ACCOUNT_OWNER" } ] }, { "LeadList" : [ { "name" : "CREATED_ALIAS" }, { "name" : "LAST_UPDATE_BY_ALIAS" } ], "Opportunity" : [ { "name" : "CREATED_ALIAS" }, { "name" : "LAST_UPDATE_BY_ALIAS" }, { "name" : "ALIAS" }, { "name" : "ACCOUNT_OWNER_ALIAS" } ] }, { "LeadList" : [ { "name" : "LAST_UPDATE_BY" }, { "name" : "CREATED" } ], "Opportunity" : [ { "name" : "LAST_UPDATE_BY" }, { "name" : "CREATED" }, { "name" : "FULL_NAME" }, { "name" : "OWNER_MANAGER" }, { "name" : "ACCOUNT_OWNER" } ] }, { "LeadList" : [ { "name" : "LAST_UPDATE_BY_ALIAS" }, { "name" : "CREATED_ALIAS" } ], "Opportunity" : [ { "name" : "LAST_UPDATE_BY_ALIAS" }, { "name" : "CREATED_ALIAS" }, { "name" : "ALIAS" }, { "name" : "ACCOUNT_OWNER_ALIAS" } ] }, { "LeadList" : [ { "name" : "CREATED_DATE" }, { "name" : "LAST_UPDATE" }, { "name" : "EMAIL_BOUNCED_DATE" } ], "Opportunity" : [ { "name" : "CREATED_DATE" }, { "name" : "LAST_STAGE_CHANGE_DATE" }, { "name" : "LAST_UPDATE" }, { "name" : "ACCOUNT_CREATED_DATE" }, { "name" : "ACCOUNT_LAST_UPDATE" } ] }, { "LeadList" : [ { "name" : "CREATED_MONTH" }, { "name" : "LAST_ACTIVITY" } ], "Opportunity" : [ { "name" : "CLOSE_DATE" }, { "name" : "CLOSE_DATE2" }, { "name" : "CLOSE_MONTH" }, { "name" : "LAST_ACTIVITY" }, { "name" : "ACCOUNT_LAST_ACTIVITY" } ] }, { "LeadList" : [ { "name" : "LAST_UPDATE" }, { "name" : "CREATED_DATE" }, { "name" : "EMAIL_BOUNCED_DATE" } ], "Opportunity" : [ { "name" : "LAST_UPDATE" }, { "name" : "LAST_STAGE_CHANGE_DATE" }, { "name" : "CREATED_DATE" }, { "name" : "ACCOUNT_CREATED_DATE" }, { "name" : "ACCOUNT_LAST_UPDATE" } ] }, { "LeadList" : [ { "name" : "OWNER_ROLE_DISPLAY" } ], "Opportunity" : [ { "name" : "ROLLUP_DESCRIPTION" } ] }, { "LeadList" : [ { "name" : "LAST_ACTIVITY" }, { "name" : "CREATED_MONTH" } ], "Opportunity" : [ { "name" : "LAST_ACTIVITY" }, { "name" : "CLOSE_DATE" }, { "name" : "CLOSE_DATE2" }, { "name" : "CLOSE_MONTH" }, { "name" : "ACCOUNT_LAST_ACTIVITY" } ] }, { "LeadList" : [ { "name" : "EMAIL_BOUNCED_DATE" }, { "name" : "CREATED_DATE" }, { "name" : "LAST_UPDATE" } ], "Opportunity" : [ { "name" : "LAST_STAGE_CHANGE_DATE" }, { "name" : "CREATED_DATE" }, { "name" : "LAST_UPDATE" }, { "name" : "ACCOUNT_CREATED_DATE" }, { "name" : "ACCOUNT_LAST_UPDATE" } ] }, { "LeadList" : [ { "name" : "LAST_ACTIVITY" }, { "name" : "CREATED_MONTH" } ], "Opportunity" : [ { "name" : "CLOSE_DATE2" }, { "name" : "CLOSE_DATE" }, { "name" : "CLOSE_MONTH" }, { "name" : "LAST_ACTIVITY" }, { "name" : "ACCOUNT_LAST_ACTIVITY" } ] }, { "LeadList" : [ { "name" : "LAST_ACTIVITY" }, { "name" : "CREATED_MONTH" } ], "Opportunity" : [ { "name" : "CLOSE_MONTH" }, { "name" : "CLOSE_DATE" }, { "name" : "CLOSE_DATE2" }, { "name" : "LAST_ACTIVITY" }, { "name" : "ACCOUNT_LAST_ACTIVITY" } ] }, { "LeadList" : [ { "name" : "CREATED" }, { "name" : "LAST_UPDATE_BY" } ], "Opportunity" : [ { "name" : "FULL_NAME" }, { "name" : "CREATED" }, { "name" : "LAST_UPDATE_BY" }, { "name" : "OWNER_MANAGER" }, { "name" : "ACCOUNT_OWNER" } ] }, { "LeadList" : [ { "name" : "CREATED_ALIAS" }, { "name" : "LAST_UPDATE_BY_ALIAS" } ], "Opportunity" : [ { "name" : "ALIAS" }, { "name" : "CREATED_ALIAS" }, { "name" : "LAST_UPDATE_BY_ALIAS" }, { "name" : "ACCOUNT_OWNER_ALIAS" } ] }, { "LeadList" : [ { "name" : "CREATED" }, { "name" : "LAST_UPDATE_BY" } ], "Opportunity" : [ { "name" : "OWNER_MANAGER" }, { "name" : "CREATED" }, { "name" : "LAST_UPDATE_BY" }, { "name" : "FULL_NAME" }, { "name" : "ACCOUNT_OWNER" } ] }, { "LeadList" : [ { "name" : "CREATED" }, { "name" : "LAST_UPDATE_BY" } ], "Opportunity" : [ { "name" : "ACCOUNT_OWNER" }, { "name" : "CREATED" }, { "name" : "LAST_UPDATE_BY" }, { "name" : "FULL_NAME" }, { "name" : "OWNER_MANAGER" } ] }, { "LeadList" : [ { "name" : "CREATED_ALIAS" }, { "name" : "LAST_UPDATE_BY_ALIAS" } ], "Opportunity" : [ { "name" : "ACCOUNT_OWNER_ALIAS" }, { "name" : "CREATED_ALIAS" }, { "name" : "LAST_UPDATE_BY_ALIAS" }, { "name" : "ALIAS" } ] }, { "LeadList" : [ { "name" : "LAST_ACTIVITY" }, { "name" : "CREATED_MONTH" } ], "Opportunity" : [ { "name" : "ACCOUNT_LAST_ACTIVITY" }, { "name" : "CLOSE_DATE" }, { "name" : "CLOSE_DATE2" }, { "name" : "CLOSE_MONTH" }, { "name" : "LAST_ACTIVITY" } ] }, { "LeadList" : [ { "name" : "CREATED_DATE" }, { "name" : "LAST_UPDATE" }, { "name" : "EMAIL_BOUNCED_DATE" } ], "Opportunity" : [ { "name" : "ACCOUNT_CREATED_DATE" }, { "name" : "LAST_STAGE_CHANGE_DATE" }, { "name" : "CREATED_DATE" }, { "name" : "LAST_UPDATE" }, { "name" : "ACCOUNT_LAST_UPDATE" } ] }, { "LeadList" : [ { "name" : "CREATED_DATE" }, { "name" : "LAST_UPDATE" }, { "name" : "EMAIL_BOUNCED_DATE" } ], "Opportunity" : [ { "name" : "ACCOUNT_LAST_UPDATE" }, { "name" : "LAST_STAGE_CHANGE_DATE" }, { "name" : "CREATED_DATE" }, { "name" : "LAST_UPDATE" }, { "name" : "ACCOUNT_CREATED_DATE" } ] } ], "mergedGroups" : { } } ``` # Report List Displays a list of up to 200 tabular, matrix, or summary reports that you recently viewed. To get a full list of reports by format, name, and other fields, use a SOQL query on the Report object. The resource can also be used to make a copy of a report. ## Resource URL |Task|URL| |----|---| |List reports|Reports collection URI.| |Copy report|Clone report URI.| Reports collection URI: ```nolang /services/data//analytics/reports ``` Clone report URI: ```nolang /services/data//analytics/reports?cloneId= ``` ## Formats JSON ## HTTP Methods |Method|Description| |------|-----------| |GET|List of reports that were recently viewed by the API user. See this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-list-recentreports.md).| |POST|Create or clone a report. To create a new report, see this [example](https://developer.salesforce.com/docs/analytics/examples/reports/analytics-api-report-example-post-report.md). To clone an existing report, see this [example](https://developer.salesforce.com/docs/analytics/examples/reports/sforce-analytics-rest-api-clone-report.md).| ## GET Response Body |Property|Type|Description| |--------|----|-----------| |`name`|String|Report display name.| |`id`|String|Unique report ID.| |`url`|String|URL that returns report data.| |`describeUrl`|String|URL that retrieves report metadata.| |`instancesUrl`|String|Information for each instance of the report that was run asynchronously.| ## POST Response Body |Property|Type|Description| |--------|----|-----------| |`aggregates`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field can be referenced in a row-level formula (true) or not (false).| |`buckets`|[Bucket field](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a bucket field.| |`chart`|[Chart[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Details about the chart used in a report.| |`crossFilters`|[Cross filter](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|Cross filters applied to the report.| |`customDetailFormula`|[Custom Detail Formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|An array of objects that describes row-level formulas.| |`customSummaryFormula`|[Custom summary formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a custom summary formulas.| |`currency`|String|Report currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is `null` if the organization does not have Multi-Currency enabled.| |`dashboardSetting`|Name/value pair|Allows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The `Name` and `Value` fields in `dashboardSetting` are used as Grouping and Aggregate in dashboard components.| |`detailColumns`|Array of strings|Unique API names for the fields that have detailed data.| |`developerName`|String|Report API name.| |`division`|String|Determines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.| |`folderId`|String|ID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.| |`groupingsAcross`|[Groupings across[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.| |`groupingsDown`|[Groupings down[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each row grouping in a report. The identity is `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for grouping.| |`hasDetailRows`|Boolean|Indicates whether to include detailed data with the summary data.| |`hasRecordCount`|Boolean|Indicates whether the report shows the record count.| |`historicalSnapshotDates`|Array of strings|List of historical snapshot dates.| |`id`|String|Unique report ID.| |`name`|String|Display name of the report.| |`presentationOptions`|[Report presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Display options in the Lightning Report Builder.| |`reportBooleanFilter`|String|Logic to parse custom field filters. Value is `null` when filter logic is not specified.| |`reportFilters`|[Filter details[]](sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of each custom filter in the report along with the field name, filter operator, and filter value.| |`reportFormat`|String|Format of the report. Possible values are `TABULAR`, `SUMMARY`, `MATRIX`, or `MULTI_BLOCK`. The `MULTI_BLOCK` property is available in API version 43.0 and later.| |`reportType`|Report type|Unique API name and display name for the report type. `type` (string) is the unique identifier of the report type. `label` (string) is the display name of the report type.| |`scope`|String|Defines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`showGrandTotal`|Boolean|Indicates whether the report shows the grand total.| |`showSubtotals`|Boolean|Indicates whether the report shows subtotals, such as column or row totals.| |`sortBy`|Array of strings|API name of the field on which the report is sorted and the direction of the sort (asc or desc).| |`standardDateFilter`|Array of strings|Standard date filters available in reports. Each standard date filter contains the following properties: `column` (API name of the date field on which you filter the report data), `durationValue` (the range for which you want to run the report; the value is a date literal or 'CUSTOM.'), `startDate` (start date), and `endDate` (end date).| |`standardFilters`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsRoleHierarchy`|Boolean|Indicates whether the report type supports role hierarchy filtering (true) or not (false).| |`topRows`|[Top rows](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a row limit filter applied to the report.| |`userOrHierarchyFilterId`|String|Unique user or role ID of the user or role used by the report's role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!{_column_name_} represents a unique count of values for the specified {_column_name_}. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.” ```nolang { ... "reportBooleanFilter": "(1 OR 2) AND 3", "reportFilters": [ { "value": "Analyst,Integrator,Press,Other", "column": "TYPE", "operator": "notEqual" }, { "value": "100,000", "column": "SALES", "operator": "greaterThan" }, { "value": "Small", "column": "Size", "operator": "notEqual" } ] } } ``` Example sortBy: ```nolang "sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}] ``` # Report Type Return metadata about a report type. ## Syntax **URI:** `/services/data/vXX.X/analytics/reportTypes/type` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Return metadata about a report type| ## GET Request Body A notification object with desired changes. |Property|Type|Description| |--------|----|-----------| |`reportMetadata`|[Report metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Unique identifiers for groupings and summaries.| |`reportTypeMetadata`|[Report type metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Fields in each section of a report type plus filter information for those fields.| |`reportExtendedMetadata`|[Report extended metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Additional information about summaries and groupings.| **Report extended metadata** |Property|Type|Description| |--------|----|-----------| |`aggregateColumnInfo`|[Aggregate column information](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Includes all report summaries such as, Record Count, Sum, Average, Max, Min, and custom summary formulas. Contains values for each summary listed in the report metadata [aggregates](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md).| |`detailColumnInfo`|[Detail column information](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Two properties for each field that has detailed data identified by its unique API name. The detailed data fields are also listed in the report metadata.| |`groupingColumnInfo`|[Grouping column information](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Map of each row or column grouping to its metadata. Contains values for each grouping identified in the [groupingsDown](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md) and [groupingsAcross](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md) list.| |`historicalColumnInfo`|[Historical column information](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Provides additional information on columns that exist only in historical trending reports. (This property is applicable only to historical trending reports.)| **Aggregate column information** |Property|Type|Description| |--------|----|-----------| |`label`|String|Display name for record count, or the summarized or custom summary formula field.| |`dataType`|String|Data type of the summarized or custom summary formula field.| |`acrossGroupingContext`|String|Column grouping in the report where the custom summary formula is displayed. As this example shows in the JSON response and in the custom summary formula editor of the matrix report, the custom summary formula is set at the grand summary level for the columns.| |`downGroupingContext`|String|Row grouping in the report where the custom summary formula is displayed. In this example, the custom summary formula for a summary report is displayed at the first grouping level. This example is shown in both the JSON response and in the custom summary formula editor of the summary report.| Example acrossGroupingContext for a matrix report: ```nolang { "reportExtendedMetadata" : { "aggregateColumnInfo" : { "FORMULA1" : { "label" : "Stalled Oppty Avg", "dataType" : "Percent", "acrossGroupingContext" : "GRAND_SUMMARY", "downGroupingContext" : "GRAND_SUMMARY" }, } } } ``` ![Grouping level where the custom summary formula is displayed for a matrix report](https://developer.salesforce.com/media/salesforce_analytics_rest_api/analyticsapi_matrixrep_csfdisplay.png) Example downGroupingContext for a summary report: ```nolang { "reportExtendedMetadata" : { "aggregateColumnInfo" : { ...}, "FORMULA1" : { "label" : "Average Won", "dataType" : "Number", "acrossGroupingContext" : null, "downGroupingContext" : "TYPE" }, } } } ``` ![Grouping level where the custom summary formula is displayed in a summary report](https://developer.salesforce.com/media/salesforce_analytics_rest_api/analyticsapi_summaryrep_csfdisplay.png) **Detail column information** |Property|Type|Description| |--------|----|-----------| |`label`|String|The localized display name of a standard field, the ID of a custom field, or the API name of a bucket field that has detailed data.| |`dataType`|String|The data type of the field that has detailed data. Possible values are: `string`, `boolean`, `combobox`, `currency`, `date`, `datetime`, `double`, `email`, `html`, `id`, `int`, `multipicklist`, `number`, `percent`, `phone`, `picklist`, `reference`, `text`, `textarea`, `time`, or `url`.| |`entityColumnName`|String|Describes the relationship between an sObject and a report field by returning the sObject and sObject field name that a report field maps to. The value returned is formatted as `sObject.sObject field`. The property is part of an object that describes a report field, such as an object in the `columns[]` array of a report type object from `reportTypeMetadata`. For example, on the `LAST_UPDATE_BY` column, the value of `entityColumnName` is `“User.Name”`, which tells us that it’s mapped to the `Name` field on the `User` sObject. For a standard report column that uses a lookup field, `entityColumnName` returns the related object and field. For example, the `LAST_UPDATE_BY` column returns `"User.Name"`. For a custom lookup field, `entityColumnName` can return the object that contains the field and the field's API name instead of the related object's field. For example, a custom lookup-to-`User` field on a custom object can return `"MyCustomObject.MyCustomField"`. Row-level formulas aren’t directly mapped to sObject fields like report fields, but they still have an `entityColumnName` property. For row-level formulas, the value of `entityColumnName` is `CDF1`.| |`filterValues`|String array|All filter values for a field, if the field data type is of picklist, multi-select picklist, boolean, or checkbox. For example, checkbox fields always have a value of `True` or `False`. For fields of other data types, the filter value is an empty array because their values can’t be determined. Filter values have two properties: `name` (unique API name for a filter value, of type string) and `label` (display name of a filter value, of type string).| |`filterable`|Boolean|`False` means that the field is of a type that can’t be filtered. For example, fields of the type Encrypted Text can’t be filtered.| |`isLookup`|Boolean|Specifies whether a field is a lookup (`true`) or not (`false`).| |`label`|String|Display name of a field.| |`uniqueCountable`|Boolean|Specifies whether a field supports unique count (`true`) or not (`false)`| Example entityColumnName: ```nolang "reportTypeMetadata" : { "categories" : [ { "columns" : { "LAST_UPDATE_BY" : { "allowedInCustomDetailFormula" : true, "bucketable" : true, "dataType" : "string", "entityColumnName" : "User.Name", "fieldToFieldFilterable" : false, "filterValues" : [ ], "filterable" : true, "inactiveFilterValues" : [ ], "isCustom" : false, "isLookup" : true, "label" : "Last Modified By", "maxLength" : null, "uniqueCountable" : true } } } ] } ``` **Grouping column information** |Property|Type|Description| |--------|----|-----------| |`label`|String|Display name of the field or bucket field used for grouping.| |`dataType`|String|Data type of the field used for grouping. Possible values are: `string`, `boolean`, `combobox`, `currency`, `date`, `datetime`, `double`, `email`, `html`, `id`, `int`, `multipicklist`, `number`, `percent`, `phone`, `picklist`, `reference`, `text`, `textarea`, `time`, or `url`.| |`groupingLevel`|Integer|Level of the grouping. Value can be `0`, `1`, or `2` (first, second, or third row level grouping in summary reports), or `0` or `1` (first or second row or column level grouping in a matrix report).| **Historical column information** |Property|Type|Description| |--------|----|-----------| |`baseField`|String|Indicates the base column for the historical data. Example: For the historical column `Opportunity__hd.Amount__hst.N_DAYS_AGO:1`, which represents the historical `Amount` column from one day ago in an Opportunity report, the base column is `Opportunity.Amount`.| |`historicalColumn`|String|The specific historical column name. Example: The historical column for `Opportunity__hd.Amount__hst.N_DAYS_AGO:1` is `Opportunity__hd.Amount__hst`.| |`historicalSnapshotDate`|String|The snapshot date for this historical column. Example: For the historical column `Opportunity__hd.Amount__hst.N_DAYS_AGO:1`, the snapshot date is `N_DAYS_AGO:1, which is one day ago`.| |isHistoricalChange|Boolean|`True` if the column represents change between two historical columns.| **Report metadata** |Property|Type|Description| |--------|----|-----------| |`aggregates`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field can be referenced in a row-level formula (true) or not (false).| |`buckets`|[Bucket field](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a bucket field.| |`chart`|[Chart[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Details about the chart used in a report.| |`crossFilters`|[Cross filter](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|Cross filters applied to the report.| |`customDetailFormula`|[Custom Detail Formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)[]|An array of objects that describes row-level formulas.| |`customSummaryFormula`|[Custom summary formula](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a custom summary formulas.| |`currency`|String|Report currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is `null` if the organization does not have Multi-Currency enabled.| |`dashboardSetting`|Name/value pair|Allows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The `Name` and `Value` fields in `dashboardSetting` are used as Grouping and Aggregate in dashboard components.| |`detailColumns`|Array of strings|Unique API names for the fields that have detailed data.| |`developerName`|String|Report API name.| |`division`|String|Determines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.| |`folderId`|String|ID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.| |`groupingsAcross`|[Groupings across[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.| |`groupingsDown`|[Groupings down[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Unique identities for each row grouping in a report. The identity is `BucketField_(ID)` for bucket fields, or the ID of a custom field when the custom field is used for grouping.| |`hasDetailRows`|Boolean|Indicates whether to include detailed data with the summary data.| |`hasRecordCount`|Boolean|Indicates whether the report shows the record count.| |`historicalSnapshotDates`|Array of strings|List of historical snapshot dates.| |`id`|String|Unique report ID.| |`name`|String|Display name of the report.| |`presentationOptions`|[Report presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Display options in the Lightning Report Builder.| |`reportBooleanFilter`|String|Logic to parse custom field filters. Value is `null` when filter logic is not specified.| |`reportFilters`|[Filter details[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of each custom filter in the report along with the field name, filter operator, and filter value.| |`reportFormat`|String|Format of the report. Possible values are `TABULAR`, `SUMMARY`, `MATRIX`, or `MULTI_BLOCK`. The `MULTI_BLOCK` property is available in API version 43.0 and later.| |`reportType`|Report type|Unique API name and display name for the report type. `type` (string) is the unique identifier of the report type. `label` (string) is the display name of the report type.| |`scope`|String|Defines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`showGrandTotal`|Boolean|Indicates whether the report shows the grand total.| |`showSubtotals`|Boolean|Indicates whether the report shows subtotals, such as column or row totals.| |`sortBy`|Array of strings|API name of the field on which the report is sorted and the direction of the sort (asc or desc).| |`standardDateFilter`|Array of strings|Standard date filters available in reports. Each standard date filter contains the following properties: `column` (API name of the date field on which you filter the report data), `durationValue` (the range for which you want to run the report; the value is a date literal or 'CUSTOM.'), `startDate` (start date), and `endDate` (end date).| |`standardFilters`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsRoleHierarchy`|Boolean|Indicates whether the report type supports role hierarchy filtering (true) or not (false).| |`topRows`|[Top rows](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Describes a row limit filter applied to the report.| |`userOrHierarchyFilterId`|String|Unique user or role ID of the user or role used by the report's role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.| Example aggregates identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. - u!{_column_name_} represents a unique count of values for the specified {_column_name_}. For example, `u!_AccountName_` returns the number of unique account name values in the `AccountName` field. Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.” ```nolang { ... "reportBooleanFilter": "(1 OR 2) AND 3", "reportFilters": [ { "value": "Analyst,Integrator,Press,Other", "column": "TYPE", "operator": "notEqual" }, { "value": "100,000", "column": "SALES", "operator": "greaterThan" }, { "value": "Small", "column": "Size", "operator": "notEqual" } ] } } ``` Example sortBy: ```nolang "sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}] ``` **Chart** |Property|Type|Description| |--------|----|-----------| |`chartType`|String|Type of chart.| |`groupings`|String|Report grouping.| |`hasLegend`|Boolean|Indicates whether the report has a legend.| |`showChartValues`|Boolean|Indicates whether the report shows chart values.| |`summaries`|Array of strings|Unique identities for summary or custom summary formula fields in the report.| |`summaryAxisLocations`|String|Specifies the axis that shows the summary values. Valid values are `X` and `Y`.| |`title`|String|Name of the chart.| Example summaries identities: - a!Amount represents the average for the Amount column. - s!Amount represents the sum of the Amount column. - m!Amount represents the minimum value of the Amount column. - x!Amount represents the maximum value of the Amount column. - s!_\_ represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID. **Groupings down** |Property|Type|Description| |--------|----|-----------| |`name`|String|API name of the field used as a row grouping.| |`sortOrder`|String|Order in which data is sorted within a row grouping. Value can be `asc` for ascending order or `desc` for descending order.| |`dateGranularity`|String|Interval set on a date field that’s used as a row grouping. Value can be Day, Calendar Week, Calendar Month, Calendar Quarter, Calendar Year, Fiscal Quarter, Fiscal Year, Calendar Month in Year, or Calendar Day in Month.| |`sortAggregate`|String|Summary field that’s used to sort data within a grouping in a report that’s in summary format. Applies if you have the Aggregate Sort feature enabled as part of its pilot program. The value is null when data within a grouping is not sorted by a summary field. In this example, data grouped by Account Owner is sorted by the sum of Annual Revenue.| Example sortAggregate: ```nolang { "aggregates": ["s!SALES","RowCount"], "groupingsDown": [ { "name": "USERS.NAME", "sortOrder": "Desc", "dateGranularity": "None", "sortAggregate": "s!SALES" } ] } ``` **Report presentation options** |Property|Type|Description| |--------|----|-----------| |`hasStackedSummaries`|Boolean|Indicates whether stacked summaries are enabled in the report.| |`historicalColumns`|[Historical column presentation options](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Presentation options of the historical column.| Example historicalColumns presentation options: ```nolang "presentationOptions" : { "historicalColumns" : { "Opportunity__hd.CloseDate__hst" : { "decreaseIsPositive" : false, "showChanges" : false }, "Opportunity__hd.Amount__hst" : { "decreaseIsPositive" : false, "showChanges" : true } } } ``` **Historical column presentation options** |Property|Type|Description| |--------|----|-----------| |`decreaseIsPositive`|Boolean|Indicates whether a negative change (decrease in value) is displayed in green instead of red in Lightning Report Builder.| |`showChanges`|Boolean|Indicates whether to display a change column for a given historical column.| **Groupings across** |Property|Type|Description| |--------|----|-----------| |`name`|String|API name of the field used as a column grouping.| |`sortOrder`|String|Order in which data is sorted within a column grouping. Value can be `asc` for ascending order or `desc` for descending order.| |`dateGranularity`|String|Interval set on a date field used as a column grouping. Value can be Day, Calendar Week, Calendar Month, Calendar Quarter, Calendar Year, Fiscal Quarter, Fiscal Year, Calendar Month in Year, or Calendar Day in Month.| **Filter details** |Property|Type|Description| |--------|----|-----------| |`column`|String|Unique API name for the field that’s being filtered.| |`filterType`|String|Describes the type of value used to filter report data. Valid values are `fieldToField` (filters report data by comparing values of one field with the values of a second field), `fieldValue` (filters report data by comparing values of a field with a defined value), or `null` (if null, the `filterType` defaults to `fieldValue`).| |`isRunPageEditable`|Boolean|Indicates if this is an editable filter in the user interface.| |`operator`|String|Unique API name for the condition used to filter a field such as “greater than” or “not equal to.” Filter conditions depend on the data type of the field. Valid values are `equals`, `notEqual`, `lessThan`, `greaterThan`, `lessOrEqual`, `greaterOrEqual`, `contains`, `notContain`, `startsWith`, `includes`, `excludes`, or `within` (`DISTANCE` criteria only).| |`value`|String|Value by which a field is filtered. For example, the field Age can be filtered by a numeric value. For datetime fields, if you make a POST request and specify a calendar date without including a time, then a default time gets included. The time defaults to midnight minus the difference between your timezone and Greenwich Mean Time (GMT). For example, if you specify 8/8/2015 and your timezone is Pacific Standard Time (GMT-700), then the API returns 2015-08-08T07:00:00Z.| Example filterType. In this example, the first filter is a field-to-field filter that compares the Amount field with Projected Amount field. The second filter is a field filter that returns records for which a row-level formula returns more than 0. ```nolang "reportFilters" : [ { "column" : "AMOUNT", "filterType" : "fieldToField", "isRunPageEditable" : true, "operator" : "notEqual", "value" : "PROJECTED_AMOUNT" }, { "column" : "CDF1", "filterType" : "fieldValue", "isRunPageEditable" : true, "operator" : "greaterThan", "value" : "0" } ] ``` **Bucket field** |Property|Type|Description| |--------|----|-----------| |`bucketType`|BucketType|The type of bucket. Possible values are `number`, `percent`, and `picklist`| |`developerName`|String|API name of the bucket.| |`label`|String|User-facing name of the bucket.| |`nullTreatedAsZero`|Boolean|Specifies whether null values are converted to zero (`true`) or not (`false`).| |`otherBucketLabel`|String|Name of the fields grouped as “Other” (in buckets of `BucketType` `PICKLIST`).| |`sourceColumnName`|String|Name of the bucketed field.| |`values`|Array of BucketTypeValues|Describes the values included in the bucket field..| **Bucket field value** |Property|Type|Description| |--------|----|-----------| |`label`|String|The user-facing name of the bucket.| |`sourceDimensionValues`|String|A list of the values from the source field included in this bucket category (in buckets of type `PICKLIST` and buckets of type `TEXT`).| |`rangeUpperBound`|Double|The greatest range limit under which values are included in this bucket category (in buckets of type `NUMBER`).| **Cross filter** |Property|Type|Description| |--------|----|-----------| |`criteria`|Array of [Filter details[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Information about how to filter the `relatedEntity`. Use to relate the primary entity with a subset of the `relatedEntity`.| |`includesObject`|Boolean|Specifies whether objects returned have a relationship with the `relatedEntity` (true) or not (`false`).| |`primaryEntityField`|String|The name of the object on which the cross filter is evaluated.| |relatedEntity|String|The name of the object that the `primaryEntityField` is evaluated against. (The right-hand side of the cross filter).| |relatedEntityJoinField|String|The name of the field used to join the `primaryEntityField` and `relatedEntity`.| **Custom Detail Formula** |Property|Type|Description| |--------|----|-----------| |`decimalPlaces`|Integer|Formats the value returned by the row-level formula. It is required for numeric return values, invalid for non-numeric return values.| |`description`|String|User-defined description of the row-level formula.| |`formula`|String|Specifies the formula expression to be evaluated. All report type fields, except bucketed fields and historical tracking fields can be referenced.| |`formulaType`|String|Specifies the return type of the formula. Valid values include date, datetime, number, or text.| |`label`|String|Specifies a name for the row-level formula.| **Custom summary formula** |Property|Type|Description| |--------|----|-----------| |`label`|String|The user-facing name of the custom summary formula.| |`description`|String|The user-facing description of the custom summary formula.| |`formulaType`|String|The format of the numbers in the custom summary formula. Possible values are `number`, `currency`, and `percent`.| |`decimalPlaces`|Integer|The number of decimal places to include in numbers.| |`downGroup`|String|The name of a row grouping when the `downGroupType` is `CUSTOM`. `Null` otherwise.| |`downGroupType`|String|Where to display the aggregate of the custom summary formula. Possible values are `all`, `custom`, and `grand_total`.| |`acrossGroup`|String|The name of a column grouping when the `accrossGroupType` is `CUSTOM`. `Null` otherwise.| |`acrossGroupType`|String|Where to display the aggregate of the custom summary formula. Possible values are `all`, `custom`, and `grand_total`.| |`formula`|String|The operations performed on values in the custom summary formula.| **Top rows** |Property|Type|Description| |--------|----|-----------| |`rowLimit`|Integer|The number of rows returned in the report.| |`direction`|String|The sort order of the report rows.| **Report type metadata** |Property|Type|Description| |--------|----|-----------| |`categories`|[Categories[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Returns all row-level formulas in a report as an object identical to the other categories objects. For row-level formulas, these properties are always false: allowedInCustomDetailFormula, Bucketable, Filterable, isCustom, and isLookup. For row-level formulas, these properties are always null: filterValues and inactiveFilterValues.| |`dataTypeFilterOperatorMap`|Filter operator reference|Lists all the possible field data types that can be used to filter the report. Each data type, such as phone, percent, currency, or picklist has two properties: `name` (string), a unique API name for each field type’s filter criteria—use this API name in the metadata to define filter criteria for a report; and `label` (string), the display name for each filter criteria available to fields of a particular data type. For example, multipicklist fields can have for filter criteria, “equals,” “not equal to,” “includes,” and “excludes.” Bucket fields are considered to be of string data type.| |`dateGranularityInfos`|[`dateGranularityInfos[]`](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|An array of objects each of which specifies a measure of time used to group date fields (day, week, month, fiscal quarter, and more).| |`divisionInfo`|[Division info[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Default division and list of all possible record-level divisions that can be used in a report.| |`objects`|[Objects info[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of objects included in report type. Available in API version 54.0 and later.| |`scopeInfo`|[Scope info[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.| |`standardDateFilterDurationGroups`|[Standard date filter duration groups[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|List of standard date filters available in reports.| |`standardFilterInfos`|Array of strings|List of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.| |`supportsJoinedFormat`|Boolean|Specifies whether a report type is compatible with joined reports (`true`) or not (`false`).| **Categories** |Property|Type|Description| |--------|----|-----------| |`label`|String|Display name of a section in the report type under which fields are organized. For example, in an Accounts with Contacts custom report type, Account General is the display name of the section that has fields on general account information.| |`columns`|[Column map](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/reports/sforce-analytics-rest-api-getbasic-reportmetadata.md)|Information for all fields in the report type organized under a particular section’s unique API name.| **Column map** |Property|Type|Description| |--------|----|-----------| |`allowedInCustomDetailFormula`|Boolean|Specifies whether a field is whether a field is can be referenced in a row-level formula (`true`) or not (`false`).| |`bucketable`|Boolean|Specifies whether a field can be used as the basis for a bucket column (`true`) or not (`false`).| |`dataType`|String|Data type of the field.| |`entityColumnName`|String|Describes the relationship between an sObject and a report field by returning the sObject and sObject field name that a report field maps to. The value returned is formatted as `sObject.sObject field`. The property is part of an object that describes a report field, such as an object in the `columns[]` array of a report type object from `reportTypeMetadata`. For example, on the `LAST_UPDATE_BY` column, the value of `entityColumnName` is `“User.Name”`, which tells us that it’s mapped to the `Name` field on the `User` sObject. For a standard report column that uses a lookup field, `entityColumnName` returns the related object and field. For example, the `LAST_UPDATE_BY` column returns `"User.Name"`. For a custom lookup field, `entityColumnName` can return the object that contains the field and the field's API name instead of the related object's field. For example, a custom lookup-to-`User` field on a custom object can return `"MyCustomObject.MyCustomField"`. Row-level formulas aren’t directly mapped to sObject fields like report fields, but they still have an `entityColumnName` property. For row-level formulas, the value of `entityColumnName` is `CDF1`.| |`fieldToFieldFilterable`|Boolean|Specifies whether a field can be referenced in a field-to-field filter (`true`) or not (`false`).| |`filterValues`|String array|All filter values for a field, if the field data type is of picklist, multi-select picklist, boolean, or checkbox. For example, checkbox fields always have a value of `True` or `False`. For fields of other data types, the filter value is an empty array because their values can’t be determined. Filter values have two properties: `name` (unique API name for a filter value, of type string) and `label` (display name of a filter value, of type string).| |`filterable`|Boolean|`False` means that the field is of a type that can’t be filtered. For example, fields of the type Encrypted Text can’t be filtered.| |`isCustom`|Boolean|Specifies whether a column is a custom (`true`) or standard (`false`) field.| |`isLookup`|Boolean|Specifies whether a field is a lookup (`true`) or not (`false`).| |`label`|String|Display name of a field.| |`maxLength`|Integer|Indicates the maximum permited number of characters for the value of a column field. If there is no limit, use `null`.| |`uniqueCountable`|Boolean|Specifies whether a field supports unique count (`true`) or not (`false)`| Example entityColumnName: ```nolang "reportTypeMetadata" : { "categories" : [ { "columns" : { "LAST_UPDATE_BY" : { "allowedInCustomDetailFormula" : true, "bucketable" : true, "dataType" : "string", "entityColumnName" : "User.Name", "fieldToFieldFilterable" : false, "filterValues" : [ ], "filterable" : true, "inactiveFilterValues" : [ ], "isCustom" : false, "isLookup" : true, "label" : "Last Modified By", "maxLength" : null, "uniqueCountable" : true } } } ] } ``` **`dateGranularityInfos`** |Property|Type|Description| |--------|----|-----------| |`label`|String|The name of the time measure as it appears in the application.| |`value`|String|API name of the time measure.| **Division Info** |Property|Type|Description| |--------|----|-----------| |`defaultValue`|String|Users are assigned a default division that applies to their newly created accounts, leads, and custom objects that are enabled for divisions.| |`values`|String|All division values. Division values have two properties: `label` (display name of a division) and `name` (unique API name of a division).| **Objects Info** |Property|Type|Description| |--------|----|-----------| |`apiName`|String|API name of the object.| |`joinType`|String|Present for custom report types. Indicates how the object is joined. Valid values are `ROOT` (primary object), `INNER` (inner join), or `OUTER` (outer join).| |`label`|String|Display name of the object.| **Scope Info** |Property|Type|Description| |--------|----|-----------| |`defaultValue`|String|Default scope of the data on which you run the report.| |`values`|Array of strings|All scope values. Valid values depend on the report type. Scope values have the following properties: `allowsDivision` (allows you to segment the report by this scope), `label` (display name of the scope), and `value` (value of the scope).| **Standard date filter duration groups** |Property|Type|Description| |--------|----|-----------| |`label`|String|Display name of the standard date filter grouping. Valid values are Calendar Year, Calendar Quarter, Calendar Month, Calendar Week, Fiscal Year, Fiscal Quarter, Day and custom value based on a user-defined date range.| |`standardDateFilterDurations`|[Standard date filter durations[]](../reports/sforce-analytics-rest-api-getbasic-reportmetadata.md#describe)|Details about each possible relative date filter defined under the standard date filter grouping.| **Standard date filter durations** |Property|Type|Description| |--------|----|-----------| |`endDate`|String|End date of a date filter.| |`label`|String|Display name of a date filter. Valid date filters are relative date filters—like `Current FY` and `Current FQ`—and custom date filters.| |`startDate`|String|Start date of a date filter.| |`value`|String|API name of a date filter. Valid date filters are relative date filters—like `THIS_FISCAL_YEAR` and `NEXT_FISCAL_QUARTER`—and custom date filters.| # Report Type List Return a list of report types. ## Syntax **URI:** `/services/data/vXX.X/analytics/report-types` **Formats:** JSON **HTTP methods** |Method|Description| |------|-----------| |`GET`|Returns a list of report types.| ## GET Response Body An array of report type folder objects. Each object contains the following fields: |Property|Type|Description| |--------|----|-----------| |`label`|String|The end user-facing name of the report type folder.| |`report-types`|[report-types[]](#report-type-list)|An array of report types.| **report-types[]** An array of report type objects. Each object contains the following fields: |Property|Type|Description| |--------|----|-----------| |`describeUrl`|String|A URL link to the report type’s metadata.| |`description`|String|Optional. A description of the report type.| |`isHidden`|Boolean|Indicates whether an administrator has hidden the report type (`true`) or not (`false`). Hidden report types don’t appear in the report builder when creating a report.| |`isHistorical`|Boolean|Optional. `true` for historical tracking report types. If this property is missing, the value is assumed to be `false`.| |`label`|String|The end user-facing name of the report type in the report builder.| |`supportsJoinedFormat`|Boolean|Specifies whether a report type is compatible with joined reports (`true`) or not (`false`).| |`type`|String|The API name of the report type.| # Report Types Use the Report Types API to get information about what report types are available in your org. The Report Types API is available in API version 39.0 and later. Resources for the Report Types API are available at `/services/data//analytics/report-types`. You can query each resource with an `HTTP` method. **note:** You can use either `report-types` or `reportTypes` when referring to a report type resource. The two are equivalent. |Resource|Supported HTTP Method|Description| |--------|---------------------|-----------| |[Report Type List](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-list.md) `/services/data//analytics/report-types`|`GET`|Returns a list of available report types.| |[Report Type](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-reporttype.md) `/services/data//analytics/report-types/`|`GET`|Returns metadata about a specified report type.| |[Recently Created Reports](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-recently-created.md) `/services/data//analytics/report-types//recent-reports`|`GET`|Returns a list of recently created reports for a specific report type.| |[Recently Used Report Types](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-recently-used.md) `/services/data//analytics/report-types/recent/by-user`|`GET`|Returns a list of report types used by reports recently created by the current user.| |[Hide and Unhide Report Types](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-hide-unhide.md) `/services/data//analytics/reports/show-hide-report_type`|`PATCH`|Sets the `hidden` parameter to `true` or `false` for a specific report type.| - **[Report Type List](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-list.md)** Return a list of report types. - **[Report Type](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-reporttype.md)** Return metadata about a report type. - **[Recently Used Report Types](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-recently-used.md)** Get the list of report types used in the 50 reports most recently created by the current user. - **[Recently Created Reports](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-recently-created.md)** Get the list of recently created reports for a particular report type for the current user or any other users. - **[Hide and Unhide Report Types](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-reporttypes-reference-hide-unhide.md)** Update hidden state of report types (`PATCH`). # Reports Resources for the Reports API are available at `/services/data//analytics/reports`. You can query each resource with a HTTP method (such as GET). Use these resources to integrate report data directly into your applications. |Resource|Supported HTTP Method|Description| |--------|---------------------|-----------| |[Report](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/analytics-api-report-list-resource.md)|PATCH, DELETE|Saves changes to a report. Deletes a report.| |[Describe](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getbasic-reportmetadata.md)|GET|Gives report metadata. This includes information about fields that are defined in the report as detail columns,  summaries, custom summary formulas, filters, and groupings.| |[Execute Syte](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-getreportrundata.md)|GET, POST|Gives report summary level data with or without details. Returns specific results if you define dynamic filters, groupings, or aggregates in the metadata of a POST request.| |[Exexcute Async](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instances-summaryasync.md)|POST|Returns an instance that stores summary level data with or without details for a report run asynchronously. To get specific results, define filters in the metadata of the request.| |[Instances List](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instances-resource.md)|GET|List of instances of a report that were requested for an asynchronous run.| |[Instance Results](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-instance-resource-results.md)|GET|Depending on the type of your request, gives summary level data with or without details for an instance of a report run asynchronously.| |[Report List](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-recentreportslist.md)|GET, POST|List of reports that were recently viewed by the API user. Makes a copy of a report.| |[Report Fields](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/sforce-analytics-rest-api-get-fields.md)|POST|If the request body is empty, returns a list of all possible report fields. Otherwise, returns a list of fields that specified reports share. Use the `fields` resource to determine the best fields for use in dashboard filters.| # Reports Examples Learn how to run, create, edit, or delete reports with the Reports REST API. Running a report returns a fact map that describes report data. Learn how to read report fact maps. For information about different ways to execute the Reports REST API, see [Send REST Request with cURL](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_curl.htm) and [Authorization Through Connected Apps and OAuth 2.0](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_oauth_and_connected_apps.htm). - **[Create a New Report](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/analytics-api-report-example-post-report.md)** Create a new report using a POST request. - **[Run Reports Synchronously or Asynchronously](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-get-reportdata.md)** - **[Get Report Metadata](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-get-reportmetadata.md)** - **[Get a List of Report Types](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/analytics-api-reporttypes-example-get-reporttypes.md)** Return a list of analytics notifications using a GET request. - **[Download Formatted Excel Reports Using the Reports REST API](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-download-excel.md)** Use the Reports REST API to download report results as JSON or Excel. - **[List Asynchronous Runs of a Report](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-list-asyncreportruns.md)** - **[Filter Reports on Demand](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-filter-reportdata.md)** - **[List Recently Viewed Reports](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-list-recentreports.md)** - **[Decode the Fact Map](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-factmap-example.md)** - **[Get Report Data without Saving Changes to or Creating a Report](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-report-query-example.md)** Run a report without creating a report or changing an existing one by making a POST request to the `query` resource. Get report data without filling up your org with unnecessary reports. - **[Save Changes to Reports](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-save-report.md)** Save changes to a report by sending a PATCH request to the Report resource. - **[Clone Reports](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-clone-report.md)** Creates a copy of a custom, standard, or public report by sending a POST request to the Report List resource. - **[Delete Reports](https://developer.salesforce.com/docs/analytics/salesforce-analytics-rest-api/guide/reports/sforce-analytics-rest-api-delete-report.md)** Delete a report by sending a DELETE request to the Report resource. Deleted reports are moved to the Recycle Bin. # Requirements and Limitations The Reports and Dashboards REST API is available for any organization that has API enabled. You must establish an authenticated session using OAuth in order to access the Reports and Dashboards REST API. When working with this API, consider these restrictions in addition to general API limits. To use the Analytics Download API, your org must have a CRM Analytics license. In addition, your org needs both Slack for Salesforce and CRM Analytics for Slack enabled. For more information, see [Enable Salesforce for Slack Integrations](https://help.salesforce.com/s/articleView?id=slack.slack_apps_enable.htm&type=5). **note:** Responses and requests are in JSON. While using the Reports and Dashboards REST API with a POST request body, you must use content-type: application/json. If you don’t use this content type, then you could get unexpected results. ## Reports Limits - Cross filters, standard report filters, and filtering by row limit are unavailable when filtering data. - Historical tracking reports are only supported for matrix reports. - Subscriptions aren't supported for historical tracking reports. - The API can process only reports that contain up to 100 fields selected as columns. - A list of up to 200 recently viewed reports can be returned. - Your org can request up to 500 synchronous report runs per hour. - The API supports up to 20 synchronous report run requests at a time. - A list of up to 2,000 instances of a report that was run asynchronously can be returned. - The API supports up to 200 requests at a time to get results of asynchronous report runs. - Your organization can request up to 1,200 asynchronous requests per hour. - Asynchronous report run results are available within a 24-hour rolling period. - The API returns up to the first 2,000 report rows. You can narrow results using filters. - You can add up to 20 custom field filters when you run a report. - If a report is run on a standard or custom object as an automated process user from an Apex test class, only the required custom fields are returned. Non-required custom fields aren’t shown in the results. - - Your org can request up to 200 dashboard refreshes per hour. - Your org can request results for up to 5,000 dashboards per hour. ## Dashboards Limits - Your org can request up to 200 dashboard refreshes per hour. - Your org can request results for up to 5,000 dashboards per hour. ## Analytics Notification Limits - Each user can subscribe to up to 5 reports. - Each user can create up to 5 Analytics notifications. All limits that apply to reports created in the report builder also apply to the API, as do limits for dashboards created in the dashboard builder. For more information, see “Salesforce Reports and Dashboards Limits” in Salesforce Help. ## Analytics Download Limits - Each user can make 3 concurrent requests to download Analytics assets. # Return Details About Dashboard Components Get details about one or more dashboard components using a POST request. Use a POST request on the [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) resource to get details about one or more dashboard components. Specify which dashboard components you want details about using `componentIds` in the request body. Available in API versions 36.0 and later. ## Example Usage ```nolang /services/data/v36.0/analytics/dashboards/01ZR00000008h2EMAQ ``` ## Example Request Body ```nolang { "componentIds": ["01aR00000005aT4IAI", "01aR00000005aT5IAI"] } ``` ## Example Response Body ```nolang { "attributes" : { "dashboardId" : "01ZR00000008h2EMAQ", "dashboardName" : "Liz's Sales Manager Dashboard", "describeUrl" : "/services/data/v37.0/analytics/dashboards/01ZR00000008h2EMAQ/describe", "statusUrl" : "/services/data/v37.0/analytics/dashboards/01ZR00000008h2EMAQ/status", "type" : "Dashboard" }, "componentData" : [ { "componentId" : "01aR00000005aT4IAI", "reportResult" : { "attributes" : null, "allData" : true, "factMap" : { "0!T" : { "aggregates" : [ { "label" : "$10,000.00", "value" : 10000 } ] }, "1!T" : { "aggregates" : [ { "label" : "$110,000.00", "value" : 110000 } ] }, "0_0!T" : { "aggregates" : [ { "label" : "$10,000.00", "value" : 10000 } ] }, "2_2!T" : { "aggregates" : [ { "label" : "$143.00", "value" : 143 } ] }, "2!T" : { "aggregates" : [ { "label" : "$400,398.00", "value" : 400398 } ] }, "0_1!T" : { "aggregates" : [ { "label" : "$0.00", "value" : 0 } ] }, "2_3!T" : { "aggregates" : [ { "label" : "$100,017.00", "value" : 100017 } ] }, "T!T" : { "aggregates" : [ { "label" : "$520,398.00", "value" : 520398 } ] }, "2_0!T" : { "aggregates" : [ { "label" : "$138.00", "value" : 138 } ] }, "1_0!T" : { "aggregates" : [ { "label" : "$110,000.00", "value" : 110000 } ] }, "2_1!T" : { "aggregates" : [ { "label" : "$300,100.00", "value" : 300100 } ] } }, "groupingsAcross" : null, "groupingsDown" : { "groupings" : [ { "groupings" : [ { "groupings" : [ ], "key" : "0_0", "label" : "-", "value" : null }, { "groupings" : [ ], "key" : "0_1", "label" : "-", "value" : null } ], "key" : "0", "label" : "January 2016", "value" : "January 2016" }, { "groupings" : [ { "groupings" : [ ], "key" : "1_0", "label" : "-", "value" : null } ], "key" : "1", "label" : "February 2016", "value" : "February 2016" }, { "groupings" : [ { "groupings" : [ ], "key" : "2_0", "label" : "-", "value" : null }, { "groupings" : [ ], "key" : "2_1", "label" : "-", "value" : null }, { "groupings" : [ ], "key" : "2_2", "label" : "-", "value" : null }, { "groupings" : [ ], "key" : "2_3", "label" : "-", "value" : null } ], "key" : "2", "label" : "March 2016", "value" : "March 2016" } ] }, "hasDetailRows" : false, "reportExtendedMetadata" : { "aggregateColumnInfo" : { "s!AMOUNT" : { "dataType" : "currency", "label" : "Sum of Amount" } }, "detailColumnInfo" : { }, "groupingColumnInfo" : { "ACCOUNT_NAME" : { "dataType" : "string", "groupingLevel" : 0, "label" : "Account Name" }, "CLOSE_DATE" : { "dataType" : "date", "groupingLevel" : 0, "label" : "Close Date" } } }, "reportMetadata" : { "aggregates" : [ "s!AMOUNT" ], "buckets" : [ { "bucketType" : "picklist", "devloperName" : "BucketField_47575792", "label" : "Industry", "nullTreatedAsZero" : false, "otherBucketLabel" : null, "sourceColumnName" : "INDUSTRY", "values" : [ { "label" : "Technology", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Agriculture", "Apparel", "Banking", "Biotechnology", "Chemicals", "Communications", "Construction", "Consulting", "Education", "Electronics" ] }, { "label" : "Energy", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Energy", "Engineering", "Entertainment", "Environmental", "Finance", "Food & Beverage", "Government", "Healthcare", "Hospitality", "Insurance", "Machinery", "Manufacturing" ] }, { "label" : "Healthcare", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Media", "Not For Profit", "Other", "Recreation", "Retail", "Shipping", "Technology", "Telecommunications", "Transportation", "Utilities" ] } ] }, { "bucketType" : "picklist", "devloperName" : "BucketField_36625466", "label" : "Stage", "nullTreatedAsZero" : false, "otherBucketLabel" : null, "sourceColumnName" : "STAGE_NAME", "values" : [ { "label" : "Early", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Prospecting", "Qualification", "Needs Analysis" ] }, { "label" : "Late", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Value Proposition", "Id. Decision Makers", "Perception Analysis", "Proposal/Price Quote", "Negotiation/Review" ] }, { "label" : "Won", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Closed Won" ] }, { "label" : "Lost", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Closed Lost" ] } ] } ], "chart" : null, "crossFilters" : [ ], "currency" : null, "description" : null, "detailColumns" : [ ], "developerName" : "Deals_Closing_This_Quarter", "division" : null, "folderId" : "00lR0000000M8IiIAK", "groupingsAcross" : [ ], "groupingsDown" : [ { "dateGranularity" : "None", "name" : "ACCOUNT_NAME", "sortAggregate" : null, "sortOrder" : "Asc" }, { "dateGranularity" : "Month", "name" : "CLOSE_DATE", "sortAggregate" : null, "sortOrder" : "Asc" } ], "hasDetailRows" : false, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OR0000000K2UeMAK", "name" : "Deals Closing This Quarter", "reportBooleanFilter" : null, "reportFilters" : [ { "column" : "BucketField_36625466", "isRunPageEditable" : true, "operator" : "equals", "value" : "Early,Late" }, { "column" : "TYPE", "isRunPageEditable" : true, "operator" : "equals", "value" : "Existing Business,New Business" } ], "reportFormat" : "SUMMARY", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "THIS_FISCAL_QUARTER", "endDate" : "2016-06-30", "startDate" : "2016-04-01" }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ] } }, "status" : { "dataStatus" : "DATA", "errorCode" : null, "errorMessage" : null, "errorSeverity" : null, "refreshDate" : "2016-03-22T18:24:39.000+0000", "refreshStatus" : "IDLE" } }, { "componentId" : "01aR00000005aT5IAI", "reportResult" : { "attributes" : null, "allData" : true, "factMap" : { "0!T" : { "aggregates" : [ { "label" : "$634,493.00", "value" : 634493 } ] }, "1!T" : { "aggregates" : [ { "label" : "$590,036.00", "value" : 590036 } ] }, "0_0!T" : { "aggregates" : [ { "label" : "$14.00", "value" : 14 } ] }, "2!T" : { "aggregates" : [ { "label" : "$1,330,035.00", "value" : 1330035 } ] }, "0_1!T" : { "aggregates" : [ { "label" : "$36,021.00", "value" : 36021 } ] }, "0_2!T" : { "aggregates" : [ { "label" : "$5,000.00", "value" : 5000 } ] }, "1_3!T" : { "aggregates" : [ { "label" : "$500,000.00", "value" : 500000 } ] }, "T!T" : { "aggregates" : [ { "label" : "$2,554,564.00", "value" : 2554564 } ] }, "0_3!T" : { "aggregates" : [ { "label" : "$440,000.00", "value" : 440000 } ] }, "1_4!T" : { "aggregates" : [ { "label" : "$13.00", "value" : 13 } ] }, "0_4!T" : { "aggregates" : [ { "label" : "$20,000.00", "value" : 20000 } ] }, "1_1!T" : { "aggregates" : [ { "label" : "$11.00", "value" : 11 } ] }, "0_5!T" : { "aggregates" : [ { "label" : "$90,000.00", "value" : 90000 } ] }, "1_2!T" : { "aggregates" : [ { "label" : "$40,000.00", "value" : 40000 } ] }, "0_6!T" : { "aggregates" : [ { "label" : "$43,320.00", "value" : 43320 } ] }, "0_7!T" : { "aggregates" : [ { "label" : "$138.00", "value" : 138 } ] }, "1_0!T" : { "aggregates" : [ { "label" : "$50,012.00", "value" : 50012 } ] }, "2_2!T" : { "aggregates" : [ { "label" : "$100,017.00", "value" : 100017 } ] }, "2_3!T" : { "aggregates" : [ { "label" : "$20,018.00", "value" : 20018 } ] }, "2_4!T" : { "aggregates" : [ { "label" : "$0.00", "value" : 0 } ] }, "2_0!T" : { "aggregates" : [ { "label" : "$100,000.00", "value" : 100000 } ] }, "2_1!T" : { "aggregates" : [ { "label" : "$1,110,000.00", "value" : 1110000 } ] } }, "groupingsAcross" : null, "groupingsDown" : { "groupings" : [ { "groupings" : [ { "groupings" : [ ], "key" : "0_0", "label" : "March 2013", "value" : "2013-03-01" }, { "groupings" : [ ], "key" : "0_1", "label" : "July 2015", "value" : "2015-07-01" }, { "groupings" : [ ], "key" : "0_2", "label" : "August 2015", "value" : "2015-08-01" }, { "groupings" : [ ], "key" : "0_3", "label" : "September 2015", "value" : "2015-09-01" }, { "groupings" : [ ], "key" : "0_4", "label" : "October 2015", "value" : "2015-10-01" }, { "groupings" : [ ], "key" : "0_5", "label" : "November 2015", "value" : "2015-11-01" }, { "groupings" : [ ], "key" : "0_6", "label" : "December 2015", "value" : "2015-12-01" }, { "groupings" : [ ], "key" : "0_7", "label" : "March 2016", "value" : "2016-03-01" } ], "key" : "0", "label" : "Manufacturing", "value" : "Manufacturing" }, { "groupings" : [ { "groupings" : [ ], "key" : "1_0", "label" : "February 2013", "value" : "2013-02-01" }, { "groupings" : [ ], "key" : "1_1", "label" : "February 2015", "value" : "2015-02-01" }, { "groupings" : [ ], "key" : "1_2", "label" : "September 2015", "value" : "2015-09-01" }, { "groupings" : [ ], "key" : "1_3", "label" : "February 2016", "value" : "2016-02-01" }, { "groupings" : [ ], "key" : "1_4", "label" : "April 2016", "value" : "2016-04-01" } ], "key" : "1", "label" : "Media", "value" : "Media" }, { "groupings" : [ { "groupings" : [ ], "key" : "2_0", "label" : "November 2015", "value" : "2015-11-01" }, { "groupings" : [ ], "key" : "2_1", "label" : "December 2015", "value" : "2015-12-01" }, { "groupings" : [ ], "key" : "2_2", "label" : "March 2016", "value" : "2016-03-01" }, { "groupings" : [ ], "key" : "2_3", "label" : "May 2016", "value" : "2016-05-01" }, { "groupings" : [ ], "key" : "2_4", "label" : "June 2016", "value" : "2016-06-01" } ], "key" : "2", "label" : "Technology", "value" : "Technology" } ] }, "hasDetailRows" : false, "reportExtendedMetadata" : { "aggregateColumnInfo" : { "s!AMOUNT" : { "dataType" : "currency", "label" : "Sum of Amount" } }, "detailColumnInfo" : { }, "groupingColumnInfo" : { "INDUSTRY" : { "dataType" : "picklist", "groupingLevel" : 0, "label" : "Industry" }, "CLOSE_DATE" : { "dataType" : "date", "groupingLevel" : 0, "label" : "Close Date" } } }, "reportMetadata" : { "aggregates" : [ "s!AMOUNT" ], "buckets" : [ { "bucketType" : "picklist", "devloperName" : "BucketField_47575792", "label" : "Industry", "nullTreatedAsZero" : false, "otherBucketLabel" : null, "sourceColumnName" : "INDUSTRY", "values" : [ { "label" : "Technology", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Agriculture", "Apparel", "Banking", "Biotechnology", "Chemicals", "Communications", "Construction", "Consulting", "Education", "Electronics" ] }, { "label" : "Energy", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Energy", "Engineering", "Entertainment", "Environmental", "Finance", "Food & Beverage", "Government", "Healthcare", "Hospitality", "Insurance", "Machinery", "Manufacturing" ] }, { "label" : "Healthcare", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Media", "Not For Profit", "Other", "Recreation", "Retail", "Shipping", "Technology", "Telecommunications", "Transportation", "Utilities" ] } ] }, { "bucketType" : "picklist", "devloperName" : "BucketField_36625466", "label" : "Stage", "nullTreatedAsZero" : false, "otherBucketLabel" : null, "sourceColumnName" : "STAGE_NAME", "values" : [ { "label" : "Early", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Prospecting", "Qualification", "Needs Analysis" ] }, { "label" : "Late", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Value Proposition", "Id. Decision Makers", "Perception Analysis", "Proposal/Price Quote", "Negotiation/Review" ] }, { "label" : "Won", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Closed Won" ] }, { "label" : "Lost", "rangeUpperBound" : null, "sourceDimensionValues" : [ "Closed Lost" ] } ] } ], "chart" : null, "crossFilters" : [ ], "currency" : null, "description" : null, "detailColumns" : [ ], "developerName" : "Pipeline_By_Industry1", "division" : null, "folderId" : "005R0000000Hv5rIAC", "groupingsAcross" : [ ], "groupingsDown" : [ { "dateGranularity" : "None", "name" : "INDUSTRY", "sortAggregate" : null, "sortOrder" : "Asc" }, { "dateGranularity" : "Month", "name" : "CLOSE_DATE", "sortAggregate" : null, "sortOrder" : "Asc" } ], "hasDetailRows" : true, "hasRecordCount" : false, "historicalSnapshotDates" : [ ], "id" : "00OR0000000OgsOMAS", "name" : "Copy of Pipeline By Industry", "reportBooleanFilter" : null, "reportFilters" : [ { "column" : "ACCOUNT_TYPE", "isRunPageEditable" : false, "operator" : "lessOrEqual", "value" : "Integrator,Partner,Prospect" }, { "column" : "INDUSTRY", "isRunPageEditable" : true, "operator" : "notEqual", "value" : "" } ], "reportFormat" : "SUMMARY", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "CUSTOM", "endDate" : null, "startDate" : null }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ] } }, "status" : { "dataStatus" : "DATA", "errorCode" : null, "errorMessage" : null, "errorSeverity" : null, "refreshDate" : "2016-03-22T18:24:39.000+0000", "refreshStatus" : "IDLE" } } ], "dashboardMetadata" : { "canChangeRunningUser" : false, "components" : [ { "componentData" : 0, "footer" : null, "header" : "Pipeline This Quarter", "id" : "01aR00000005aT4IAI", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : false, "filterColumns" : [ ], "groupings" : null, "maxRows" : null, "sort" : null, "useReportChart" : false, "visualizationProperties" : { "breakPoints" : [ { "aggregateName" : "s!AMOUNT", "breaks" : [ { "color" : "c23934", "lowerBound" : 0, "upperBound" : 200000 }, { "color" : "ffb75d", "lowerBound" : 200000, "upperBound" : 400000 }, { "color" : "00716b", "lowerBound" : 400000, "upperBound" : 600000 } ] } ], "showPercentages" : true, "showTotal" : true }, "visualizationType" : "Gauge" }, "reportId" : "00OR0000000K2UeMAK", "title" : null, "type" : "Report" }, { "componentData" : 1, "footer" : null, "header" : "Pipeline by Industry", "id" : "01aR00000005aT5IAI", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : false, "filterColumns" : [ ], "groupings" : [ { "name" : "INDUSTRY" } ], "maxRows" : null, "sort" : { "column" : "INDUSTRY", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "combineSmallGroups" : false, "legendPosition" : "Bottom", "showPercentages" : false, "showTotal" : false, "showValues" : false }, "visualizationType" : "Donut" }, "reportId" : "00OR0000000OgsOMAS", "title" : null, "type" : "Report" } ], "description" : null, "developerName" : "yTtOilrkFGewFKpFUOscDuukUApfxH", "filters" : [ ], "folderId" : "00lR0000000DnRZIA0", "id" : "01ZR00000008h2EMAQ", "layout" : { "components" : [ { "colspan" : 3, "column" : 0, "row" : 0, "rowspan" : 4 }, { "colspan" : 3, "column" : 0, "row" : 4, "rowspan" : 4 } ], "gridLayout" : true, "numColumns" : 9, "rowHeight" : 80 }, "name" : "Liz's Sales Manager Dashboard", "runningUser" : { "displayName" : "Vandelay Art", "id" : "005R0000000Hv5rIAC" } } } ``` # round({n}[,{m}]) Returns the value of _n_ rounded to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ rounded to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ rounded to the nearest integer. For tie-breaking, it follows round half way from zero convention. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. _m_ can be an integer value between -15 and 15, inclusive. `round({n}[,{m}])` takes the following syntax. ```nolang SELECT round(N[,M]) as AliasName FROM dataset; ``` ## Example This example returns 47.385 rounded to the first decimal place. ```nolang SELECT round(47.385, 1) as roundExample FROM Superstore LIMIT 1; ``` | roundExample | | ------------ | | 47.4 | # round(n[, m]) Returns the value of _n_ rounded to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ rounded to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ rounded to the nearest integer. For tie-breaking, it follows round half way from zero convention. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. _m_ can be an integer value between -15 and 15, inclusive. This function can only be used in a `foreach` statement. **note:** If the _n_ value scale is lost on data upload, _m_ can only work with the scale present in the dataset. It can't add scale back to the value. ## Example ```nolang q = foreach q generate round(Price, 2) as Price; ``` ## Example ```nolang round(-1.2345) = -1 ``` ```nolang round(2.355, 2) = 2.36 ``` ```nolang round(-3455.8, -1) = -3460 ``` ```nolang round(2.35, 3) = 2.35 ``` # rtrim() Removes the specified characters from the end of a string. ## Syntax `rtrim`(_string_,_substr_) ## Usage Removes every instance of each character in _substr_ from the end of _string_. This function is case-sensitive. To remove trailing spaces, do not specify a value for _substr_. ## Example This example shows that `rtrim` removes the specified characters from the end of a string. This function is case-sensitive. ```nolang q = load "test"; q = foreach q generate 'Company' as 'Company', rtrim('Company',"abc") as 'rtrim abc', rtrim('Company',"cba") as 'rtrim cba', rtrim('Company',"ab") as 'rtrim ab', rtrim('Company',"ac") as 'rtrim ac'; ``` ![Diagram showing number of close opps, grouped by day of the week they were closed.](https://developer.salesforce.com/media/bi_dev_guide_saql/rtrim.png) # Rule Macro And Macro Definition Attributes A rule macro object contains a collection of macro definition objects. Macro definition objects define the logic of macros and their return values. Macro object attributes are as follows: - namespace: A unique string identifier (to the template) used to scope the collection of macro definitions. - definitions: Array of macro definition objects defined within the rule macro.. Macro definition object attributes are as follows: - name: The name of the macro. - description: A string that describes what the macro does. - parameters: An array of zero or more parameter names that the macro expects. - actions: An array of zero or more rule actions to perform as part of the macro. - returns: An expression or literal value to be returned from the macro. ## Macro Definition Parameters The number of parameters passed in the macro function call must match the number of parameters defined in the macro. They’re passed in the order defined in the macro definition. You can use a maximum of 10 parameters per macro. Parameters can be referenced in the body of the macro using standard expression syntax: `${p.}`. Parameters can be referenced in any action that accepts expressions. Macros in actions support `“path”` statements so that expressions can be used for more dynamic JSON path handling. See Macro Examples. Parameters are scoped to the execution of the macro call and any references to `${p.)` fails outside the scope of the macro. # Rules Files Structure Rules files can contain three sections: rules, constants, and macros. - Rules. This is where you define the rules followed by the template for creating the app. - Constants. Use constants to create shortcuts for longer expressions. Constants are like variables, but are not passed in or declared in the UI. Constants can be referenced in the document via the normal expression language `${Constants.}`. - Macros. Rule macros let you define repeatable, well-tested rule code units that can be called within the context of any JSON transformation, simplifying and making the rule definition source easier to maintain # Rules Reference - [`rules.json` Syntax](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-json-syntax.md) - [`rules.json` Attributes](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-json-attributes.md) - [`string` Functions](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-string-functions.md) - [`array` Functions](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-array-functions.md) - [`date` Functions](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-date-functions.md) - [`json` Functions](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-json-functions.md) - [Static Functions](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-static-functions.md) [Back to Rules Overview](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-overview.md) # Rules Syntax The rules object may contain any number of rule objects. A rule object is made up of: | Attribute | Type | Example | Required | Notes | | ----------- | ------ | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | String | `"name": "ruleName"` | Yes |   | | `condition` | String | `"condition": "${Variables.foo == "Yes"}"` | No | Use freemarker conditions to apply the rule (same syntax as conditions used in `template-info.json`) | | `appliesTo` | Array |   | Yes | Use `"type": "*"` to apply to all JSON assets. Other valid values are `"dashboard"`, `"lens"`, `"workflow"`, `"schema"`, and `"xmd"`. The `"name"` string allows specific JSON assets to be referenced. The `"name"` can take `"*"` as well, to apply to all of one asset type or a group of one asset type. For workflow type, name must be `"*"`. | | `label` | String |   |   |   | | `actions` | Array |   | Yes | 4 action types: `add`, `put`, `set`, and `delete`. Can have as many actions as needed in the array. | Example `appliesTo` value: ```nolang { "type": "dashboard", "name": "dashboardOne" } ``` Example `actions` value: ```nolang { "action": "set", "description" : "A desc", "path": "$.json.path", "value": "setValue" } ``` # Rules Testing with jsonxform/transformation endpoint Test the results of a rule before deployment by calling the `jsonxform/transformation` endpoint. ## Process for Using jsonxform/transformation Use cURL or Postman to execute a `Post` call on the `/services/data/v51.0/jsonxform/transformation` REST endpoint. See the examples for starting points on what the POST request body must contain. If the rule works, the POST response contains the transformed JSON results. If the rule doesn’t work, the POST response contains any errors with guidance to fix the rule. The following examples show how you can take advantage of the built-in tokens we provide. ## Example: Post Transform A “put” rule that adds a `name/value` pair to the JSON. ```nolang { "document": { "user": { "firstName": "${User.FirstName}", "lastName": "${User.LastName}", "userName": "${User.UserName}", "id": "${User.Id}", "hello": "${Variables.hello}" }, "company": { "id": "${Org.Id}", "name": "${Org.Name}", "namespace": "${Org.Namespace}" } }, "values": { "Variables": { "hello": "world" } }, "definition": { "rules": [{ "name": "Example", "actions": [{ "action": "put", "description": "add hobby to user", "key": "hobby", "path": "$.user", "value": "mountain biking" }] }] } } ``` ## Example: Constant Array Tests an array function (`contains`) to determine the right value to add to the final JSON. ```nolang { "document": { "user": { "firstName": "${User.FirstName}", "lastName": "${User.LastName}", "userName": "${User.UserName}", "id": "${User.Id}", "hello": "${Variables.hello}" }, "company": { "id": "${Org.Id}", "name": "${Org.Name}", "namespace": "${Org.Namespace}" } }, "values": { "Variables": { "hello": "world", "choices": ["Products", "Cases"] } }, "definition": { "constants": [{ "name": "ConstantTest", "value": "${array:contains(Variables.choices, 'Products') ? 'Products' : 'No Products'}" }], "rules": [{ "name": "Example", "actions": [{ "action": "put", "description": "add hobby to user with constant", "key": "hobby", "path": "$.user", "value": "${Constants.ConstantTest}" }] }] } } ``` ## Example: Macro Transform Tests a macro with a rule. ```nolang { "document": { "user": { "firstName": "${User.FirstName}", "lastName": "${User.LastName}", "userName": "${User.UserName}", "id": "${User.Id}", "favorite": null } }, "values": {}, "definition": { "macros": [{ "namespace": "jsonTest", "definitions": [{ "name": "setNodeByPath", "parameters": [ "jsonPath", "value" ], "actions": [{ "action": "set", "path": "${p.jsonPath}", "value": "${p.value}" }] }] }], "rules": [{ "name": "Example", "actions": [{ "action": "put", "description": "add hobby to user", "key": "hobby", "path": "$.user", "value": "mountain biking" }, { "action": "eval", "description": "Set the value of 'favorite' with the value from 'hobby'", "path": "$.user.hobby", "value": "${jsonTest:setNodeByPath('$.user.favorite', Rules.CurrentNode)}" } ] }] } } ``` For reference on the `jsonxform/transformation` REST endpoint, see [JsonXform Transformation Resource](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_resources_jsonxform_transformation.htm) in the Analytics REST API Developer Guide. # `rules.json` Attributes This page describes the JSON attributes for defining rule objects used in `template-to-app-rules.json` and `app-to-template-rules.json`. For background on how rules fit into the App Template Framework, see [Work with App Template Framework Rules](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-overview.md). Rules files are made up of three sections: rules, constants, and macros. ## Rules | Attribute | Path | Required | Description | |-----------|------|----------|-------------| | `rules` | _(top-level)_ | No | An array of rules to define. Can be empty if no rules are needed. | | `description` | `rules` | No | A description for the rule. | | `name` | `rules` | Yes | A unique name for a rule. | | `condition` | `rules` | No | If the condition is met, the rule runs. If the condition is not met, the rule does not run. | | `appliesTo` | `rules` | Yes | An array of assets the rule applies to, such as dashboards, recipes, schemas, and XMDs. | | `name` | `rules.appliesTo` | No | The name of the asset. Can be `*` to apply the rule to all dashboards. Must match the `name` defined in the template-info for the asset. Best practice is to specify `name`. If null, defaults to `*` and the rule applies to all template assets. | | `type` | `rules.appliesTo` | No | The type of asset: `dashboard`, `workflow`, `lens`, `schema`, or `xmd`. Best practice is to specify `type`. If null, defaults to `*` and the rule applies to all asset types. | | `actions` | `rules` | Yes | An array of actions the rule invokes. One or more action are required. | | `action` | `rules.actions` | Yes | The type of action to perform: `set`, `add`, `delete`, `put`, `eval`, or `replace`. | | `description` | `rules.actions` | No | A description of the rule action, used for maintainability. | | `path` | `rules.actions` | Yes | The JSONPath to apply the action to. | | `value` | `rules.actions` | No | The value to place at the JSONPath. Required for `set`, `add`, and `put` actions. | | `index` | `rules.actions` | No | The index position for the action. Required for the `add` action only. | | `key` | `rules.actions` | No | The key for the action. Required for the `put` action only. | | `condition` | `rules.actions` | No | If the condition is met, the action runs. If the condition is not met, the action is skipped. Use this field to apply a condition to a single action instead of the whole rule. | ## Constants | Attribute | Path | Required | Description | |-----------|------|----------|-------------| | `constants` | _(top-level)_ | No | An array of constants to define. Can be empty if no constants are needed. | | `name` | `constants` | Yes | A unique name for a constant, used to reference the constant in other places. | | `value` | `constants` | Yes | The value of the constant. | ## Macros | Attribute | Path | Required | Description | |-----------|------|----------|-------------| | `macros` | _(top-level)_ | No | An array of macro namespace objects. Can be empty if no macros are needed. | | `namespace` | `macros` | Yes | A unique namespace that groups related macro definitions. Used with a macro's `name` to call it, for example `${widget_util:findWidget(...)}`. | | `definitions` | `macros` | Yes | An array of macro definitions within the namespace. | | `name` | `macros.definitions` | Yes | The name of the macro. | | `description` | `macros.definitions` | No | A string that describes what the macro does. | | `parameters` | `macros.definitions` | Yes | An array of zero or more parameter names that the macro expects. Reference a parameter's value with `${p.}`. | | `actions` | `macros.definitions` | An array of zero or more rule actions to perform as part of the macro, using the same action schema as `rules.actions` — see the Actions rows above. Omit if the macro only returns a computed value. | | `returns` | `macros.definitions` | No | An expression or literal value to be returned from the macro. Omit if the macro only performs actions and doesn't return a value. | **See Also** - [Work with App Template Framework Rules](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-overview.md) - [Macros in Rules](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-macros.md) - [`rules.json` Syntax](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-json-syntax.md) # rules.json Attributes The `rules.json` file attributes are: | Attribute | Required | Description | | --------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `constants` | No | Container attribute only - array of constants to be defined, can be empty if no constants are needed | | `constants` --> `name` | No | Unique name for a constant, used to reference the constant in other places | | `constants` --> `value` | No | Value of the constant | | `rules` | No | Container attribute only - array of rules to be defined, can be empty if no rules are needed | | `label` | No |   | | `rules` --> `name` | Yes | Unique name for a rule | | `rules` --> `condition` | No | If condition is met, then the rule will run, if the condition is not met, the rule will not run. | | `rules` --> `appliesTo` | Yes | Container attribute only - array of assets the rule should be be applied to (dashboards, dataflow, recipes, schemas, XMDs) | | `rules` --> `appliesTo` --> `name` | No. Best practice is to specify `name`. If null, defaults to `*`, and rule applies to all template assets. | Name of asset (can be \* in case of dashboards for all dashboards); must match the “name” defined in the template-info for the asset | | `rules` --> `appliesTo` --> `type` | No. Best practice is to specify `type`. If null, defaults to `*`, and rule applies to all asset types`*` | Type of asset (dashboard, workflow, lens, schema, xmd) | | `rules` --> `actions` | Yes | Container attribute only - array of actions the rule should invoke (one or more action is necessary) | | `rules` --> `actions` --> `action` | Yes | Type of action - set, add, delete, put, replace | | `rules` --> `actions` --> `description` | No | Description of the rule action - for maintainability | | `rules` --> `actions` --> `path` | Yes | JSONPath to take the action on | | `rules` --> `actions` --> `value` | No | Value needed for set/add/put, defines the value to put in the JSONPath | | `rules` --> `actions` --> `index` | No | Index needed for add action only | | `rules` --> `actions` --> `key` | No | Key needed for put action only | **See Also** - [Edit Rules Files](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-edit-rules-json.md) # rules.json Example Refer to this example of the `rules.json` file. ## Example ```nolang { "constants":[ { "name":"ChartType", "value":"pie" } ], "rules":[ { "name":"rule1", "appliesTo":[ "type":"dashboard", "name":"dashboardOne", ], "actions":[ { "action":"put", "description":"Put a section back in, but with different attributes", "path":"$.state.widgets.chart_1", "key":"pos", "value":{ "w":"501", "y":"41", "h":"121", "x":"51" } }, { "action":"delete", "description":"Delete a section", "path":"$.state.widgets.chart_2" } ] } ] ``` The corresponding `dashboardOne.json` file that uses the above rules files looks like: ```nolang {    "_type": "dashboardTemplate",    "name": "Dashboard From Template With Rules",    "edgemarts": {        "${Variables.Dataset1.datasetAlias}": {            "_type": "edgemart",            "_uid": "${Variables.Dataset1.datasetId}"        },        "${Variables.Dataset2.datasetAlias}": {            "_type": "edgemart",            "_uid": "${Variables.Dataset2.datasetId}"        }    },    "folder": {        "_type": "folder",        "_uid": "${App.Folder.Id}"    },    "tags": [    ],    "state": {        "widgets": {            "chart_1": {                "params": {                    "chartType": "${Constants.ChartType}",                    "minColumnWidth": 30,                    "maxColumnWidth": 200,                    "legend": false,                    "selectMode": "single",                    "sqrt": false,                    "legendHideHeader": false,                    "legendWidth": 145,                    "step": "step_1"                },                "type": "ChartWidget",                "pos": {                    "w": "500",                    "y": 60,                    "h": "120",                    "x": 40                }            },            "chart_2": {                "params": {                    "chartType": "${Constants.ChartType}",                    "minColumnWidth": 30,                    "maxColumnWidth": 200,                    "legend": false,                    "selectMode": "single",                    "sqrt": false,                    "legendHideHeader": false,                    "legendWidth": 145,                    "step": "step_2"                },                "type": "ChartWidget",data                "pos": {                    "w": "500",                    "y": 190,                    "h": "120",                    "x": 40                }            }        },        "steps": {            "step_1": {                "isFacet": true,                "start": null,                "query": {                    "measures": [                        [                            "count",                            "*"                        ]                    ]                },                "selectMode": "single",                "useGlobal": true,                "em": "${Variables.Dataset1.datasetId}",                "type": "aggregate",                "isGlobal": false            },            "step_2": {                "isFacet": true,                "start": null,                "query": {                    "measures": [                        [                            "count",                            "*"                        ]                    ]                },                "selectMode": "single",                "useGlobal": true,                "em": "${Variables.Dataset2.datasetId}",                "type": "aggregate",                "isGlobal": false            }        },        "type": "hbar"    } } ``` When the rules are applied to the dashboard, the `chart_1` widget will have a chartType of “pie” and the “pos” will be updated to w=501, y=41, h=121, and x=51. The `chart_2` widget will be removed. # `rules.json` Syntax This page describes the JSON syntax for defining rule objects used in `template-to-app-rules.json` and `app-to-template-rules.json`. For background on how rules fit into the App Template Framework, see [Work with App Template Framework Rules](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-overview.md). The `rules` object can contain any number of `rule` objects. A `rule` object is made up of: | Attribute | Type | Example | Required | Notes | | --------- | ---- | ------- | -------- | ----- | | `name` | String | `"name": "ruleName"` | Yes | An identifier for the rule. | | `condition` | String | `"condition": "${Variables.foo == 'Yes'}"` | No | Use Freemarker conditions to apply the rules. Use the same syntax as `conditions` used in `template-info.json`. | | `appliesTo` | Array | `"appliesTo": [{"type": "dashboard", "name": "*"}]` | Yes | Use `"type": "*"` to apply to all JSON assets. Other valid values are `dashboard`, `lens`, `workflow`, `schema`, and `xmd`. Use the `name` string to reference specific JSON assets. The `name` can take `*` as well, to apply to all of one asset type or a group of one asset type. | | `description` | String | `"description": "This rule adds strings to an array."` | No | Use this to explain what the rule is doing. | | `actions` | Array | `"action": "set"` | Yes | There are six supported action types: `add`, `put`, `set`, `delete`, `eval`, and `replace`. Define as many actions as needed in the array. | ## Rule Example with `appliesTo` Value ```json { "name": "myRuleForWorkflowNodeDelete", "appliesTo": [ { "type": "workflow", "name": "*" } ], "actions": [ { "action": "delete", "description": "delete node from workflow", "path": "$.workflowDefinition.nodeName" } ] } ``` ## Actions Syntax for Rules | Action | Notes | | --------- | ----- | | `add` | Adds an entry to an existing array. Needs `index` and `value`. `index` is 0 for the first element in the array, any number after that for the middle of the array. If `index` is larger than the array size, this action adds the `value` to the end of the array. | | `put` | Add an attribute and value to an existing JSON value. Needs `key` and `value`. `value` can be a string or an array. | | `set` | Set a value on an existing JSON attribute. Needs `value`. | | `delete` | Remove a node in the existing JSON tree. | | `eval` | Evaluate the expression specified in `value` and assign results to the context variable specified by `key` (if set). Context attribute can be referenced using the expression: `${Rules.Eval.}`. The scope of the `eval` variable is the entire document if performed in a rule, or the macro if performed within a macro. | | `replace` | Replace any text string throughout the entire document. Use when regular expressions are not an option. Can still use expressions. Instead of using the `replace` action, you can perform targeted search and replace (JSON Path) with `${string:replace(...)}`. In cases requiring regular expressions, use `${string:replaceFirst(...)}`, `${string:replaceAll(...)}`.| ### Example `add` Action ```json { "action": "add", "description" : "Add desc", "path": "$.json.path.to.existing.json,array", "index": 0, "value": "value to add" } ``` ### Example `put` Action ```json { "action": "put", "description" : "Put desc", "path": "$.json.path.to.existing.json", "key": "jsonAttributeName", "value": "new value" } ``` ### Example `set` Action ```json { "action": "set", "description" : "Set desc", "path": "$.json.path.to.attribute", "value": "setValue" } ``` ### Example `delete` Action ```json { "action": "delete", "description" : "Delete desc", "path": "$.json.path.to.delete" } ``` ### Example `eval` Action The `eval` action retrieves the `sayHello` macro result and then the `set` action uses the result to set a value in a JSON path. ```json [ { "action": "eval", "description": "Evaluate the sayHello macro", "key": "helloResult", "value": "${myMacros:sayHello('Hello')}" }, { "action": "set", "path": "$.path.json.node", "value": "${Rules.Eval.helloResult}" } ] ``` ### Example `replace` Action ```json { "action": "replace", "description": "Replace the amount field value", "key": "RPLCM_Opportunity_Amount_Field", "value": "${Variables.Opportunity_Amount.fieldName}" } ``` **See Also** - [Work with App Template Framework Rules](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-overview.md) - [`rules.json` Attributes](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-json-attributes.md) # Run Reports Synchronously or Asynchronously Get summary data with or without details by running a report synchronously or asynchronously through the API. When you run a report, the API returns data for the same number of records that are available when the report is run in the Salesforce user interface. Run a report synchronously if you expect it to finish running quickly. Otherwise, we recommend that you run reports through the API asynchronously for these reasons: - Long running reports have a lower risk of reaching the timeout limit when run asynchronously. - The 2-minute overall Salesforce API timeout limit doesn’t apply to asynchronous runs. - The Salesforce Reports and Dashboards REST API can handle a higher number of asynchronous run requests at a time. - Since the results of an asynchronously run report are stored for a 24-hr rolling period, they’re available for recurring access. To run a report synchronously: - Send a GET or POST request to the Execute Sync resource to get data. - Use a POST request to get specific results on the fly by passing dynamic filters, groupings, and aggregates in the report metadata. To fetch report data asynchronously: 1. Send a POST request to the Execute Async resource. If you’re passing filters, include them in the POST request metadata. The request returns the instance ID where results of the run are stored. 2. Send a GET request to the Instance Results resource to fetch data using the instance ID. ## Example of a synchronous report run This GET request to the Execute Sync resource, `/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK?includeDetails=true`, for a synchronous run returns summary data with details. ```nolang { "attributes" : { "describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/describe", "instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances", "reportId" : "00OR0000000K2UeMAK", "reportName" : "Deals Closing This Quarter", "type" : "Report" }, "allData" : true, "factMap" : { "2!0_0" : { "aggregates" : [ { "label" : "$16,000.01", "value" : 16000.010000000000218278728425502777099609375 }, { "label" : "$16,000.01", "value" : 16000.010000000000218278728425502777099609375 }, { "label" : "1", "value" : 1 } ], "rows" : [ { "dataCells" : [ { "label" : "Acme - 200 Widgets", "value" : "006R00000023IDYIA2" }, { "label" : "$16,000.01", "value" : { "amount" : 16000.01, "currency" : null } }, { "label" : "Word of mouth", "value" : "Word of mouth" }, { "label" : "Need estimate", "value" : "Need estimate" }, { "label" : "60%", "value" : 60}, { "label" : "Q3-2015", "value" : "Q3-2015" }, { "label" : "12", "value" : 12 }, { "label" : "7/31/2015", "value" : "2015-07-31" }, { "label" : "Fred Wiliamson", "value" : "005R0000000Hv5rIAC" }, { "label" : "-", "value" : null } ] } ] }, "T!0" : { "aggregates" : [ { "label" : "$32,021.01", "value" : 32021.00999999999839928932487964630126953125 }, { "label" : "$16,010.51", "value" : 16010.504999999999199644662439823150634765625 }, { "label" : "2", "value" : 2 } ], "rows" : [ ] }, ... "T!T" : { "aggregates" : [ { "label" : "$153,042.01", "value" : 153042.01000000000931322574615478515625 }, { "label" : "$25,507.00", "value" : 25507.00166666666700621135532855987548828125 }, { "label" : "6", "value" : 6 } ], "rows" : [ ] }, ... "groupingsAcross" : { "groupings" : [ { "groupings" : [ { "groupings" : [ ], "key" : "0_0", "label" : "Existing Business", "value" : "Existing Business" } ], "key" : "0", "label" : "July 2015", "value" : "2015-07-01" }, { "groupings" : [ { "groupings" : [ ], "key" : "1_0", "label" : "Existing Business", "value" : "Existing Business" }, { "groupings" : [ ], "key" : "1_1", "label" : "New Business", "value" : "New Business" } ], "key" : "1", "label" : "August 2015", "value" : "2015-08-01" }, { "groupings" : [ { "groupings" : [ ], "key" : "2_0", "label" : "Existing Business", "value" : "Existing Business" } ], "key" : "2", "label" : "September 2015", "value" : "2015-09-01" } ] }, "groupingsDown" : { "groupings" : [ { "groupings" : [ ], "key" : "0", "label" : "Acme", "value" : "001R0000002GuzsIAC" }, { "groupings" : [ ], "key" : "1", "label" : "Facebook", "value" : "001R0000001nUAmIAM" }, { "groupings" : [ ], "key" : "2", "label" : "Home Depot", "value" : "001R0000002Gv5zIAC" }, { "groupings" : [ ], "key" : "3", "label" : "Mircosoft", "value" : "001R0000002Gv5QIAS" } ] }, "hasDetailRows" : true, "reportExtendedMetadata" : { "aggregateColumnInfo" : { "s!AMOUNT" : { "acrossGroupingContext" : null, "dataType" : "currency", "downGroupingContext" : null, "label" : "Sum of Amount" }, "a!AMOUNT" : { "acrossGroupingContext" : null, "dataType" : "currency", "downGroupingContext" : null, "label" : "Average Amount" }, "RowCount" : { "acrossGroupingContext" : null, "dataType" : "int", "downGroupingContext" : null, "label" : "Record Count" } }, "detailColumnInfo" : { "OPPORTUNITY_NAME" : { "dataType" : "string", "label" : "Opportunity Name" }, "AMOUNT" : { "dataType" : "currency", "label" : "Amount" }, "LEAD_SOURCE" : { "dataType" : "picklist", "label" : "Lead Source" }, "NEXT_STEP" : { "dataType" : "string", "label" : "Next Step" }, "PROBABILITY" : { "dataType" : "percent", "label" : "Probability (%)" }, "FISCAL_QUARTER" : { "dataType" : "string", "label" : "Fiscal Period" }, "AGE" : { "dataType" : "int", "label" : "Age" }, "CREATED_DATE" : { "dataType" : "datetime", "label" : "Created Date" }, "FULL_NAME" : { "dataType" : "string", "label" : "Opportunity Owner" }, "ROLLUP_DESCRIPTION" : { "dataType" : "string", "label" : "Owner Role" } }, "groupingColumnInfo" : { "ACCOUNT_NAME" : { "dataType" : "string", "groupingLevel" : 0, "label" : "Account Name" }, "CLOSE_DATE" : { "dataType" : "date", "groupingLevel" : 0, "label" : "Close Date" }, "TYPE" : { "dataType" : "picklist", "groupingLevel" : 1, "label" : "Type" } } }, "reportMetadata" : { "aggregates" : [ "s!AMOUNT", "a!AMOUNT", "RowCount" ], "chart" : { "chartType" : "Donut", "groupings" : [ "CLOSE_DATE" ], "hasLegend" : true, "showChartValues" : false, "summaries" : [ "s!AMOUNT" ], "summaryAxisLocations" : [ "Y" ], "title" : "Pipeline by Stage and Type" }, "currency" : null, "description" : null, "detailColumns" : [ "OPPORTUNITY_NAME", "AMOUNT", "LEAD_SOURCE","NEXT_STEP", "PROBABILITY", "FISCAL_QUARTER", "AGE", "CREATED_DATE", "FULL_NAME", "ROLLUP_DESCRIPTION" ], "developerName" : "Deals_Closing_This_Quarter", "division" : null, "folderId" : "00lR0000000M8IiIAK", "groupingsAcross" : [ { "dateGranularity" : "Month", "name" : "CLOSE_DATE", "sortAggregate" : null, "sortOrder" : "Asc"}, { "dateGranularity" : "None", "name" : "TYPE", "sortAggregate" : null, "sortOrder" : "Asc" } ], "groupingsDown" : [ { "dateGranularity" : "None", "name" : "ACCOUNT_NAME", "sortAggregate" : null, "sortOrder" : "Asc" } ], "hasDetailRows" : true, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OR0000000K2UeMAK", "name" : "Deals Closing This Quarter", "reportBooleanFilter" : null, "reportFilters" : [ { "column" : "BucketField_36625466", "isRunPageEditable" : true, "operator" : "equals", "value" : "Early,Late" }, { "column" : "TYPE", "isRunPageEditable" : true, "operator" : "equals", "value" : "Existing Business,New Business" } ], "reportFormat" : "MATRIX", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "THIS_FISCAL_QUARTER", "endDate" : "2015-09-30", "startDate" : "2015-07-01" }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ] } } ``` ## Example of an asynchronous report run 1. This is a POST request (an empty request body), `/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances`, to the Execute Async resource for an asynchronous run requesting summary results. ```nolang {} ``` The response to the POST request returns the instance handle that stores the summary results of the run. ```nolang { "completionDate" : null, "hasDetailRows" : true, "id" : "0LGR00000000He3OAE", "ownerId" : "005R0000000Hv5rIAC", "queryable" : false, "requestDate" : "2015-08-12T16:05:43Z", "status" : "New", "url" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances/0LGR00000000He3OAE" } ``` 2. A GET request, `/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances/0LGR00000000He3OAE`, to the Instance Results resource for the instance handle fetches the report results. ```nolang { "attributes" : { "completionDate" : "2015-08-12T16:05:44Z", "id" : "0LGR00000000He3OAE", "ownerId" : "005R0000000Hv5rIAC", "queryable" : false, "reportId" : "00OR0000000K2UeMAK", "reportName" : "Deals Closing This Quarter", "requestDate" : "2015-08-12T16:05:43Z", "status" : "Success", "type" : "ReportInstance" }, "allData" : true, "factMap" : { "2!0_0" : { "aggregates" : [ { "label" : "$16,000.01", "value" : 16000.010000000000218278728425502777099609375 }, { "label" : "$16,000.01", "value" : 16000.010000000000218278728425502777099609375 }, { "label" : "1", "value" : 1 } ], "rows" : [ { "dataCells" : [ { "label" : "Acme - 200 Widgets", "value" : "006R00000023IDYIA2" }, { "label" : "$16,000.01", "value" : { "amount" : 16000.01, "currency" : null } }, { "label" : "Word of mouth", "value" : "Word of mouth" }, { "label" : "Need estimate", "value" : "Need estimate" }, { "label" : "60%", "value" : 60 }, { "label" : "Q3-2015", "value" : "Q3-2015" }, { "label" : "12", "value" : 12 }, { "label" : "7/31/2015", "value" : "2015-07-31" }, { "label" : "Fred Wiliamson", "value" : "005R0000000Hv5rIAC" }, { "label" : "-", "value" : null } ] } ] }, ... "groupingsAcross" : { "groupings" : [ ... ] }, "groupingsDown" : { "groupings" : [ ... ] }, "hasDetailRows" : true, "reportExtendedMetadata" : { "aggregateColumnInfo" : { "s!AMOUNT" : { "acrossGroupingContext" : null, "dataType" : "currency", "downGroupingContext" : null, "label" : "Sum of Amount" }, "a!AMOUNT" : { "acrossGroupingContext" : null, "dataType" : "currency", "downGroupingContext" : null, "label" : "Average Amount" }, "RowCount" : { "acrossGroupingContext" : null, "dataType" : "int", "downGroupingContext" : null, "label" : "Record Count" } }, "detailColumnInfo" : { "OPPORTUNITY_NAME" : { "dataType" : "string", "label" : "Opportunity Name" }, "AMOUNT" : { "dataType" : "currency", "label" : "Amount"}, "LEAD_SOURCE" : { "dataType" : "picklist", "label" : "Lead Source" }, "NEXT_STEP" : { "dataType" : "string", "label" : "Next Step" }, "PROBABILITY" : { "dataType" : "percent", "label" : "Probability (%)" }, "FISCAL_QUARTER" : { "dataType" : "string", "label" : "Fiscal Period" }, "AGE" : { "dataType" : "int", "label" : "Age" }, "CREATED_DATE" : { "dataType" : "datetime", "label" : "Created Date" }, "FULL_NAME" : { "dataType" : "string", "label" : "Opportunity Owner" }, "ROLLUP_DESCRIPTION" : { "dataType" : "string", "label" : "Owner Role" } }, "groupingColumnInfo" : { "ACCOUNT_NAME" : { "dataType" : "string", "groupingLevel" : 0, "label" : "Account Name" }, "CLOSE_DATE" : { "dataType" : "date", "groupingLevel" : 0, "label" : "Close Date" }, "TYPE" : { "dataType" : "picklist", "groupingLevel" : 1, "label" : "Type" }} }, "reportMetadata" : { "aggregates" : [ "s!AMOUNT", "a!AMOUNT", "RowCount" ], "chart" : { "chartType" : "Donut", "groupings" : [ "CLOSE_DATE" ], "hasLegend" : true, "showChartValues" : false, "summaries" : [ "s!AMOUNT" ], "summaryAxisLocations" : [ "Y" ], "title" : "Pipeline by Stage and Type" }, "currency" : null, "description" : null, "detailColumns" : [ "OPPORTUNITY_NAME", "AMOUNT", "LEAD_SOURCE", "NEXT_STEP", "PROBABILITY", "FISCAL_QUARTER", "AGE", "CREATED_DATE", "FULL_NAME", "ROLLUP_DESCRIPTION" ], "developerName" : "Deals_Closing_This_Quarter", "division" : null, "folderId" : "00lR0000000M8IiIAK", "groupingsAcross" : [ { "dateGranularity" : "Month", "name" : "CLOSE_DATE", "sortAggregate" : null, "sortOrder" : "Asc" }, { "dateGranularity" : "None", "name" : "TYPE", "sortAggregate" : null, "sortOrder" : "Asc" } ], "groupingsDown" : [ { "dateGranularity" : "None", "name" : "ACCOUNT_NAME", "sortAggregate" : null, "sortOrder" : "Asc" } ], "hasDetailRows" : true, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OR0000000K2UeMAK", "name" : "Deals Closing This Quarter", "reportBooleanFilter" : null, "reportFilters" : [ { "column" : "BucketField_36625466", "isRunPageEditable" : false, "operator" : "equals", "value" : "Early,Late" }, { "column" : "TYPE", "isRunPageEditable" : false, "operator" : "equals", "value" : "Existing Business,New Business" } ], "reportFormat" : "MATRIX", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "THIS_FISCAL_QUARTER", "endDate" : "2015-09-30", "startDate" : "2015-07-01" }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ] } } ``` **See Also** - [Execute Sync](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-getreportrundata.md) - [Instances List](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-instances-resource.md) - [Instance Results](https://developer.salesforce.com/docs/analytics/reference/reports/sforce-analytics-rest-api-instance-resource-results.md) # Salesforce Analytics CLI Plugin Command Reference The command reference contains information about the Salesforce CLI commands for the Analytics plugin and their flags. The `sf` section contains information about the `sf`-style commands, which became generally available in July 2023. The `sfdx` section contains information about the `sfdx`-style commands, which are deprecated. We no longer maintain the `sfdx` information and keep it in this guide for historical reference only. See this [developer blog post](https://developer.salesforce.com/blogs/2023/07/salesforce-cli-sf-v2-is-here) for more information about Salesforce CLI `sf` (v2). ## Getting Started The Analytics plug-in commands perform Analytics related actions, like creating apps and updating templates, in your target org. You must be authenticated into your scratch org from a generated project for the Analytics plug-in commands to work. Create a project: ```nolang sf project generate --name MyAnalyticsWork ``` Create a Developer edition scratch org using your default dev hub and give the scratch org an alias: ```nolang sf org create scratch --edition developer --alias my-scratch-org ``` Set the target org default for all `sf` commands: ```nolang sf config set target-org my-scratch-org ``` Open your scratch org: ```nolang sf org open [-o my-scratch-org] ``` View the help for analytics commands: ```nolang sf analytics --help ``` For information about installing the Salesforce CLI, see the [Salesforce DX Setup Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm). For information about installing the Analytics CLI plugin, see [Install the Analytics CLI Plugin](https://help.salesforce.com/articleView?id=bi_cli_analytics_plugin_install.htm). For information about Salesforce CLI changes, see the [Salesforce CLI Release Notes](https://developer.salesforce.com/media/salesforce-cli/releasenotes.html). - **[sf](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/sf/bi-cli-reference-analytics-unified.md)** This section contains information about the `sf` commands for the `analytics` plug-in. - **[sfdx (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/bi-cli-reference-analytics.md)** This section contains information about the deprecated `sfdx`-style commands for the `analytics` plug-in. - **[Help for Salesforce CLI Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/bi-cli-reference-help.md)** The `-h` | `--help` parameter shows details about Salesforce CLI topics and their commands. - **[CLI Deprecation Policy](https://developer.salesforce.com/docs/guides/sfdx-dev/workspace-setup/sfdx-dev-cli-deprecation.md)** Salesforce deprecates CLI commands and flags when, for example, the underlying API changes. # Salesforce Orchestrator App Commands A comprehensive list of all Orchestrator `app` commands available in the Salesforce CLI. **Global Flags** | Flag | Type | Required | Description | |------|------|----------|-------------| | `--flags-dir=` | option | No | Import flag values from a directory. | | `--json` | boolean | No | Format output as json. | ## orchestrator app create Create a new orchestrated app using an existing template as the foundation. The app is initialized with the configuration, structure, and settings defined in the template, providing a quick start for app development. You can identify the template to use by either its unique ID or its name. Template IDs are guaranteed to be unique, while template names should be unique within an org. The new app inherits the template's configuration, but can be customized independently after creation. Use this command to quickly create apps with consistent configurations and accelerate your development workflow. The created app assets appear in Data 360 and Tableau Next where you can customize as needed. You can manage the app from the App Install History page in Setup. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkManageApp` user permission to create apps. Both the template and the new app must be in the same org. ### Usage `$ sf orchestrator app create -o -n [--json] [--flags-dir ] [--api-version ] [-l ] [-d ] [-i | -t ] [-r sync|async] [-g debug|info|warn|error]` ### Examples ```bash # Create an app from a template by ID: $ sf orchestrator app create --target-org myOrg --name "my_app" --template-id 01t000000000123 # Create an app from a template by name: $ sf orchestrator app create --target-org myOrg --name "sales_app" --template-name "Sales_Template" # Create an app with a custom label and description: $ sf orchestrator app create --target-org myOrg --name "analytics_app" --template-name "Analytics_Template" --label "My Analytics App" --description "Custom analytics app" # Create an app with specific runtime configuration: $ sf orchestrator app create --target-org myOrg --name "dashboard_app" --template-id 01t000000000456 --runtime-method async --log-level debug # Create an app using a specific API version: $ sf orchestrator app create --target-org mySandbox --name "test_app" --template-name "Test Template" --api-version 60.0 ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for creating the app. This org must have Data 360 and Tableau Next enabled, and you must have the `AppFrameworkManageApp` user permission to create apps. The template must also exist in this org. | | `--name`, `-n` | option | Yes | A unique identifier for the app. Must be unique within your org. Use descriptive names that help identify the app's purpose. App names should follow your org's naming conventions. | | `--template-id`, `-i` | option | * | The unique identifier of the template to use for generating the new app. | | `--label`, `-l` | option | No | A human-readable label for the app. This is displayed on the App Install History setup page and helps users identify the app's purpose. If not provided, the name is used as the label. | | `--description`, `-d` | option | No | A description of what the app does and its intended use case. This helps users understand the app's purpose and functionality. The description appears on the App Install History page. | | `--runtime-method`, `-r` | option | No | Specifies the runtime method for the app execution. This affects how the app processes data and handles user interactions. Valid values are `sync` and `async`. | | `--log-level`, `-g` | option | No | Sets the logging level for the app. This controls how much diagnostic information is captured during app execution. Valid values are `debug`, `info`, `warn`, and `error`. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | *Either `--template-id` or `--template-name` is required. --- ## orchestrator app delete Delete an orchestrated app from your org. You can identify the app to delete by either its unique ID or its name. App IDs are guaranteed to be unique, while app names should be unique within an org. The command prompts for confirmation before deletion unless you use the `--no-prompt` flag. Deleting an app removes it Tableau Next and makes it unavailable to users. Any dashboards, visualizations, data assets, or other components that depend on this app may be affected. Consider the impact on your users and any dependent systems before proceeding. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkManageApp` user permission to delete apps. You can only delete apps that exist in the target org. ### Usage `$ sf orchestrator app delete -o [--json] [--flags-dir ] [--api-version ] [-i | -n ] [-p]` ### Examples ```bash # Delete an app by ID with confirmation prompt: $ sf orchestrator app delete --target-org myOrg --app-id 01t000000000123 # Delete an app by name with confirmation prompt: $ sf orchestrator app delete --target-org myOrg --app-name "My App" # Delete an app without confirmation prompt: $ sf orchestrator app delete --target-org myOrg --app-id 01t000000000123 --no-prompt # Delete an app with a name containing spaces: $ sf orchestrator app delete --target-org myOrg --app-name "Sales Analytics App" # Delete an app in a specific org with API version: $ sf orchestrator app delete --target-org mySandbox --app-id 01t000000000123 --api-version 60.0 ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for deleting the app. This org must have Data 360 and Tableau Next enabled, and you must have the `AppFrameworkManageApp` user permission to delete apps. The app must exist in this org. | | `--app-id`, `-i` | option | * | The unique identifier of the app to delete. | | `--app-name`, `-n` | option | * | The name of the app to delete. | | `--no-prompt`, `-p` | boolean | No | Skip the confirmation prompt before deleting the app. Use this flag carefully, especially in scripts or automation, as app deletion can't be undone. This flag is useful for CI/CD pipelines and automated processes. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | *Either `--app-id` or `--app-name` is required. --- ## orchestrator:app:display Display comprehensive information about a specific orchestrated app including its name, label, ID, type, template association, creation details, and configuration properties. Use this command to inspect apps to understand their current state, template relationships, and configuration settings. You can identify the app by either its unique ID or its name. App IDs are guaranteed to be unique, while app names should be unique within an org. The command displays all available app properties in a formatted, easy-to-read layout. App information helps you understand the app's current configuration, its template relationship, and any runtime settings that may be applied. This is particularly useful before making updates, troubleshooting issues, or understanding app dependencies. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkViewApp` user permission to view apps. ### Usage `$ sf orchestrator app display -o [--json] [--flags-dir ] [--api-version ] [-i | -n ]` ### Examples ```bash # Display an app using its ID: $ sf orchestrator app display --target-org myOrg --app-id 01t000000000123 # Display an app using its name: $ sf orchestrator app display --target-org myOrg --app-name "My App" # Display an app with a name that contains spaces: $ sf orchestrator app display --target-org myOrg --app-name "Sales Analytics App" # Display an app in a specific org using a particular API version: $ sf orchestrator app display --target-org mySandbox --app-id 01t000000000456 --api-version 60.0 # Display an app by name in your default org: $ sf orchestrator app display --app-name "dashboard_app" ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for displaying the app. This org must have Data 360 and Tableau Next enabled, and you must have the `AppFrameworkViewApp` user permission to view apps. The app must also exist in this org | | `--app-id`, `-i` | option | * | The unique identifier of the app to display. | | `--app-name`, `-n` | option | * | The name of the app to display. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | *Either `--app-id` or `--app-name` is required. --- ## orchestrator app list List all orchestrated apps in your org with their key information including name, label, ID, type, and associated template details. This command helps you discover and manage existing apps in your organization. Apps are displayed in a table format showing their current status, creation details, and template associations. Use this information to understand your app inventory and make informed decisions about app management. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkViewApp` user permission to view apps. This command works with production orgs, sandboxes, and scratch orgs. ### Usage `$ sf orchestrator app list -o [--json] [--flags-dir ] [--api-version ]` ### Examples ```bash # List all orchestrated apps in your default org: $ sf orchestrator app list # List apps in a specific org: $ sf orchestrator app list --target-org myOrg # List apps using a specific API version: $ sf orchestrator app list --api-version 64.0 # List apps in a sandbox org with specific API version: $ sf orchestrator app list --target-org mySandbox --api-version 60.0 ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for listing apps. This org must have Data 360 and Tableau Next enabled, and you must have the `AppFrameworkViewApp` user permission to view apps. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | --- ## orchestrator app update Update an existing orchestrated app's label and description. This command allows you to modify the display properties of an app without changing its underlying template or functionality. You can identify the app by either its unique ID or its name. App IDs are guaranteed to be unique, while names should be unique within an org. Use this command to update the human-readable display name (label) and description that users see when viewing the app. This is useful for improving app discoverability and providing clearer information about the app's purpose. You must have the `AppFrameworkManageApp` user permission to modify apps. ### Usage `$ sf orchestrator app update -o [--json] [--flags-dir ] [--api-version ] [-i | -n ] [-l ] [-d ]` ### Examples ```bash # Update an app's label: $ sf orchestrator app update --target-org myOrg --app-id 1zAxx000000000123 --label "Updated App Label" # Update an app's description: $ sf orchestrator app update --target-org myOrg --app-name "My App" --description "Updated description for the app" # Update both label and description: $ sf orchestrator app update --target-org myOrg --app-id 1zAxx000000000123 --label "Updated App" --description "Updated description for the app" # Update an app using a specific API version: $ sf orchestrator app update --target-org mySandbox --app-id 1zAxx000000000123 --label "New Label" --api-version 65.0 ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for listing apps. This org must have Data 360 and Tableau Next enabled, and you must have the `AppFrameworkManageApp` user permission to view apps. | | `--app-id`, `-i` | option | * | The unique identifier of the app to update. | | `--app-name`, `-n` | option | * | The name of the app to update. | | `--label`, `-l` | option | No | A new display label for the app. This is the human-readable name shown to users on the App Install History page. The label helps users identify and select the appropriate app. Use clear, descriptive labels that explain the app's purpose. | | `--description`, `-d` | option | No | A new description for the app. This provides detailed information about the app's purpose, features, and intended use cases. The description appears on the App Install History page and helps users understand when and how to use the app effectively | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | *Either `--app-id` or `--app-name` is required. # Salesforce Orchestrator Commands An overview of the Orchestrator commands available in the Salesforce CLI. ## Global Flags All commands support these global flags: | Flag | Type | Description | |------|------|-------------| | `--json` | boolean | Format output as json. | | `--flags-dir` | option | Import flag values from a directory. | ## Command Format All commands use the space-separated format in the current SF CLI: [**App Commands**](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/orchestrator_app_commands.md) - `sf orchestrator app create` - `sf orchestrator app delete` - `sf orchestrator app display` - `sf orchestrator app list` - `sf orchestrator app update` [**Template Commands**](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/orchestrator_template_commands.md) - `sf orchestrator template create` - `sf orchestrator template delete` - `sf orchestrator template display` - `sf orchestrator template list` - `sf orchestrator template update` **Note:** The colon-separated format (e.g., `orchestrator:app:create`) is not supported in the current SF CLI. ## Plugin Information - **Plugin Name:** @salesforce/plugin-orchestrator - **Plugin Type:** core - **Version:** 1.0.0 - **State:** preview (all commands) - **ESM:** true (all commands) - **JSON Flag Support:** true (all commands) # Salesforce Orchestrator Template Commands A comprehensive list of all Orchestrator `template` commands available in the Salesforce CLI. **Global Flags** | Flag | Type | Required | Description | |------|------|----------|-------------| | `--flags-dir=` | option | No | Import flag values from a directory. | | `--json` | boolean | No | Format output as json. | ## orchestrator template create Create a new template that can be used as a blueprint for building orchestrated apps. Templates allow you to define reusable configurations, layouts, and settings that can be shared across multiple apps. Once created, templates appear in Tableau Next where users can use them to create new apps. Templates help standardize app development and ensure consistency across your org. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkManageApp` user permission to create templates. The template name must be unique within your org. This command works with production orgs, sandboxes, and scratch orgs that have orchestrated apps configured. ### Usage `$ sf orchestrator template create -o -n [--json] [--flags-dir ] [--api-version ] [-t app|component|dashboard|lens] [-s ] [-l ] [-d ]` ### Examples ```bash # Create a basic app template: sf orchestrator template create --target-org myOrg --name "my_template" # Create a template with a label for better identification: sf orchestrator template create --target-org myOrg --name "sales_template" --type app --label "Sales Analytics Template" # Create a dashboard template with a specific subtype: sf orchestrator template create --target-org myOrg --name "dashboard_template" --type dashboard --subtype "analytics" # Create a comprehensive template with all metadata: sf orchestrator template create --target-org myOrg --name "analytics_template" --type app --subtype "tableau" --label "Sales Template" --description "Template for sales analytics apps" # create a template using a specific API version: sf orchestrator template create --target-org myOrg --name "legacy_template" --api-version 65.0 ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for creating the template. This org must have Data 360 and Tableau Next enabled, and you must have the `AppFrameworkManageApp` user permission to create templates. | | `--name`, `-n` | option | Yes | A unique identifier for the template. Must be unique within your org. Use descriptive names that help identify the template's purpose. Template names should follow your org's naming conventions | | `--type`, `-t` | option | No | Specifies the type of template to create. Valid values are `app`, `component`, `dashboard`, `lens`. Defaults to `app` if not specified. Choose the type that matches your intended use case for the template. | | `--subtype`, `-s` | option | No | An optional subtype categorization for the template (e.g., `tableau` for app templates). Subtypes help organize templates and provide additional context about their intended use or underlying technology.. | | `--label`, `-l` | option | No | A human-readable label for the template. This is displayed in Tableau Next and helps users identify the template's purpose. Use clear, descriptive labels that explain what the template does. | | `--description`, `-d` | option | No | A description of what the template does and its intended use case. This is displayed in Tableau Next and helps users understand when to use this template. Include information about the template's purpose, features, and any prerequisites. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | --- ## orchestrator template delete Delete a template from your org. This command provides several options for handling apps that were created from the template. By default, when you delete a template, any apps created from it remain in your org but lose their association with the template. You can also choose to force delete both the template and all associated apps, or decouple apps before deletion to ensure they continue functioning independently. This is a destructive operation that can't be undone. The command prompts for confirmation unless you use the `--no-prompt` flag. Consider carefully which deletion strategy best fits your needs before proceeding. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkManageApp` user permission to delete templates. You can only delete templates that exist in the target org. ### Usage `$ sf orchestrator template delete -o [--json] [--flags-dir ] [--api-version ] [-i | -n ] [-p]` ### Examples ```bash # Delete a template by ID (keeps associated apps): $ sf orchestrator template delete --target-org myOrg --template-id 0XtB000000001aXYAQ # Delete a template by name with confirmation prompt: $ sf orchestrator template delete --target-org myOrg --template-name "My Template" # Force delete template and all apps created from it: $ sf orchestrator template delete --target-org myOrg --template-id 0XtB000000001aXYAQ --force-delete # Delete template without confirmation prompt: $ sf orchestrator template delete --target-org myOrg --template-id 0XtB000000001aXYAQ --no-prompt # Decouple apps before deleting template: $ sf orchestrator template delete --target-org myOrg --template-name "Sales Template" --decouple #Delete template in specific org with API version: $ sf orchestrator template delete --target-org mySandbox --template-id 0XtB000000001aXYAQ --api-version 65.0 ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for deleting the template. This org must have Data 360 and Tableau Next enabled and you must have the `AppFrameworkManageApp` user permission to delete templates. The template must exist in this org. | | `--template-id`, `-i` | option | * | The unique identifier of the template to delete. Template IDs are guaranteed to be unique within an org. Use this flag when you know the template's ID, which you can get from "sf orchestrator template list" command. Either `--template-id` or `--template-name` is required. | | `--template-name`, `-n` | option | * | The name of the template to delete. Template names should be unique within an org. Use this flag when you know the template's name but not its ID. If the name contains spaces, enclose it in quotes. Either `--template-id` or `--template-name` is required. | | `--no-prompt`, `-p` | boolean | No | Skip the confirmation prompt before deleting the template. Use this flag carefully, especially in scripts or automation, as template deletion can't be undone. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | *Either `--template-id` or `--template-name` is required. --- ## orchestrator template display Display comprehensive information about a specific template including its name, label, ID, type, subtype, description, and other metadata properties. Use this command to inspect templates before using them to create apps or for understanding template configurations. You can identify a template by either its unique ID or its name. Template IDs are guaranteed to be unique, while template names should be unique within an org. The command displays all available template properties in a formatted, easy-to-read layout. Template information helps you understand what the template provides, its intended use case, and how to use it effectively when creating orchestrated apps. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkViewApp` user permission to view templates. ### Usage `$ sf orchestrator template display -o [--json] [--flags-dir ] [--api-version ] [-i | -n ]` ### Examples ```bash # Display a template using its ID: $ sf orchestrator template display --target-org myOrg --template-id 01RM0000000HwBGMA0 # Display a template using its name: $ sf orchestrator template display --target-org myOrg --template-name "MyTemplate" # Display a template with a name that contains spaces: $ sf orchestrator template display --target-org myOrg --template-name "Sales Analytics Template" # Display a template in a specific org using a particular API version: $ sf orchestrator template display --target-org mySandbox --template-id 01RM0000000HwBGMA0 --api-version 60.0 # Display a template by name in your default org: $ sf orchestrator template display --template-name "dashboard_template" ``` #### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for displaying the template. This org must have Data 360 and Tableau Next enabled, and you must have the `AppFrameworkViewApp` user permission to view templates. The template must exist in this org. | | `--template-id`, `-i` | option | * | Specify the unique identifier of the template you want to display. Template IDs are guaranteed to be unique within an org. Use this flag when you know the template's ID, which you can get from `sf orchestrator template list` command. Either `--template-id` or `--template-name` is required. | | `--template-name`, `-n` | option | * | Specify the name of the template you want to display. Template names should be unique within an org. Use this flag when you know the template's name but not its ID. If the name contains spaces, enclose it in quotes. Either `--template-id` or `--template-name` is required. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | *Either `--template-id` or `--template-name` is required. --- ## orchestrator template list Templates are reusable configurations that define the structure and settings for creating orchestrated apps. Use this command to discover available templates in your org before creating new apps. Templates are displayed in a table format showing their name, label, ID, type, and other metadata. This information helps you choose the right template for your orchestrated app development. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkViewApp` user permission to view templates. This command works with production orgs, sandboxes, and scratch orgs. ### Usage `$ sf orchestrator template list -o [--json] [--flags-dir ] [--api-version ]` ### Examples ```bash # List all templates in your default org: $ sf orchestrator template list # List templates in a specific org: $ sf orchestrator template list --target-org myOrg # List templates using a specific API version: $ sf orchestrator template list --api-version 64.0 # List templates in a sandbox org with a specific API version: $ sf orchestrator template list --target-org mySandbox --api-version 60.0 ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for listing templates. This org must have Data 360 and Tableau Next enabled, and you must have the `AppFrameworkViewApp` user permission to view templates. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | --- ## orchestrator template update Update the metadata and properties of an existing template. Use this command to modify the template's label, description, and other properties to keep your templates current and well-documented. You can identify the template to update by either its unique ID or its name. Template IDs are guaranteed to be unique, while template names should be unique within an org. You can update one or more properties in a single command. Template updates are useful for maintaining accurate documentation, improving template discoverability, and ensuring templates remain relevant as your org's needs evolve. Updated templates immediately reflect changes in Tableau Next. You must have Data 360 and Tableau Next enabled in your org and the `AppFrameworkModifyApp` user permission to modify templates. You can only update templates that exist in the target org. ### Usage `$ sf orchestrator template update -o [--json] [--flags-dir ] [--api-version ] [-i | -n ] [-l ] [-d ]` ### Examples ```bash # Update a template's label by ID: $ sf orchestrator template update --target-org myOrg --template-id 0XtB000000001aXYAQ --label "New Display Label" # Update a template's description by name: $ sf orchestrator template update --target-org myOrg --template-name "MyTemplate" --description "Updated template description" # Update both label and description: $ sf orchestrator template update --target-org myOrg --template-id 0XtB000000001aXYAQ --label "Sales Analytics Template" --description "Template for comprehensive sales reporting and analytics" # Update a template in a specific org with API version: $ sf orchestrator template update --target-org mySandbox --template-name "Dashboard Template" --label "Executive Dashboard" --api-version 60.0 #Update a template with a name containing spaces: $ sf orchestrator template update --target-org myOrg --template-name "Sales Analytics Template" --description "Enhanced template for sales team analytics" ``` ### Flags | Flag | Type | Required | Description | |------|------|----------|-------------| | `--target-org`, `-o` | option | Yes | The target org to connect to for updating the template. This org must have Data Cloud and Tableau Next enabled, and you must have the `AppFrameworkManageApp` user permission to modify templates. The template must exist in this org. | | `--template-id`, `-i` | option | * | The unique identifier of the template to update. Template IDs are guaranteed to be unique within an org. Use this flag when you know the template's ID, which you can get from `sf orchestrator template list` command. Either `--template-id` or `--template-name` is required. | | `--template-name`, `-n` | option | * | The name of the template to update. Template names should be unique within an org. Use this flag when you know the template's name but not its ID. If the name contains spaces, enclose it in quotes. Either `--template-id` or `--template-name` is required. | | `--label`, `-l` | option | No | This is the human-readable name shown to users in Tableau Next. The label helps users identify and select the appropriate template when creating apps. | | `--description`, `-d` | option | No | The description appears in Tableau Next and helps users understand when and how to use the template effectively. | | `--api-version` | option | No | Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration. | *Either `--template-id` or `--template-name` is required. # Salesforce Reports and Dashboards REST API Developer Guide Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | --- | | 68.0 | Winter '27 | [Download PDF](https://resources.docs.salesforce.com/264/latest/en-us/sfdc/pdf/salesforce_analytics_rest_api.pdf) | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/salesforce_analytics_rest_api.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/salesforce_analytics_rest_api.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/salesforce_analytics_rest_api.pdf) | # sample Returns a random sample from a large dataset, where each data point has an equal probability of being selected. This keyword uses the Bernoulli distribution. ## Syntax ```nolang sample(percentage-size-of-dataset) repeatable(seed) ``` | Parameter | Description | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sample` | Required. Specifies the percentage of the dataset that is returned as a random sample. The percentage size value can be any positive decimal. | | `repeatable` | Optional. To create a random sample deterministically, specify a seed. `sample` returns the same subset of data each time you pass repeatable the same seed value. The seed value can be any positive integer. | ## Usage Use `sample` to project a query on a representative sample from your dataset, where each data point has an equal probability of being selected. `sample` runs pre-projection. Add `sample` and `repeatable` after the `load` statement. Any operation performed on the query after the `load` statement affects only the random sample of data. Let’s look at an example. ```nolang q = load "Opportunity" sample(10) repeatable(1); q = group q by all; q = foreach q generate count() as 'count'; q = limit q 2000; ``` | Count of Rows | | ------------- | | 453 | Here, the query returns the row count of the sample, 453—around 10% of the dataset's 4.6k rows. The `repeatable` keyword guarantees that the query always returns the same result. Without the `repeatable` keyword, the query returns a sample of a slightly different size each time you run it. If you modify your dataset and add more data, then `repeatable` doesn’t return the same result. ## group-by Example This query returns the counts of opportunities for each stage. Since the query operates on 10% of the dataset, the counts for each stage are approximately 1/10 of the original count. ```nolang q = load "Opportunity" sample(10) repeatable(1); q = group q by 'StageName'; q = foreach q generate 'StageName', count() as 'count'; q = limit q 2000; ``` | Stage | Count of Rows | | -------------------- | ------------- | | Closed Lost | 89 | | Closed Won | 254 | | Id. Decision Makers | 13 | | Needs Analysis | 15 | | Negotiation/Review | 6 | | Perception Analysis | 13 | | Proposal/Price Quote | 9 | | Prospecting | 10 | | Qualification | 25 | | Value Proposition | 19 | ## filter Example This query returns only the won opportunities for each stage. Since the query operates on 10% of the dataset, the count for each stage is approximately 1/10 of the original count. ```nolang q = load "Opportunity" sample(10); q = filter q by 'IsWon' == "true"; q = group q by 'StageName'; q = foreach q generate 'StageName', count() as 'count'; q = limit q 2000; ``` | Stage | Count of Rows | | ---------- | ------------- | | Closed Won | 275 | **See Also** - [Keywords](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-keywords.md) # SAQL Basic Elements Basic elements are the building blocks of your SAQL query. - **[Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statements.md)** A SAQL query loads input data, operates on it, and outputs the result data. A query is made up of statements. Each SAQL statement has an input stream, an operation, and an output stream. - **[Keywords](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-keywords.md)** Keywords are case-sensitive and must be lowercase. - **[Identifiers](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-identifiers.md)** SAQL identifiers are case-sensitive and must be enclosed in single quotation marks ('). - **[Number Literals](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-number-literals.md)** A number literal represents a number in your script. - **[String Literals](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-string-literals.md)** A string is a set of characters inside double quotes ("). - **[Boolean Literals](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-boolean-literals.md)** A boolean literal represents true or false (yes or no) in your script. - **[Multivalue Field](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-multivalue.md)** A multivalue field contains more than one value. - **[Quoted String Escape Sequences](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-quotedstringescapes.md)** Strings can be escaped with the backslash character. - **[Special Characters](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-special-characters.md)** Certain characters have special meanings in SAQL. - **[Comments](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-comments.md)** To add a single-line comment in SAQL, preface your comment with two hyphens (`--`). To add a multi-line comment, start your comment with a forward slash and asterisk (`/*`) and end it with an asterisk and forward slash (`*/`). # SAQL Functions Use functions to perform complex operations on your data. - **[Aggregate Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-aggregate.md)** Aggregate functions perform computations across all values of a grouped field. - **[Date Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-date.md)** Use SAQL date functions to perform time-based analysis. - **[Time Zone Date Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone.md)** When you enable the time zone feature, you can use the fields of the `DateTime` and `DateOnly` type to access date information in the specified time zone. For example, if a user in New York runs a SAQL query, they see date information displayed in Eastern Standard time. - **[Work with Custom Fiscal Year Data](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-cfy.md)** After inheriting custom fiscal years, SAQL queries support custom fiscal year data. - **[String Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-string.md)** Use SAQL string functions to format your measure and dimension fields. - **[Math Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-math.md)** To perform numeric operations in a SAQL query, use math functions. - **[Windowing Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-windowing.md)** Use SAQL windowing functionality to calculate common business cases such as percent of grand total, moving average, year and quarter growth, and ranking. - **[coalesce](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-coalesce.md)** Use `coalesce()` to get the first non-null value from a list of parameters, or to replace nulls with a different value. # SAQL Null Measures and Dimensions With CRM Analytics, you can use null measure handling to add null as the default value for numeric columns in datasets. Use null dimensions to return grouped null values from your SAQL queries. ## Measures With null measure handling, you can specify null as the default value for numeric columns in recipes, dataflows, and CSV uploads. When another default value isn’t specified for a numeric column, null measure handling allows CRM Analytics to replace a blank value with a null value. Null support in measures doesn’t require extra indexing. To enable this setting, from Setup, in the Quick Find box, enter `Analytics`, select **Settings**, and then select **Allow null measure handling in datasets**. If CRM Analytics was initially set up in your org after the Spring ’17 release, this setting is enabled by default and you can’t disable it. ## Dimensions You can include null dimensions in your datasets. When a record’s dimension or date field is left blank, it appears as a hyphen in explorer and dashboard designer charts and tables. Previously, SAQL queries were limited to non-null values. For non-grouping queries we return null keys regardless of whether the setting is enabled. This feature is distinct from the null handling for measures preference. To enable this setting, from Setup, in the Quick Find box, enter `Analytics`, select **Settings**, and then select **Include null values in CRM Analytics queries**. Then, refresh your datasets. To return grouped null values in your queries, select the null handling for dimensions preference in Setup. Here’s an example of using the SAQL group-by function with the null handling preference enabled. ```nolang q = load "Superstore"; q = group q by 'Sub_Category'; q = foreach q generate 'Sub_Category' as 'Sub_Category', count() as 'count'; q = order q by 'Sub_Category' asc nulls first; q = limit q 2000; ``` # SAQL Operators Use operators to perform mathematical calculations or comparisons. - **[Arithmetic Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-arithmetic.md)** Use arithmetic operators to perform addition, subtraction, multiplication, division, and modulo operations. - **[Comparison Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-comparison.md)** Use comparison operators to compare values of the same type. For example, you can compare strings with strings and numbers with numbers. - **[String Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-string.md)** To concatenate strings, use the plus sign (+). - **[Logical Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-logical.md)** Use logical operators to perform AND, OR, and NOT operations. - **[Simple case Operator](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-case.md)** Use `case` in a `foreach` statement to assign different field values in different situations. `case` supports two syntax forms: searched case and simple case. This section explains simple case. - **[Searched case Operator](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-casesearch.md)** Use `case` in a `foreach` statement to assign different field values in different situations. `case` supports two syntax forms: searched case and simple case. This section shows searched case. - **[Null Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-operators-null.md)** Use `is null` and `is not null` to check whether a value is or is not null. `is null` returns `True` when a value is null. `is not null` returns `True` when a value is not null. # SAQL Reference These hands-on SAQL examples walk you through writing a query to retrieve data - **[SAQL Basic Elements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-basic-elements.md)** Basic elements are the building blocks of your SAQL query. - **[SAQL Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators.md)** Use operators to perform mathematical calculations or comparisons. - **[SAQL Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statements-concept.md)** A query is made up of statements. Each SAQL statement has an input stream, an operation, and an output stream. - **[SAQL Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions.md)** Use functions to perform complex operations on your data. # SAQL Statements A query is made up of statements. Each SAQL statement has an input stream, an operation, and an output stream. - **[arimax](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-arimax.md)** Uses existing data to predict future data points. The `arimax` statement must follow a projection statement in your query. Perform any filtering pre-projection or after the `arimax` statement. - **[cogroup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-cogroup.md)** Use `cogroup` to blend data from two or more data streams into a single data stream. The data streams must have at least one common field. - **[fill](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-fill.md)** Use `fill()` to fill in any gaps in date fields. You most often use `fill()` before using the `timeseries` statement. By specifying the date fields to check, `fill()` creates a row that contains the missing month, day, week, quarter, or year and includes a null value. To include values outside the bounds of your data’s date range, specify a start date and end date to override existing limits. The function returns the missing date rows with null values. - **[filter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-filter.md)** Selects rows from a dataset based on a filter predicate. - **[foreach](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-foreach.md)** Applies a set of expressions to every row in a dataset. This action is often referred to as *projection*. - **[group-by](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-groupby.md)** Organizes the rows returned from a query into groups. Within each group, you can apply an aggregate function, such as `count()` or `sum()` to get the number of items or sum, respectively. - **[group-by rollup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-groupby-rollup.md)** `rollup` is a subclause of `group-by` that creates and displays aggregations of grouped data. The output of `rollup` is based on column order in your query. - **[join semi and anti](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-join-semi-anti.md)** Use the `join` statement with the `join_type` to create semi-join or anti-join results. - **[limit](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-limit.md)** Limits the number of results that are returned. If you don’t set a limit, queries return a maximum of 10,000 rows. - **[load](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-load.md)** Loads a dataset. All SAQL queries start with a `load` statement. - **[offset](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-offset.md)** Use `offset` to page through the results of your query. - **[order](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-order.md)** Sorts in ascending or descending order on one or more fields. - **[sample](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-sample.md)** Returns a random sample from a large dataset, where each data point has an equal probability of being selected. This keyword uses the Bernoulli distribution. - **[timeseries](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-timeseries.md)** Uses existing data to predict future data points. The `timeseries` statement must follow a projection statement in your query. Perform any filtering pre-projection or after the `timeseries` statement. - **[union](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-statement-union.md)** Combines multiple result sets into one result set. The result sets must have the same field names and structure. You can use a different dataset to create each result set, or you can use the same dataset. # saql Step Type Properties Use the `saql` step type for special cases when querying a Analytics dataset. With this step type, you can write a custom SAQL query to create derived fields in a values table. You can specify dimensions without groupings. Also, you can bind the dataset name or entire query. For example, you can bind this step type to a static step that provides different SAQL queries or datasets based on a selection. | Field Name | Description | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | Step type. Set to `saql`. | | `label` | Step label, which is primarily used for display in the dashboard designer user interface. | | `query` | The SAQL query used to retrieve results. For more information about SAQL queries, see [Analytics SAQL Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_saql.meta/bi_dev_guide_saql/bi_saql_intro.htm). When you create a `saql`-type step, by default, no `limit` is set in the query. When a limit isn't set, a step can return up to 10,000 results. To return more results, set the `limit` attribute accordingly. The higher you increase the limit, the longer the query takes. Limit only impacts the number of records returned for display. The limit doesn't impact calculations across all records in the dataset. For instance, a query groups by Account Name and there are one million Account Names in a dataset. When the limit is 20, Analytics returns 20 records for display. But the summary row provides a total for the one million records. You can bind a `saql` step type to dynamically set the dataset used in the query or change the entire query based on a selection in another step. For example, you can create a toggle based on a static step that allows the dashboard viewer to select a query. Each toggle option contains a valid SAQL query. Each query can be based on different datasets. (See the JSON example at the end of this section.) | | `broadcastFacet` | Controls whether the step's selections are broadcasted as facets. Faceting is when a selection in a widget filters other steps in the dashboard. Default is `true`. | | `receiveFacetSource` | Controls whether the step in the receiving query listens for broadcasted facets and applies them as filters. The mode can be "`all`", "`none`", "`include`", or "`exclude`". Use `steps` to list which steps to include or exclude. Default is `all`. | | `useGlobal` | Indicates whether to apply global filters to this step (`true`) or not (`false`). If the step is in SAQL form, you must also set `autoFilter` to `true` to apply the global filters. By default, the global filter widget filters compact-form steps only. | | `selectMode` | Determines the selection interaction. The options for charts are: `none`, `single`, and `singlerequired`. The options for list, range, and toggle selectors are: `single`, `singlerequired`, `multi`, and `multirequired`. `selectMode` doesn't apply to number, values table, compare table, date, and global filter widgets. | | `start` | The initial selections that are applied to the step when the dashboard first opens. A widget with a `saql`-type step can return up to 10,000 results, by default. If Analytics doesn't find the initial value in those results, it ignores this setting. | | `strings` | Flags the specified fields as non-grouping dimensions. For example, you can flag a field as a dimension for a values table in which no groupings are allowed. If you use a binding to determine the field, specify the binding here as well. | | `numbers` | Flags the specified fields as measures. If you use a binding to determine the field, specify the binding here as well. | | `groups` | Flags the specified fields as groupings. For example, you can flag a field as a grouping for a pivot table or chart. If you use a binding to determine the field, specify the binding here as well. | Single-selection example `start`: ```nolang "start": [ "06 - Proposal/Price Quote" ] ``` Multi-selection example `start`: ```nolang "start": [ "06 - Proposal/Price Quote", "01 - Prospecting" ] ``` ## Example: saql Step ```nolang "steps": { "Amount_1": { "type": "saql", "query": "q = load \"DTC_Opportunity_SAMPLE\";\nq = group q by 'Account_Name';\nq = foreach q generate 'Account_Name' as 'Account_Name', count() as 'count';\nq = order q by 'Account_Name' desc;\nq = limit q 1000;", "useGlobal": true, "numbers": [], "groups": [], "strings": [], "visualizationParameters": { "type": "chart", "parameters": { "visualizationType": "hbar", "autoFitMode": "keepLabels", "theme": "wave", "title": { "label": "", "fontSize": 14, "subtitleLabel": "", "subtitleFontSize": 11, "align": "center" }, "showValues": true, "axisMode": "multi", "binValues": false, "bins": { "breakpoints": { "low": 0, "high": 100 }, "bands": { "low": { "label": "", "color": "#B22222" }, "medium": { "label": "", "color": "#ffa500" }, "high": { "label": "", "color": "#008000" } } }, "dimensionAxis": { "showAxis": true, "showTitle": true, "title": "", "customSize": "auto", "icons": { "useIcons": false, "iconProps": { "column": "", "fit": "cover", "type": "round" } } }, "measureAxis1": { "sqrtScale": false, "showAxis": true, "customDomain": { "showDomain": false }, "showTitle": true, "title": "" }, "measureAxis2": { "sqrtScale": false, "showAxis": true, "customDomain": { "showDomain": false }, "showTitle": true, "title": "" }, "legend": { "show": true, "showHeader": true, "inside": false, "descOrder": false, "position": "right-top", "customSize": "auto" }, "tooltip": { "customizeTooltip": false, "showDimensions": true, "dimensions": "", "showMeasures": true, "measures": "", "showPercentage": true, "showNullValues": true, "showBinLabel": true }, "trellis": { "enable": false, "showGridLines": true, "flipLabels": false, "type": "x", "chartsPerLine": 4, "size": [ 100, 100 ] }, "applyConditionalFormatting": true, "showActionMenu": true } }, "label": "Amount_1", "selectMode": "single", "broadcastFacet": true, "receiveFacetSource": { "mode": "all", "steps": [] } } }, ``` ## Example: saql Step with a Bound Query ```nolang "query": "{{cell(static_1.selection, 0, \"query\").asString()" ``` The `static_1` step looks like this: ```nolang values: [ {query: "q = load \"opp\"; ..."} {query: "q = load \"account\"; ..."} ] ``` **tip:** Every dataset referenced in a binding of a `saql` step must be referenced by another step in the dashboard. If not, Analytics removes the dataset from the `datasets` attribute in the dashboard JSON. As a result, widgets based on the `saql` step display an error because it can't find the dataset. # Save a Dashboard You can save changes to a dashboard by sending a PATCH request to the Dashboard Results resource. Use a PATCH request on the [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) resource to save changes to a dashboard. ## Example Usage ```nolang /services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE ``` ## Example Request Body ```nolang { "dashboardMetadata" : { "name" : "Sales Dashboard", } } ``` ## Example Response Body ```nolang { "componentData" : [ { "componentId" : "01aD0000000a36LIAQ", "reportResult" : { "attributes" : null, "allData" : true, "factMap" : { "T!T" : { "aggregates" : [ { "label" : "USD 67,043,365.50", "value" : 67043365.50166918337345123291015625 } ] }, "0!T" : { "aggregates" : [ { "label" : "USD 10,083.33", "value" : 10083.333333333333939663134515285491943359375 } ] }, "1!T" : { "aggregates" : [ { "label" : "USD 25,016,768.67", "value" : 25016768.670066006481647491455078125 } ] }, "2!T" : { "aggregates" : [ { "label" : "USD 42,016,513.50", "value" : 42016513.49826984107494354248046875 } ] } }, "groupingsAcross" : null, "groupingsDown" : { "groupings" : [ { "groupings" : [ ], "key" : "0", "label" : "-", "value" : null }, { "groupings" : [ ], "key" : "1", "label" : "Existing Business", "value" : "Existing Business" }, { "groupings" : [ ], "key" : "2", "label" : "New Business", "value" : "New Business" } ] }, "hasDetailRows" : false, "reportExtendedMetadata" : { "aggregateColumnInfo" : { "s!AMOUNT" : { "acrossGroupingContext" : null, "dataType" : "currency", "downGroupingContext" : null, "label" : "Sum of Amount" } }, "detailColumnInfo" : { }, "groupingColumnInfo" : { "TYPE" : { "dataType" : "picklist", "groupingLevel" : 0, "label" : "Type" } } }, "reportMetadata" : { "aggregates" : [ "s!AMOUNT" ], "chart" : null, "currency" : "USD", "description" : null, "detailColumns" : [ ], "developerName" : "Simple_Test", "division" : null, "folderId" : "00lR0000000M8IiIAK", "groupingsAcross" : [ ], "groupingsDown" : [ { "dateGranularity" : "None", "name" : "TYPE", "sortAggregate" : null, "sortOrder" : "Asc" } ], "hasDetailRows" : false, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OD0000001g2nWMAQ", "name" : "Simple Test", "reportBooleanFilter" : null, "reportFilters" : [ ], "reportFormat" : "SUMMARY", "reportType" : { "label" : "Opportunities", "type" : "Opportunity" }, "scope" : "organization", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "CUSTOM", "endDate" : null, "startDate" : null }, "standardFilters" : [ { "name" : "open", "value" : "all" }, { "name" : "probability", "value" : ">0" } ] } }, "status" : { "dataStatus" : "DATA", "errorCode" : null, "errorMessage" : null, "errorSeverity" : null, "refreshDate" : "2014-04-09T00:28:16.000+0000", "refreshStatus" : "IDLE" } } ], "dashboardMetadata" : { "attributes" : { "dashboardId" : "01ZD00000007S89MAE", "dashboardName" : "Service Dept Dashboard", "statusUrl" : "/services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE/status", "type" : "Dashboard" }, "canChangeRunningUser" : false, "components" : [ { "componentData" : 0, "footer" : null, "header" : null, "id" : "01aD0000000a36LIAQ", "properties" : { "aggregates" : [ { "name" : "s!AMOUNT" } ], "autoSelectColumns" : false, "groupings" : null, "maxRows" : null, "sort" : { "column" : "TYPE", "sortOrder" : "asc" }, "useReportChart" : false, "visualizationProperties" : { "breakPoints" : [ { "aggregateName" : "s!AMOUNT", "breaks" : [ { "color" : "000000", "lowerBound" : null, "upperBound" : -1 }, { "color" : "000000", "lowerBound" : -1, "upperBound" : 0 }, { "color" : "000000", "lowerBound" : 0, "upperBound" : null } ] } ], "metricLabel" : null }, "visualizationType" : "Metric" }, "reportId" : "00OD0000001g2nWMAQ", "title" : null, "type" : "Report" } ], "description" : null, "developerName" : "Simple_Dashboard", "filters" : [ { "name" : "Amount", "options" : [ { "alias" : null, "endValue" : null, "id" : "0ICD00000004CBiOAM", "operation" : "greaterThan", "startValue" : null, "value" : "USD 2000000" } ], "selectedOption" : null } ], "folderId" : "00lR0000000DrojIAC", "id" : "01ZD00000007S89MAE", "layout" : { "columns" : [ { "components" : [ 0 ] } ] }, "name" : "Simple Dashboard", "runningUser" : { "displayName" : "Allison Wheeler", "id" : "005D00000016V2qIAE" } } } ``` # Save a Dashboard with a Custom Lightning Web Component (Beta) You can save a dashboard with a custom Lightning web component by sending a PATCH request to the Dashboard Results resource. **note:** This feature is a pilot or beta service that is subject to the Beta Services Terms at [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/) or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the [Product Terms Directory](https://ptd.salesforce.com/). Use of this pilot or beta service is at the Customer’s sole discretion. ## Example Usage ```nolang /services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE ``` ## Example Request Body ```nolang { "components": [{ "header": "", "properties": { "content": { "componentParameters": "{\"componentApiName\":\"c:kpiDashboard\",\"properties\":\"{\\\"maxCards\\\":1,\\\"showProgressBars\\\":true,\\\"showSummary\\\":false}\"}" }, "visualizationType": "LightningWebComponent" }, "type": "Dashboard", "componentData": 0 }] } ``` ## Example Response Body ```nolang components" : [{ "chartTheme" : null, "componentData" : null, "footer" : null, "header" : null, "id" : "01aSG0000088inFYAQ", "lastModifiedDate" : "2025-12-18T05:03:56Z", "properties" : { "content" : { "componentParameters" : "{\"componentApiName\":\"c:kpiDashboard\",\"properties\":\"{\\\"maxCards\\\":1,\\\"showProgressBars\\\":true,\\\"showSummary\\\":false}\"}" }, "visualizationType" : "LightningWebComponent" }, "reportId" : null, "title" : null, "type" : "Dashboard" }] ``` # Save Changes to an Analytics Notification Save Changes to an Analytics Notification using a PUT request. Use a PUT request on the [Analytics Notification](https://developer.salesforce.com/docs/analytics/reference/notifications/analytics-api-notifications-reference-notification.md) resource to save changes to an analytics notification. ## Example Usage `/services/data/v38.0/analytics/notifications/analytics notification ID` ## Example Request Body In this example, an analytics notification is changed so that it runs daily at 9:00 AM instead of 3:00 AM. ```nolang { "active" : true, "createdDate" : "", "deactivateOnTrigger" : false, "id" : "0AuR00000004CZTKA2", "lastModifiedDate" : "", "name" : "New Notification", "recordId" : "00OR0000000PD55MAG", "schedule" : { "details" : { "time" : 9 }, "frequency" : "daily" }, "source" : "lightningReportSubscribe", "thresholds" : [ { "actions" : [ { "configuration" : { "recipients" : [ ] }, "type" : "sendEmail" } ], "conditions" : null, "type" : "always" } ] } ``` ## Example Response Body The response body reflects the updated and saved analytics notifications. ```nolang { "active" : true, "createdDate" : "2016-08-12T05:57:19Z", "deactivateOnTrigger" : false, "id" : "0AuR00000004CZTKA2", "lastModifiedDate" : "2016-08-12T06:12:24Z", "name" : "New Notification", "recordId" : "00OR0000000PD55MAG", "schedule" : { "details" : { "time" : 9 }, "frequency" : "daily" }, "source" : "lightningReportSubscribe", "thresholds" : [ { "actions" : [ { "configuration" : { "recipients" : [ ] }, "type" : "sendEmail" } ], "conditions" : null, "type" : "always" } ] } ``` # Save Changes to Reports Save changes to a report by sending a PATCH request to the Report resource. **note:** Saving a report deletes any running async report jobs because they will be obsolete. ## Example For report 00OD0000001cxIE, you want to change the report name to “myUpdatedReport” and change the folder that contains the report. You save the changes to the report. This PATCH request `/services/data/v34.0/analytics/reports/00OD0000001cxIE` to the Report resource updates and saves the report. ```nolang { "reportMetadata" : { "name":"myUpdatedReport", "folderId":"00DD00000007enH"} } ``` The response to the PATCH request returns the following details about the updated, saved report. ```nolang { "reportExtendedMetadata" : { ... }, "reportMetadata" : { "aggregates" : [ "RowCount" ], "chart" : null, "currency" : null, "description" : null, "detailColumns" : [ "USERS.NAME", "ACCOUNT.NAME", "TYPE", "DUE_DATE", "LAST_UPDATE", "ADDRESS1_STATE" ], "developerName" : "myreport", "division" : null, "folderId" : "00DD00000007enHMAQ", "groupingsAcross" : [ ], "groupingsDown" : [ ], "hasDetailRows" : true, "hasRecordCount" : true, "historicalSnapshotDates" : [ ], "id" : "00OD0000001cxIEMAY", "name" : "myUpdatedReport", "reportBooleanFilter" : null, "reportFilters" : [ ], "reportFormat" : "TABULAR", "reportType" : { "label" : "Accounts", "type" : "AccountList" }, "scope" : "user", "showGrandTotal" : true, "showSubtotals" : true, "sortBy" : [ ], "standardDateFilter" : { "column" : "CREATED_DATE", "durationValue" : "CUSTOM", "endDate" : null, "startDate" : null }, "standardFilters" : null }, "reportTypeMetadata" : { ... } } ``` # Searched case Operator Use `case` in a `foreach` statement to assign different field values in different situations. `case` supports two syntax forms: searched case and simple case. This section shows searched case. ## Syntax ```nolang case when search_condition then result_expr [when search_condition2 then result_expr2 ] [else default_expr ] end ``` _case...end_ opens and closes the case operator. _when...then_ defines a conditional statement. A case expression can contain one or more conditional statements. _search_condition_ can be any scalar expression that returns a boolean value. It can be a complex boolean expression or a nested case, as long as the result is boolean. For a list of supported operators, see [Comparison Operators](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-comparison.md). _result_expr_ is any expression that takes a single input value and returns a single output value. Can contain values, identifiers, and scalar functions (including date and math functions). The expression must return the same data type as specified in the search condition. _else default_expr_ (optional) is any expression that takes a single input value and returns a single output value. Can contain values, identifiers, and scalar functions (including date and math functions). The expression can return a number, string, or date. ## Usage Statements are evaluated in the order that they are given. If the condition is `primary_expr == test_expr`, then the corresponding _result_expr_ is returned. You can specify any number of `when`/`then` statements. You can use `else` to specify a default expression. For example, if no industry is specified, you can use the string "No Industry Specified". If you don't specify a default statement, then `null` is returned. You can use `case` expressions in `foreach` statements. You cannot use `case` in `order`, `group`, or `filter` statements. ## Example Suppose that you want to see the median deal size for each of your reps. You want to bin their median deal size into the buckets "Small", "Medium", and "Large". Use `case` to assign values to the median deal size. ```nolang q = load "data"; q = group q by 'Account_Owner'; q = foreach q generate 'Account_Owner' as 'Account_Owner', median('Amount') as 'Median Amount', (case when median('Amount') < 1000000 then "Small" when median('Amount') > 1600000 then "Large" else "Medium" end ) as 'Category'; ``` The resulting data shows the median deal size for each rep, along with the appropriate bin label. ![Derived dimension shows time to win](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_caseMedAmount.png) If you want to group the data by the field assigned by the case statement, add a `group by` statement to the end of the query. For example, to group the data by the `Category` field, add the following line to the end of the above example: ```nolang q = group q by 'Category'; ``` ## Handling Null Values In general, `null` values can’t be compared. When the search condition evaluates to `null`, the _default_expr_ is returned. If no default expression is specified, `null` is returned. # SELECT Clause The `SELECT` clause retrieves columns from a table. `SELECT` query syntax takes the form of a required `SELECT` statement followed by one or more optional clauses, such as `WHERE`, `GROUP BY`, and `ORDER BY`. For a simple column projection, SQL outputs the results with the name of the column provided. If you include additional expressions and functions, you must use an alias to name the column output. Include an alias by following the structure `{expression} {AliasName}` or `{expression as AliasName}`. The "as" is not required. **note:** Unlike other versions of SQL, the CRM Analytics SQL server throws an error if you don't include an alias. It does not automatically provide an alias name. Let's look at an example. ```nolang SELECT City, COUNT(*) as StoreCount FROM "Superstore" GROUP BY City; ``` Here are the first ten results. | City | StoreCount | | ----------- | ---------- | | Aberdeen | 1 | | Abilene | 1 | | Akron | 21 | | Albuquerque | 14 | | Alexandria | 16 | | Allen | 4 | | Allentown | 7 | | Altoona | 2 | | Amarillo | 10 | | Anaheim | 27 | This query returns a table with two columns, `City` and the alias `StoreCount`. `StoreCount` is the column name given to the expression, `COUNT(*)`, which means count the number of rows for each city in the Superstore table. The `GROUP BY` clause groups all of the store counts by the `City` column. `SELECT` supports the following operators. | Type | Operator Name | Supported Types | | -------------------- | ------------------ | ------------------------ | | Arithmetic Operators | + | Numeric, String | |   | - | Numeric | |   | \* | Numeric | |   | / | Numeric | |   | % | Numeric | | Comparison Operators | !=, = | Numeric, String, Boolean | |   | \<, \<=, >, >= | Numeric, String | |   | `IN`, `NOT IN` | Numeric, String | | Logical Operators | `AND`, `OR`, `NOT` | Boolean | | Case Operators | `CASE ... END` | Numeric, String, Boolean | `SELECT` supports arithmetic operators between measure fields and using "+" between string fields. - **[FROM Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-from.md)** The `FROM` clause defines which table or table function to query. CRM Analytics SQL supports using `FROM` with a single table only. You can’t select from multiple tables. - **[WHERE Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-where.md)** By default, a SQL query retrieves every row in your dataset. Use the optional `WHERE` clause to restrict your query results to a conditional expression. - **[Boolean Expressions in SELECT Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-boolean.md)** A boolean expression is a logical statement that returns either `true` or `false`. - **[GROUP BY Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-groupby.md)** The `GROUP BY` clause organizes the rows returned from a `SELECT` statement into groups. Within each group, you can apply an aggregate function, like `count()` or `sum()` to get the number of items or sum, respectively. - **[GROUP BY ROLLUP](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-groupby-rollup.md)** `ROLLUP` is a sub-clause of `GROUP BY` that creates and displays aggregations of column data. The results output of `ROLLUP` is based on column order in your query. - **[GROUPING()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-grouping.md)** Use the `GROUPING()` clause with `ROLLUP` to determine whether null values are the result of a `ROLLUP` operation or part of your dataset. `GROUPING()` returns 1 if the null value is a subtotal generated by a rollup. It returns 0 otherwise. - **[HAVING Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-having.md)** Use the `HAVING` clause to filter grouped results from grouped columns, aggregate functions, or grouping functions. - **[ORDER BY Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-orderby.md)** `SELECT` returns rows in an unspecified order by default. To sort returned rows in ascending or descending order, use the `ORDER BY` clause. - **[LIKE Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-like.md)** Use `LIKE` to match single characters and patterns found anywhere in a string—beginning, ending, or somewhere in between. - **[BETWEEN Operator](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-between.md)** Use `BETWEEN` to check whether values fall within a given range. `BETWEEN` accepts numeric, string, and date data types, and can be used with aggregate, window, and math functions. - **[LIMIT Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-limit.md)** The `LIMIT` clause specifies the maximum number of rows to return. If no `LIMIT` clause is specified, then SQL returns all rows. - **[FETCH Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-fetch.md)** The `FETCH` clause specifies the number of rows to return. If no `FETCH` clause is specified, then SQL returns all rows. - **[OFFSET Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-offset.md)** By default, a SQL query retrieves every row in your dataset. Use the optional `WHERE` clause to restrict your query results to a conditional expression. - **[CASE Statements](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-case.md)** Use case statements to express if/then logic. A case statement always has a pair of `WHERE` and `THEN` statements. CRM Analytics supports the simple and searched forms of case expressions in a `SELECT` statement. Case statements have two formats: simple and searched. - **[COALESCE()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-coalesce.md)** You can use the `coalesce()`function as shorthand for case statements. The `coalesce()` function replaces null values in your dataset with another value. The function takes a series of arguments and returns the first value that is not null. - **[NULLIF()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-nullif.md)** Use the `nullif()` function as shorthand for a searched case statement where two equal expressions return null. - **[UNION Operator](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-union.md)** Use the `UNION` operator to combine the results of two or more `SELECT` statements. The joined statements must have the same number of columns and the same data types for corresponding columns. - **[Subquery](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-subquery.md)** A subquery is a query that is nested inside a `SELECT` statement. Nesting queries allows you to perform multi-step operations. - **[Window Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-window.md)** A window function lets you perform calculations on a selection—or "window"—of rows that are related to the current row. Unlike a regular aggregate function, such as `avg()`, `sum()`, or `count()`, the row output of a window function isn’t grouped into a single row. # selectors Properties The `selectors` key contains layout properties that specify the layout name, designer grid settings, background settings, and requirements for devices that can use this layout. | Property Name | Type | Details | | ----------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `minWidth()` | Integer | Minimum width (in pixels) of the devices supported by this layout. Included in the Dashboard Designer's user interface. | | `maxWidth()` | Integer | Maximum width (in pixels) of the devices supported by this layout. Included in the Dashboard Designer's user interface. | | `orientation( )` | String | Orientation of the devices supported by this layout. Valid values are: ```portrait`or`landscape`. If this property is not specified, then the layout supports both orientations. Included in the Dashboard Designer's user interface. | | `platform()` | String | Platform of the devices supported by this layout. Valid values are: `iOS` or `Android`. If this property is not specified, the layout supports both platforms. Included in the Dashboard Designer's user interface. | # Set a Sticky Dashboard Filter Set a default filter value which gets applied to a dashboard when you open it. The default filter value you specify only applies to you (other people won’t see it when they open the dashboard). If you change the filter value while viewing the dashboard, then the filter value you set in the user interface overwrites the value you set via the API. To set sticky filters for a dashboard, `canUseStickyFilter` must equal `true`. Use a PATCH request on the [Dashboard Results](https://developer.salesforce.com/docs/analytics/reference/dashboard/analytics-api-dashboard-results-resource.md) resource and append the parameter `isStickyFilterSave=true` to set a sticky filter. In the request body, set the `selectedOption` property to the index of the filter option you’d like to apply. ## Example Usage ```nolang /services/data/v40.0/analytics/dashboards/0IBR00000004D4iOAE?isStickyFilterSave=true ``` ## Example Request Body ```nolang { "filters" : [ { "errorMessage" : null, "id" : "0IBR00000004D4iOAE", "name" : "Billing City", "options" : [ { "alias" : "New York City", "endValue" : null, "id" : "0ICR00000004FtQOAU", "operation" : "equals", "startValue" : null, "value" : "New York City" }, { "alias" : "Chicago", "endValue" : null, "id" : "0ICR00000004FtROAU", "operation" : "equals", "startValue" : null, "value" : "Chicago" }, { "alias" : "Los Angeles", "endValue" : null, "id" : "0ICR00000004FtSOAU", "operation" : "equals", "startValue" : null, "value" : "Los Angeles" } ], "selectedOption" : 1 } ] } ``` ## Example Response Body If successful, an empty response body is returned. # Set Up and Manage Authentication with External Client Apps External client apps are packageable frameworks to enable a third-party app to integrate with Salesforce using APIs and security protocols. External client apps provide single sign-on (SSO) and use OAuth protocols to authorize third-party apps. Third-party apps integrated with Salesforce can run on the customer success platform and other platforms, devices, or SaaS subscriptions. For more information on ECAs, including how to configure them in your organization, see [External Client Apps](https://help.salesforce.com/s/articleView?id=sf.external_client_apps.htm). --- | **User Permissions Needed** | | | ------------------------------- | --------------------------------- | | To manage External Client Apps: | Tableau Next Admin permission set | --- ## Set Up the External Client App 1. To create an ECA for your web app, in Salesforce, use the App Launcher to find and select **Tableau Next**. 2. In the Tableau Next app, click **Administration**. 3. Click **External Client App**. ![External client app management in Tableau Next Administration](https://developer.salesforce.com/docs/media/sdk/embedded_tn_admin_upd_v2.png '{"class": "image-lg"}') 4. To create a new external client app, click **New**. ![The create external client app window](https://developer.salesforce.com/docs/media/sdk/embedded_tn_new_eca_upd_v2.png '{"class": "image-md"}') 5. Enter the name for the ECA to show in the External Client App Manager. 6. Enter the contact email for Salesforce to use in case we want to contact you or your support team. 7. Enter one or more **Callback URL** values. A callback URL is the app URL where you’re embedding the code and can accept the authentication returned from the Salesforce ECA. An example of a callback URL is `https://mydomain.com`. 8. For OAuth Flow Enablement, the required flow for embedding is **Web Server Flow**. For more information, see [OAuth 2.0 Web Server Flow for Web App Integration](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_web_server_flow.htm). 9. To use a code challenge in your OAuth flow, enable **Require Proof Key for Code Exchange (PKCE)**. Using PKCE is recommended for the web server flow, only enable this setting to require a code challenge in your authorization flow. For more information on using and generating a proof key, see the [Proof Key for Code Exchange (PKCE) Extension](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_pkce.htm) in Salesforce Help. 10. For OAuth Scopes, use the default values of **Manage user data via APIs (api)**, **Access Lightning applications (lightning)**, **Manage user data via Web browsers (web)**, **Perform requests at any time (refresh_token, offline_access)**. 11. Click **Create**. Before leaving this page, click **View Secret** to copy and save the values. You need the consumer key value for the `client_id` and the consumer secret value for the `client_secret`. Your ECA is also available in Salesforce Setup. To view it on Setup, from the ECA details page, click **View Details in Setup**. To use other OAuth enablement flows, see [Configure Advanced Authentication Flows](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-setup-auth-extended.md). ## Manage the External Client App After you've created your ECA, you can use the Tableau Next Administration page to update your ECA settings, or enable or disable it. ![The external client app details](https://developer.salesforce.com/docs/media/sdk/embedded_tn_edit_eca_v2.png '{"class": "image-lg"}') To make edits to the ECA details, click **Edit**. You can update your callback URLs, OAuth scopes, OAuth flow enablement, and security settings. You can view the consumer key and secret or generate a new consumer secret. **important:** When you generate a new consumer secret, the old one is invalidated. You must update all implementations using the secret value with the new value. The code you have in your web app to generate the access token needs the new consumer value. You can disable or enable your ECA as needed. When the ECA is disabled, any web app using the consumer key and secret values from the ECA can't authenticate to the Salesforce org. If you enable the ECA, the authentication flow is valid for your web app. --- [Next - Setup Salesforce Settings for Tableau Next Embedding](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-setup-settings.md) # Set Up Salesforce for Embedding Tableau Next Externally To embed Tableau Next components in an external web app, complete a one-time setup: create an External Client App (ECA) for authentication, update your Salesforce org settings, assign user permissions, and write code that generates access tokens and Frontdoor URLs. ## Prerequisites - Ensure your Salesforce org has the Tableau+ or Tableau Next Creator license and that Tableau Next is enabled. - Verify the Tableau Next admin page is accessible for assigning user permissions and creating an ECA for your authorization flow. - Identify the users that own any Tableau Next assets you want to embed and request access to those assets. - Identify the Tableau Next admin with access to configure the ECA and set up the [Content Security Policy (CSP)](https://developer.salesforce.com/docs/platform/lightning-components-security/guide/content-security-policy-intro.html). ## Set Up Steps Create your ECA to provide authentication. Then, update Salesforce org settings for your domain and cookie requirements. Make sure that the domain and callback URL for the web app match the values in the ECA and in your Salesforce settings. - [Set Up and Manage Authentication with External Client Apps](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-setup-tn-auth.md) - [Update Settings for Tableau Next Embedding](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-setup-settings.md) Make sure that all your web app users exist in your Salesforce org and have the correct permissions to view the embedded components. - [Assign Tableau Next User Permissions](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-setup-users.md) Write code in your web app that generates access tokens and Frontdoor URLs, then passes those credentials to the embedded component, so each user is authenticated to Salesforce. - [Generate the Access Token and Frontdoor URL for Tableau Next Embedding](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-access-token.md) # setState Method Use the `setState` method to dynamically set the state on an Aura component for CRM Analytics dashboards, or interact with the dashboard by dynamically changing the selection. ## Arguments | Argument Name | Description | | ------------- | --------------------------------------------------------------------------------------------------------- | | `callback` | The callback function to handle the `getState` payload response. See the next section for a basic `callback` example. | For `setState`, the `config` parameters are: - `state` - : Required; the dashboard state to use for update. - `pageId` - : Required; the dashboard page ID to update. - `replaceState` - : Optional; indicates whether to replace the dashboard state (`true`) or not (`false`). The default value is `false`. **note:** When the `replaceState` parameter is `false` or not passed, only filters and step selections explicitly passed in the `state` parameter are updated. Any other state changes made since the dashboard was loaded are still present. When `replaceState` is `true`, the dashboard is reset with the provided external state, clearing any other selections made since the dashboard was loaded. ## Example Add your implementation of the `setState` call into the controller.js for your Aura component. The `config` JSON is created with the required `pageId` and `state` attributes and the optional `replaceState` attribute. ```javascript ({ setState : function(component, event, helper) { var dashboard = component.find('myDashboard'); var config = { "pageId": "public_page", "replaceState": true, "state": { "datasets": {}, "steps": { "StepName" : { "values": [], "metadata": {"groups": ["GroupSource"]} }, ... } } } dashboard.setState(config); } }) ``` The `state` can be set dynamically from user input or from another dashboard’s `state`. For the complete dashboard `state` structure, refer to the [Analytics Dashboard JSON Reference](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_json.meta/bi_dev_guide_json/bi_dbjson_intro.htm) guide. **See Also** - [`getState` Method](https://developer.salesforce.com/docs/analytics/dashboard-component/guide/bi-dbcomp-lwc-getstatemethod.md) # Setup Set up your environment to create Lightning Web Component widgets, and then add them to your CRM Analytics and Lightning dashboards. CRM Analytics provides a collection of easy-to-digest code examples for Lightning Web Components that are specific to CRM Analytics features. These examples demonstrate how to code charts, graphs, and hierarchies using third-party JS libraries and CRM Analytics features. - **[Setup Instructions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-setup-instructions.md)** Use these instructions to set up your Salesforce org for development of Lightning Web Components and to use the CRM Analytics Lightning Web Component examples provided. - **[Getting Started with Lightning Web Components](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-get-started.md)** Before continuing with this guide, we recommend you familiarize yourself with Lightning Web Components. **See Also** - [Architecture](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-architecture.md) # Setup Instructions Use these instructions to set up your Salesforce org for development of Lightning Web Components and to use the CRM Analytics Lightning Web Component examples provided. 1. Create or use a Developer Edition (DE) org enabled for CRM Analytics. Sign up for a new CRM Analytics enabled DE org at [developer.salesforce.com/promotions/orgs/analytics-de](https://developer.salesforce.com/promotions/orgs/analytics-de). 2. If you plan to publish any of your own Lightning Web Component work to App Exchange, enable your DE org as a dev hub. For more information about enabling dev hubs, see [Enable Dev Hub Features in Your Org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm). 3. Create a Connected App, a record client key, and a secret. DO NOT use the JWT flow. For more information on Connected Apps, see [Create a Connected App for Your Dev Hub Org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_connected_app.htm). 4. Install the Salesforce CLI. For detailed instructions, see [Install Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli). Alternatively, you can install Visual Studio Code to perform steps 6–10. See [Install Salesforce Extensions for Visual Studio](https://developer.salesforce.com/tools/vscode/en/getting-started/install). 5. Log in to your DE org via the CLI. For `org login web` and other command details, see the [CLI command reference guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_org_commands_unified.htm). 6. Clone the GitHub repository containing the CRM Analytics Lightning Web Component example components. This repository is structured as a Salesforce DX project for use with CLI commands. ```nolang git clone https://github.com/forcedotcom/sfdx-analytics.git ``` 7. See the [README file](https://github.com/forcedotcom/sfdx-analytics) in the repository for more information on the CRM Analytics Lightning Web Component example components. 8. Deploy the CRM Analytics Lightning Web Component examples in the project from the command line with ```nolang sf project deploy start --source-dir quick-start/main/default/lwc --target-org ``` or use the SFDX: Deploy Source to Org command in Visual Studio code. 9. Use and adapt the CRM Analytics LWC examples to create your own custom Lightning Web Component widgets for CRM Analytics dashboards. 10. Create your own component using the SFDX: Create Analytics Dashboard LWC command in Visual Studio Code or a standard Lightning Web Component with the `sf lightning generate component` CLI command. **note:** The SFDX: Create Analytics Dashboard LWC command requires installation of the `analyticsdx-vscode` extension pack. **See Also** - [Getting Started with Lightning Web Components](https://developer.salesforce.com/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-get-started.md) # sf This section contains information about the `sf` commands for the `analytics` plug-in. This version of the `sf` command reference includes details about version 1.4.16 of the `sf analytics` executable of the Salesforce CLI `@salesforce/analytics` plug-in. - **[analytics enable](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/bi-cli-reference-analytics-enable-unified.md)** Enable Analytics in the target org. - **[analytics query](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/bi-cli-reference-analytics-query-unified.md)** Execute an Analytics query. - **[app Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/app/bi-cli-reference-analytics-app-unified.md)** Create and manage Analytics apps. - **[asset Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/asset/bi-cli-reference-analytics-asset-unified.md)** Manage Analytics asset publishing. - **[autoinstall Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/autoinstall/bi-cli-reference-analytics-autoinstall-unified.md)** Manage Analytics auto-install requests. - **[dashboard Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/dashboard/bi-cli-reference-analytics-dashboard-unified.md)** Manage Analytics dashboards. - **[dataflow Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/dataflow/bi-cli-reference-analytics-dataflow-unified.md)** Manage Analytics dataflows and dataflow jobs. - **[dataset Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/dataset/bi-cli-reference-analytics-dataset-unified.md)** Manage Analytics datasets. - **[generate Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/generate/bi-cli-reference-analytics-generate-unified.md)** Generate simple Analytics assets. - **[lens Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/lens/bi-cli-reference-analytics-lens-unified.md)** Manage Analytics lenses. - **[recipe Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/recipe/bi-cli-reference-analytics-recipe-unified.md)** Manage Analytics recipes. - **[template Commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/template/bi-cli-reference-analytics-template-unified.md)** Create and manage Analytics templates. # sfdx (Deprecated) This section contains information about the deprecated `sfdx`-style commands for the `analytics` plug-in. **warning:** As of April 20, 2023, we no longer maintain this section of the command reference. Refer to the [reference information about the `sf`-style commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/sf/bi-cli-reference-analytics-unified.md) instead, which we update regularly. We keep this reference information about the `sfdx`-style commands as-is for historical reference only. The `sfdx`-style commands continue to work the same as before, and any scripts that use the commands won’t break. However, we recommend that you start using the equivalent [`sf`-style commands](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/sf/bi-cli-reference-analytics-unified.md). The reference page for each `sfdx` command has been updated with information about its equivalent `sf` command. The page also shows how the flag names have changed between the `sfdx` and `sf` commands. Use this information to migrate your scripts. For background information about this change, read [this blog post](https://developer.salesforce.com/blogs/2022/12/big-improvements-coming-to-the-salesforce-cli), which describes how we've updated many of the existing `sfdx` commands to use the improvements we made in `sf` commands. To view all the changes, read the CLI release notes starting with version 7.183.1 on [January 12, 2023](https://github.com/forcedotcom/cli/blob/main/releasenotes/sfdx/README.md#71831-jan-12-2023). - **[analytics:enable (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/bi-cli-reference-analytics-enable.md)** Enable Analytics. - **[analytics:query (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/bi-cli-reference-analytics-query.md)** Execute an Analytics query. - **[app Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/app/bi-cli-reference-analytics-app.md)** Create and manage Analytics apps. - **[asset Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/asset/bi-cli-reference-analytics-asset.md)** Manage Analytics asset publishing. - **[autoinstall Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/autoinstall/bi-cli-reference-analytics-autoinstall.md)** Manage Analytics auto-install requests. - **[dashboard Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/dashboard/bi-cli-reference-analytics-dashboard.md)** Manage Analytics dashboards. - **[dataflow Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/dataflow/bi-cli-reference-analytics-dataflow.md)** Manage Analytics dataflows and dataflow jobs. - **[dataset Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/dataset/bi-cli-reference-analytics-dataset.md)** Manage Analytics datasets. - **[generate Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/generate/bi-cli-reference-analytics-generate.md)** Generate simple Analytics assets. - **[lens Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/lens/bi-cli-reference-analytics-lens.md)** Manage Analytics lenses. - **[recipe Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/recipe/bi-cli-reference-analytics-recipe.md)** Manage Analytics recipes. - **[template Commands (Deprecated)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-cli-reference/guide/template/bi-cli-reference-analytics-template.md)** Create and manage Analytics templates. **See Also** - [Migrate sfdx-Style Commands to the New sf-Style](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_migrate.htm) # Share CRM Analytics Assets Between Apps Use the Template Dependencies feature to reuse CRM Analytics dashboards, datasets, and lenses across apps. Create dependencies between app templates with Template Dependencies. Create the dependency from one app template (the dependent app template, Template D in the image) to assets in another (the supporting app template, Template A in the image) that reside in the same org. Apps created from the dependent template can include dashboards, datasets, and lenses from the supporting template. A template (Template B) can be both a dependent template and a supporting template at the same time. ![Template D has a dependency on Templates B and C. Template B has a dependency on Template A](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templates_share_assets2.png) **important:** Template dependencies can’t be used with templates packaged for automatic install. The creation of auto-install requests can’t guarantee dependent templates are installed in the correct order. While a template declares dependencies on other templates, it is really the apps that get created from the templates that have dependencies on each other. If Template B declares a dependency on Template A, it means that to create an app from Template B, you must first create one or more apps from Template A. The dependent and supporting apps must both reside in the same org. **note:** You can only create dependencies on apps created from templates. That’s because the dependency refers to the template. There is template-to-template dependency in creating token references and app-to-app dependency when app assets are created from the dependent template. - **[Create Dependent Templates](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-create-dependency.md)** Follow these steps to create templates with dependencies. - **[Template Dependency Syntax](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-dependency-version-syntax.md)** The syntax you use to specify dependencies in the `template-info.json` file for `templateVersion` is flexible. The value can take on any of the following. - **[Best Practices](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-dependency-best-practices.md)** When creating template dependencies, follow these guidelines. - **[Creating a Template from a Dependent App](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-dependency-app-to-template.md)** Apps with dependencies on assets on other apps can be templatized using the same template creation process as standalone templates. # Show the Top and Bottom Quartile Use SAQL to calculate percentiles, like the top and bottom quartile of your data. ## Example - Show Top Quartile and Bottom Quartile Deal Size by Country Suppose that you want to see the top and bottom quartile deal size, by country. You want to see the size of the actual deal, not the interpolated (or 'average') deal size. Use `percentile_disc(.25)` and `percentile_disc(.75)`. ```nolang q = load "Data"; q = group q by 'Billing_Country'; q = foreach q generate 'Billing_Country' as 'Billing_Country', percentile_disc(0.25) within group (order by 'Amount' desc) as '25th Percentile', percentile_disc(0.75) within group (order by 'Amount' desc) as '75th Percentile'; q = order q by '25th Percentile' asc; ``` Use a bar chart and select **Axis Mode** > **Single Axis** to show the top and bottom quartiles together. ![Diagram showing percentile continuous.](https://developer.salesforce.com/media/bi_dev_guide_saql/topandbottomquartile.png) **See Also** - [percentile_disc()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-pd.md) # ShowDetailsDefaultFields in XMD Specify the default fields that appear in a Analytics values table. You can override the defaults and show other fields when you create a values table. The `ShowDetailsDefaultFields` section doesn’t have children parameters. | Parameter | Description | | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | showDetailsDefaultFields | List of fields that display by default in a values table. If not specified, the first five dimensions and first five measures, alphabetically, appear. Example: `"showDetailsDefaultFields":["Sales", "Profit", "Customer_Name", "Product_Category", "Product_Sub_Category"]` | **See Also** - [Change the Default Fields for a Values Table](https://developer.salesforce.com/docs/analytics/bi-dev-guide-xmd/concept/bi-xmd-values-table-set-default-fields.md) # sign({n}) Returns 1 if the numeric value, `{n}` is positive. It returns -1 if the `{n}` is negative, and 0 if `{n}` is 0. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. `SIGN(`{n}`)` takes the following syntax. ```nolang SELECT SIGN(N) as ALIAS FROM DATASET; ``` ## Example This example returns the `sign` of -12. ```nolang SELECT SIGN(-12) as signValue FROM "Opportunity" LIMIT 1; ``` | signValue | | --------- | | -1 | # sign(n) Returns 1 if the numeric value, _n_ is positive. It returns -1 if the _n_ is negative, and 0 if _n_ is 0. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `sign()` returns `null`. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate sign(value) as value; ``` # Simple case Operator Use `case` in a `foreach` statement to assign different field values in different situations. `case` supports two syntax forms: searched case and simple case. This section explains simple case. ## Syntax ```nolang case primary_expr when test_expr then result_expr [when test_expr2 then result_expr2 ] [else default_expr ] end ``` _case...end_ opens and closes the case operator. _primary_expr_ is any expression that takes a single input value and returns a single output value. May contain values, identifiers, and scalar functions (including date and math functions). The expression can return a number, string, or date. _when...then_ defines a conditional statement. A `case` expression can contain one or more conditional statements. _test_expr_ is any expression that takes a single input value and returns a single output value. May contain values, identifiers, and scalar functions (including date and math functions). The expression must return the same data type as _primary_expr_. _result_expr_ is any expression that takes a single input value and returns a single output value. May contain values, identifiers, and scalar functions (including date and math functions). The expression must return the same data type as _`primary_expr`_. _else default_expr_ (optional) is any expression that takes a single input value and returns a single output value. May contain values, identifiers, and scalar functions (including date and math functions). The expression can return a number, string, or date. ## Usage Statements are evaluated in the order that they are given. If _test_expr_ returns `true`, the corresponding _result_expr_ is returned. You can specify any number of `when`/`then` statements. You can use `else` to specify a default expression. For example, if no industry is specified then use the string "No Industry Specified". If you don't specify a default statement then `null` is returned. You can use `case` expressions in `foreach` statements. You cannot use `case` in `order`, `group`, or `filter` statements. ## Example Suppose that you want to create a dimension that displays the meaning of industry codes. Use `case` to parse the Industry_Code field and specify the corresponding string. ```nolang q = foreach q generate Amount as 'Amount', 'Industry_Code' as 'Industry_Code', (case 'Industry_Code' when 541611 then "Consulting services" when 541800 then "Advertising" when 561400 then "Support services" else "Unspecified" end) as 'Industry'; ``` The resulting data displays the meaning of industry codes: ![Derived dimension shows time to win](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_caseIndustry.png) ## Handling Null Values In general, `null` values can’t be compared. When _ primary_expr_ or _test_expr_ evaluates to `null`, the _default_expr_ is returned. If no default expression is specified, `null` is returned. **See Also** - [Speed Up Queries with Dataflow Transformations](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-dataflow-transformations.md) # Simple Variable Types for variables.json We call the following variable types “simple” because they’re standard, predefined datatypes. | Type Name | Description | Type Declaration | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | | `BooleanType` | References `true` or `false` values. | `"variableType" : { "type": "BooleanType" }` | | `StringType` | References a string. Can use `Array` to define restricted valid values for the string. If null or empty, any value is allowed. | `"variableType" : { "type": "StringType" }` | | `NumberType` | References numerical values. | `"variableType" : { "type": "NumberType" }` | | `NumberType` (Range) | References range of numerical values. Use `min` to specify minimum value and `max` to specify maximum value. Optional. | `"variableType" : { "type": "NumberType", "min":0, "max":100 }` | ## Enumerated Values The `StringType` and `NumberType` can both contain lists of values, `enums`, and an optional array of labels for those values, `enumsLabels`. The order of values in `enumsLabels` must match the order of values in `enums`. ## Example ```nolang "Colors": { "label": "Select a color", "variableType": { "type": "StringType", "enums": [ "#ff0000", "#00ff00", "#0000ff" ], "enumsLabels": [ "Red", "Green", "Blue" ] } } ``` # sin({n}) Returns the sine value of radians value `{n}`. `{n}`can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `sin()` returns `null`. `sin({n})` takes the following syntax. ```nolang SELECT SIN(N) as ALIAS FROM DATASET; ``` ## Example This example takes the sine of 90 degrees. ```nolang SELECT SIN(RADIANS(90)) as sinValue FROM "Opportunity" LIMIT 1; ``` | sinValue | | -------- | | 1 | # sin(n) Returns the sine value of radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `sin()` returns `null`. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate sin(radians) as sine; ``` # soql Step Type Properties Use to directly query Salesforce objects—both standard and custom—to get Salesforce data that’s not available in datasets. You can also query external objects created with an OData adapter for Salesforce Connect. To view the results in the dashboard, the user viewing the dashboard must have access to the object and fields queried by the `soql` step. The SOQL query returns only records to which the user has access. For more information about using Salesforce Connect to access external data, see the [Salesforce Connect](https://help.salesforce.com/articleView?id=platform_connect_about.htm) Salesforce Help. | Field Name | Description | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `type` | Step type. Set to `soql`. | | `label` | Step label, which is primarily used for display in the dashboard designer user interface. | | `query` | The SOQL query used to retrieve results from a Salesforce object. Because Salesforce—not Analytics—executes the query, the maximum number of returned results depends on the SOQL query limit. For more information about SOQL queries, see [SOQL and SOSL Reference](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_sosl_intro.htm). Every field listed in your SOQL query must be listed in one of the metadata properties: `strings`, `numbers`, or `groups`. | | `strings` | Flags the specified fields as non-grouping dimensions. For example, you can flag a field as a dimension for a values table in which no groupings are allowed. If you use a binding to determine the field, specify the binding here as well. | | `numbers` | Flags the specified fields as measures. If you use a binding to determine the field, specify the binding here as well. | | `groups` | Flags the specified fields as groupings. For example, you can flag a field as a grouping for a pivot table or chart. If you use a binding to determine the field, specify the binding here as well. | **note:** This step type doesn’t support faceting. If needed, you can use a binding to filter other steps based on a selection in a `soql` step. ## Example: soql Step ```nolang "soql": { "type": "soql", "query": "SELECT Name from ACCOUNT", "strings": ["Name"], "numbers": [], "groups": [], "selectMode": "single" } ``` ## Example: Total Number of Active Salesforce Users The following query gets the total number of active users from the Salesforce User object. In this example, we name the count expression as “foo” and then reference it by name in the `numbers` parameter. ```nolang "soql": { "type": "soql", "query": "SELECT count(id) foo FROM User u WHERE u.IsActive = true", "strings": [], "numbers": ["foo"], "groups": [], "selectMode": "single" } ``` If you don’t name the count expression, the query produces an "expr0" field that you can use in the `numbers` parameter. ```nolang "soql": { "type": "soql", "query": "SELECT count(id) FROM User u WHERE u.IsActive = true", "strings": [], "numbers": [ "expr0" ], "groups": [], "selectMode": "single" } ``` # source Step Type Properties Use the `sources` property to add `columns`, `groups`, `filters`, and formulas to a step query. | Field Name | Description | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `columns` | The columns for the source. For more information, see [columns Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-columns.md). | | `groups` | The dimensions to group the data in the source. | | `filters` | The filters applied to the columns in the source. For more information, see [filters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-filters.md) | | `name` | The name of the data source. If the query has formula columns, they’re added as the last source without the `name` property. | | `cogroupType` | When there are multiple data sources with different `name` properties, this parameter is used to define which records are included in the blended data for this query. Valid values for `cogroupType` are `left`, `right` `inner` `full`. For `left` and `right` blends, the initial dataset or blend is considered the left one. For more information on data blending, see [Explore Multiple Datasets with a Single Query](https://help.salesforce.com/articleView?id=analytics.bi_explorer_data_blending.htm&type=5). | ## Example: Grain Query ```nolang "sources": [ { "columns": [ { "field": "Customer_Name", "name": "Customer_Name" }, { "field": "Customer_Segment", "name": "Customer_Segment" }, { "field": "Product_Name", "name": "Product_Name" }, { "field": "City", "name": "City" }, { "field": "Order_ID", "name": "Order_ID" }, ], "groups": [], "filters": [], "name": "SuperStoreSales" } ] ``` ## Example: Query without groupings When a query isn’t grouped by a dimension, set `groups` to `["all"]` ```nolang "sources": [ { "columns": [ { "field": ["sum", "Amount"] "name": "A" }, ], "groups": ["all"], "filters": [], "name": "SuperStoreSales" } ] ``` ## Example: Query with groupings ```nolang "sources": [ { "columns": [ { "field": ["sum", "Amount"] "name": "A" }, ], "groups": ["Customer_Segment", "Order_priority"], "filters": [], "name": "SuperStoreSales" } ] ``` ## Example: Query with formula column ```nolang "sources": [ { "columns": [ { "field": ["sum", "Amount"] "name": "A" }, { "formula": "case \nwhen starts_with('Product_Container', \"Small|") then null\nelse count()\nend\n", "name": "B" } ], "filters": [], "groups": [ "Order_Priority", "Product_Container" ], "name": "SuperStoreSales" } ] ``` ## Example: Query with columns referencing formulas Formula columns are defined in a separate source without a `name` property. ```nolang "sources": [ { "columns": [ { "field": ["sum", "Amount"] "name": "A" } ], "groups": ["Customer_Segment", "Order_Priority"], "filters": [], "name": "SuperStoreSales" }, { "columns": [ { "forumula": "A*2", "name": "B" }, { "forumula": "B/100",", "name": "C" } ] } ] ``` ## Example: Query with multiple data sources ```nolang "sources": [ { "columns": [ { "field": ["avg", "Profit"] "name": "A" } ], "groups": ["City"], "filters": [], "name": "SuperStoreSales", "cogroupType": "left" }, { "columns": [ { "field": ["sum", "Amount"], "name": "B" } ], "groups": ["City"], "filters": [], "name": "Opportunity" } ] ``` # Special Characters Certain characters have special meanings in SAQL. | Character | Name | Description | | --------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `;` | Semicolon | Used to terminate statements. | | `'` | Single quote | Used to quote identifiers. | | `"` | Double quote | Used to quote strings. | | `()` | Parentheses | Used for function calls, to enforce precedence, for order clauses, and to group expressions. Parentheses are mandatory when you’re defining more than one group or order field. | | `[]` | Brackets | Used to denote arrays. For example, this is an array of strings: `[ "this", "is", "a", "string", "array" ]` Also used for referencing a particular member of an object. For example, `em['miles']`, which is the same as `em.miles`. | | `.` | Period | Used for referencing a particular member of an object. For example, `em.miles`, which is the same as `em['miles']`. | | `::` | Two colons | Used to explicitly specify the dataset that a measure or dimension belongs to, by placing it between a dataset name and a column name. Using two colons is the same as using a period (.) between names. For example: `data = foreach data generate left::airline as airline` | | `..` | Two periods | Used to separate a range of values. For example: `c = filter b by "the_date" in ["2011-01-01".."2011-01-31"];` | # Speed Up Queries with Dataflow Transformations To speed up your queries and reduce the number of network round trips, perform data transformations in the ELT process instead of in the query. ## Example: GEO Field Let’s say you have a dataset with the `GEO` field that contains the value `JP`, and you want to replace this value with `Japan`. One solution is to add a `case` statement to your query. ```nolang q = foreach q1 generate (case when 'GEO' == \"JP\" then \"Japan\" else 'GEO' end) as 'GEO;' ``` Running this query on each row in a dataset is time-consuming. A faster approach is to add the `case` statement to the `saqlExpression` field in the dataflow’s `computeExpression` transformation. Moving the `case` statement from the query to the ELT process reduces the query’s network round trips. ```nolang "parameters": { "source": "Opportunity_Data", "mergeWithSource": true, "computedFields": [{ "name": "GEO", "type": "Text", "label": "GEO" "saqlExpression": "case when 'GEO' == \"JP" then \"Japan\" else 'GEO' end"} ]} ``` **tip:** You can also improve query performance by shortening decimal values in your dataflow. For example, if the numbers in your dataset have a single decimal digit, such as 9.1 or 924.3, set `scale` to 1 rather than 4 in the `computeExpression` transformation. Restricting the decimal value only impacts storage only. SAQL performs query calculations with all decimal values intact. ## Example: Date Format To change the date format, you can add an intermediate query to filter the stream based on the list selector values. Adding an extra filter creates another network trip. Instead, transform the values in the `computeExpression` transformation, which you can use with SAQL date functions. ```nolang "parameters":{ "source":"Opportunity_Data", "mergeWithSource":true, "computedFields":[ { "name":"UIFormattedDate", "type": "Text", "saqlExpression":"date_to_string(toDate(Date_sec_epoch), "yyyy-MM-dd")" } ] }} ``` **See Also** - [Simple case Operator](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-operators-case.md) - [computeExpression Transformation](https://help.salesforce.com/s/articleView?id=bi_integrate_saql_transformation.htm) # SQL for Analytics Developer Guide Previous PDF Versions | API Version | Release | PDF | | ----------- | ---------- | ---------------------------------------------------------------------------------------------------- | | 67.0 | Summer '26 | [Download PDF](https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/bi_dev_guide_sql.pdf) | | 66.0 | Spring '26 | [Download PDF](https://resources.docs.salesforce.com/260/latest/en-us/sfdc/pdf/bi_dev_guide_sql.pdf) | | 65.0 | Winter '26 | [Download PDF](https://resources.docs.salesforce.com/258/latest/en-us/sfdc/pdf/bi_dev_guide_sql.pdf) | | 64.0 | Summer '25 | [Download PDF](https://resources.docs.salesforce.com/256/latest/en-us/sfdc/pdf/bi_dev_guide_sql.pdf) | # SQL for Analytics Release Notes Use the Salesforce Release Notes to learn about the most recent updates and changes to SQL for Analytics. For a list of all current developer changes, including SQL for Analytics, see [CRM Analytics](https://help.salesforce.com/s/articleView?id=release-notes.rn_bi_analytics_cloud.htm) in the Salesforce Release Notes. **note:** If the Analytics Development section in the Salesforce Release Notes isn’t present, there aren’t any updates for that release. # SQL Statements Use a SQL statement to access and perform operations on data from one or more tables in your database. A statement is made up of a series of clauses. It must include the keywords `SELECT` and `FROM`. `SELECT` indicates which columns to retrieve, and `FROM` indicates which tables the columns are in. A statement follows this syntax: ```nolang SELECT COLUMN_NAME FROM TABLE_NAME ``` **note:** Einstein Analytics SQL does not support the use of `*` with the `SELECT` clause. You must specify which columns to retrieve. - **[SELECT Clause](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-select.md)** The `SELECT` clause retrieves columns from a table. # SQL vs SAQL SQL for CRM Analytics and Salesforce Analytics Query Language (SAQL) are both query languages intended for use with CRM Analytics. Here's a guide to their different behaviors and limitations. You can only write SQL queries against datasets. SQL for CRM Analytics doesn't offer support for these features available in SAQL. - Random sampling - Cogrouping - SAQL functions `string_to_number()` and `toString()`. Type casting is unavailable in SQL for CRM Analytics. - Relative date filtering, for example, `Closed_Date` in `["2 years ago".."1 day ago"]` - Date functions such as `day_in_week()`, `date_diff()`, `now()`, `date_to_epoch()`, and `date_to_string()`tc SQL and SAQL have the following differences in behavior. - In a grouped query, SQL returns a group for null values in a grouped query by default. - In SQL, counting all records in an empty dataset returns 0. In SAQL, it returns an empty response. - In SQL, the `GROUPING()` function can take multiple arguments. In SAQL, it takes one argument only. - SAQL’s `DateOnly` type corresponds with SQL for CRM Analytics’s `Date` type. - SAQL’s `DateTime` and `Date` types correspond with SQL’s `Timestamp` type. - In SQL, the `Date` and `Timestamp` types are treated as dates. In SAQL, when timezone is enabled, the `DateOnly` and `DateTime` types are treated as dates. When timezone isn’t enabled, the `DateOnly` and `DateTime` types are treated as strings. - When columns in a `SELECT` statement have the same data types, but different aliases, `UNION ALL` in SQL returns the results in a single column. In SAQL, `union` returns all of the columns. - If your values query (one without a grouping) includes aggregated and non-aggregated fields, SQL throws an error. SAQL handles such queries differently by taking the value of individual rows. In this example, `City` is a non-aggregated field. `Count` and `sum_Profit` are aggregated fields. This SQL query throws an error. ```nolang SELECT City AS "City", COUNT(*) AS "Count", sum(Profit) AS "sum_Profit" FROM "Superstore" LIMIT 100; ``` The corresponding SAQL query yields the sum of `Profit` for each `City`. ```nolang q = load "Superstore"; q = foreach q generate 'City' as 'City', count() as 'count', sum('Profit') as 'sum_Profit'; ``` # sqrt({n}) Returns the square root of a number _n_. The value _n_ can be any non-negative numeric value in the range of 0 \<= _n_ \<= 1.797e308. `sqrt({n})` takes the following syntax. ```nolang SELECT sqrt(N) as AliasName FROM dataset; ``` ## Example This example returns the square root of 64. ```nolang SELECT sqrt(64.0) as SqrtExample FROM Superstore LIMIT 1; ``` | SqrtExample | | ----------- | | 8.0 | # sqrt(n) Returns the square root of a number _n_. The value _n_ can be any non-negative numeric value in the range of 0 \<= _n_ \<= 1e308. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate sqrt(value) as value; q = filter q by sqrt(value) < 10; ``` # starts_with() Returns `true` if the string starts with the specified characters. ## Syntax `starts_with(string, prefix)` ## Usage Returns `true` if _string_ starts with _prefix_, otherwise returns `false`. String comparison is case-sensitive. If any of the parameters are `null`, then the function returns `null`. If _prefix_ is an empty string, then the function returns `null`. ## Example Suppose that you want to count the opportunities where the owner role starts with "Sales". Use `starts_with()` in a `case` statement. ```nolang q = load "DTC_Opportunity"; -- Select rows where the owner roles starts with "Sales" q = foreach q generate count() as 'count', (case when starts_with('Owner_Role', "Sales") then 'Owner_Role' end) as 'Owner_Role'; q = group q by 'Owner_Role'; q = foreach q generate count() as 'count', 'Owner_Role' as 'Owner_Role'; ``` The resulting chart shows the number of opportunities where the owner role starts with "Sales", grouped by owner role. ![Number of opportunities where the owner ID starts with Sales.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_string_sw.png) # starts_with({source_str}, {search_str}) Returns a Boolean indicating whether a string begins with the search string. `STARTS_WITH()` follows this syntax. - _source_str_ - : The string to be searched. - _search_str_ - : The string to search for within the source string. ## Example This example returns a Boolean that confirms whether the value in the `City` field begins with “Hen.” ```nolang SELECT City, STARTS_WITH(City, "Hen") as "startValue" FROM "Superstore" LIMIT 5; ``` | City | startValue | | --------------- | ---------- | | Henderson | true | | Henderson | true | | Los Angeles | false | | Fort Lauderdale | false | | Fort Lauderdale | false | # Statements A SAQL query loads input data, operates on it, and outputs the result data. A query is made up of statements. Each SAQL statement has an input stream, an operation, and an output stream. A statement is made up of keywords (such as `filter`, `group`, and `order`), identifiers, literals, and special characters. Statements can span multiple lines and must end with a semicolon. Assign each query line to an identifier called a stream. The only exception is the last line in a query, which doesn't have to be assigned explicitly. The output stream is on the left side of the `=` operator and the input stream is on the right side of the `=` operator. ## Example Each line in this SAQL query is a SAQL statement. ```nolang q = load "Dataset1"; q = group q by all; q = foreach q generate sum('Amount') as 'sum_Amount'; ``` **See Also** - [filter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-filter.md) - [foreach](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-foreach.md) - [limit](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-limit.md) - [offset](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-offset.md) - [order](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-order.md) # Static Functions Static functions have specialized use in template rules. This page covers static functions in the `math`, `object`, and `sfdc_fma` namespaces. ## `math:pow` Parameters: `Double base`, `Double exponent` Returns: `Double` Recursive: Not supported Description: Returns the value of the first argument raised to the power of the second argument. ### Example This function call: ```json {    "pow": "${math:pow(5, 5)}" } ``` Returns: ```json {    "pow": 3125.0 } ``` ## `math:min` Parameters: `Double a`, `Double b` Returns: `Double` Recursive: Not supported Description: Returns the smaller of the two values. ### Example This function call: ```json {    "min": "${math:min(5, 10)}" } ``` Returns: ```json {    "min": 5.0 } ``` ## `math:max` Parameters: `Double a`, `Double b` Returns: `Double` Recursive: Not supported Description: Returns the greater of the two values. ### Example This function call: ```json {    "max": "${math:max(5, 10)}" } ``` Returns: ```json {    "max": 10.0 } ``` ## `math:round` Parameters: `Double x`, `Int scale` Returns: `Double` Recursive: Not supported Description: Rounds the given value to the specified number of decimal places. ### Example This function call: ```json {    "round": "${math:round(12.983665, 3)}" } ``` Returns: ```json {    "round": 12.984 } ``` ## `object:contains` Parameters: `Object map`, `Object key` Returns: `Boolean` Recursive: Not supported Description: Returns if the map contains a non-null value at the specified key ### Example For the following map: ```json {    "fieldsMap": [{"field1": "ProductName"},                {"field2": "Amount"},                {"field3": "CompanyName"},                {"field4": "Revenue"}] } ``` This function call: ```json {    "contains": "${object:contains(Variables.fieldsMap, 'field3')}" } ``` Returns: ```json {    "contains": true } ``` ## `sfdc_fma:checkInteger` Parameters: `String apiName` Returns: `Int` Recursive: Not supported Description: Returns the integer value of the LMO to subscriber FMA value for `checkPackageIntegerValue`. For more information and examples, see the [Feature Management methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_FeatureManagement.htm#apex_System_FeatureManagement_checkPackageIntegerValue). ## `sfdc_fma:checkBoolean` Parameters: `String apiName` Returns: `Boolean` Recursive: Not supported Description: Returns the boolean value of the LMO to subscriber FMA value for `checkPackageBooleanValue`. For more information and examples, see the [Feature Management methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_FeatureManagement.htm#apex_System_FeatureManagement_checkPackageBooleanValue). ## `sfdc_fma:checkDate` Parameters: `String apiName` Returns: `Date` Recursive: Not supported Description: Returns the date value of the LMO to subscriber FMA value for `checkPackageDateValue`. For more information and examples, see the [Feature Management methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_FeatureManagement.htm#apex_System_FeatureManagement_checkPackageDateValue). # Static Functions Static functions have specialized use in template rules. ## Function Name: math:pow Parameters: Double `a`, Double `b` Returns: Double Recursive: Not supported Description: Returns the value of the first argument raised to the power of the second argument. ## Function Name: math:min Parameters: Double `a`, Double `b` > Returns: Double Recursive: Not supported Description: Returns the smaller of the two values. ## Function Name: math:max> Parameters: Double `a`, Double `b` Returns: Double Recursive: Not supported Description: Returns the greater of the two values. ## Function Name: math:round Parameters: Double `x`, Int `scale` Returns: Double Recursive: Not supported Description: Rounds the given value to the specified number of decimal places. ## Function Name: math:round Parameters: Double `x`, Int `scale` Returns: Double Recursive: Not supported Description: Rounds the given value to the specified number of decimal places. ## Function Name: sfdc_fma:checkInteger Parameters: String `apiName` Returns: Int Recursive: Not supported Description: Returns the integer value of the LMO to subscriber FMA value for `checkPackageIntegerValue`. See [FeatureManagement Class.](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_FeatureManagement.htm) ## Function Name: sfdc_fma:checkBoolean Parameters: String `apiName` Returns: Boolean Recursive: Not supported Description: Returns the boolean value of the LMO to subscriber FMA value for `checkPackageBooleanValue`. See [FeatureManagement Class.](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_FeatureManagement.htm) ## Function Name: sfdc_fma:checkDate Parameters: String `apiName` Returns: Date Recursive: Not supported Description: Returns the date value of the LMO to subscriber FMA value for `checkPackageDateValue`. See [FeatureManagement Class.](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_FeatureManagement.htm) # staticflex Step Type Properties Use the `staticflex` step type to manually define your own set of data. For example, you can use this step to populate a list of static values in a toggle or list widget. It can also be used to provide values to a binding. For example, it can provide possible filters, groups, measures, sort order, and limits. | Field Name | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | Step type. Set to `staticflex`. | | `label` | Step label, which is primarily used for display in the dashboard designer user interface. | | `values` | Values for the static step. You can have multiple fields for each static value, where each field provides different information about the value, like a label, measurement, or range. When the static step is associated with a widget, the widget uses the first specified field as the display label. You can use other fields to specify values or ranges that you can use to facet or bind steps. For more information about binding a static step to another step, see the [Analytics Bindings Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_bindings.meta/bi_dev_guide_bindings/bi_dbjson_bindings.htm). For more information about faceting a static step with another data source, see [Configure Cross-Dataset Faceting with Connected Data Sources](https://help.salesforce.com/articleView?id=bi_dashboard_data_source_connections.htm). If you use the static step wizard to create the step, the step contains the following default fields: `display` and `value`, as shown in the JSON example. You can change these arbitrary field names and add more fields. The values in each field must have the same datatype, like numbers, strings, or arrays. For instance, if a row has `"value": "123"`, another row can't have `"value": [123]`. | | `broadcastFacet` | Controls whether the step's selections are broadcasted as facets. Faceting is when a selection in a widget filters other steps in the dashboard. Default is `true`. To enable this step to broadcast facets, set this property to `true` and connect this step with another data source. This step type can't receive facets. | | `isGlobal` | Not applicable. You can only apply this property on steps that are connected to a global filter widget—all other steps ignore this property. | | `useGlobal` | Indicates whether to apply global filters to this step (`true`) or not (`false`). | | `selectMode` | Determines the selection interaction. The options for charts are: `none`, `single`, and `singlerequired`. The options for list, range, and toggle selectors are: `single`, `singlerequired`, `multi`, and `multirequired`. `selectMode` doesn't apply to number, values table, compare table, date, and global filter widgets. | | `start` | The initial selections that are applied to the step when the dashboard first opens. | Static example `start`: ```nolang "start": { "display": [ "Atlanta" ] } ``` Binding example `start`: ```nolang "start": { "display" : "{{column(LoggedinUserInfo_1.result, [\"ManagerId\"]).asObject()}}" } ``` ## Example: staticflex Step ```nolang "my_opps_1": { "numbers": [], "strings": [], "groups": [], "broadcastFacet": true, "selectMode": "single", "datasets": [], "dimensions": [], "type": "staticflex", "label": "my opps", "values": [ { "display": "All opps", "value": "false" }, { "display": "My opps", "value": "true" } ] } ``` # stddev_pop() Returns the population standard deviation of the values in a field. Accepts measure fields as input. This function does not accept expressions. `stddev_pop()` follows this syntax. ```nolang SELECT stddev_pop(FIELD1, FIELD2) FROM DATASET; ``` # stddev_samp() Returns the standard deviation of values in a field. Accepts measure fields as input. This function does not accept expressions. `stddev_samp()` follows this syntax. ```nolang SELECT stddev_pop(FIELD1, FIELD2) FROM DATASET; ``` # stddev() Returns the standard deviation of the values in a field. Accepts measure fields (but not expressions) as input. ## Example - Look at Variability in Amount Use `stddev()` to get a feel for the amount of spread, or dispersion, in the size of your deals. ```nolang q = load "DTCOpps"; q = group q by all; q = foreach q generate stddev('Amount') as 'stddev_Amount'; ``` ## Should I Use stddev() or stddevp()? Use `stddev()` when the values in your field are a partial sample of the entire set of values (that is, a partial sampling of the whole population). Use `stddevp()` when your field contains the complete set of values (that is, the entire population of values). **See Also** - [stddevp()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-stdevp.md) # stddevp() Returns the population standard deviation of the values in a field. Accepts measure fields as input but not expressions. ## Example - Calculate the Population Standard Deviation of Amount Use `stddevp()` to calculate the population standard deviation of the amount of each opportunity. Group by product family to see which type of product has the greatest variability in deal size. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by 'Product_Family'; q = foreach q generate 'Product_Family' as 'Product_Family', stddevp('Amount') as 'stddevp_Amount'; ``` **See Also** - [stddev()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-stdev.md) # Step 1: Create the WaveTemplate Object Once you’ve created an app to serve as your source app, turn it into a template by creating the `WaveTemplate` object and all its files. You can use CRM Analytics Studio, commands in the CLI or Microsoft Visual Studio (VS) Code to turn your app into a template. To use CRM Analytics Studio, see [Create and Manage CRM Analytics Templates in Analytics Studio](https://help.salesforce.com/s/articleView?id=analytics.bi_create_manage_templates_intro.htm&type=5). To use the commands, first locate the 18-character app ID—the folder ID—for the source app. You can find it appended to the URL for the app (in bold): `https://salesforce.com/analytics/application/00l0b000002AynIAAS/edit` - **[Create a Template with the Command Line Interface](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-create-object-cli.md)** Use `analytics template` commands to create templates with the Salesforce Analytics Command Line Interface (CLI). You can also use the CLI to manage existing templates. - **[Create and Update a Template with Visual Studio Code](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-create-object-vscode.md)** Use Microsoft Visual Studio (VS) code to create and update a template. # Step 2: Retrieve (Export) the WaveTemplate Object CRM Analytics templates are no different than any other metadata (such as Visualforce pages and Apex classes). You can retrieve the `WaveTemplate` object and its JSON files for editing using CLI or Microsoft Visual Studio (VS) Code. Then store them in a source code management system, and work with them using the development environment of your choice. **note:** Performing this step overwrites your template object folder contents. If you’ve edited JSON files (such as `rules.json`), make sure you first push those changes back to the development org as described in [Step 4: Deploy the WaveTemplate Object](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-deploy-object.md). - **[Use the Salesforce CLI to Retrieve the Template Files](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/task/bi-templatesdev-export-using-cli.md)** Pull the template metadata from the scratch org to your local workspace using the Salesforce CLI command `sf project retrieve start`. - **[Use Visual Studio Code to Retrieve the Template Files](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/task/bi-templatesdev-export-using-vscode.md)** Pull the template metadata from the scratch org to your local workspace using the Command Palette **Pull Source from Default Scratch Org**. Use VS Code to view and edit the template files. - **[Template Folder Structure](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-folder-structure.md)** Decompressing the exported template file exposes the following folder structure. # Step 3: Edit the JSON Files Your source app looks fantastic, with widgets rendered beautifully in their dashboards. Next, create a template that gives users the same experience as your app but with data unique to their Salesforce orgs. For standard apps, add a configuration wizard to customize app creation. The wizard helps an admin using your template add data, name a dashboard, label a chart, or add their own touches. For embedded apps, add the `auto-install.json` file. You control the process by editing the files that constitute the template assets, the`template-info.json`, `ui.json`, `variables.json`, and any number of `rules.json` files. These JSON files open a world of flexibility and power in the template creation universe. The files interact as follows: - The `ui.json` file uses the variables in the `variables.json` file to dictate what goes on each page of the wizard. The `ui.json` file can contain conditionals that dictate which questions or pages are displayed in the wizard. - `variables.json` contains all template variables, including text for wizard questions and specifications for the answers. The file can also define conditional questions. For example, a question only appears if an org contains certain data. Or if a wizard question is answered in a way that requires more detail, the wizard presents other conditional questions. - The `template-info.json` file identifies all the template components, including the references to the rules, variables, and UI files. The `template-info.json` file can contain conditionals that dictate whether assets are generated in the downstream app. - The `template-to-app-rules.json` files use variables to set constants, and then use rules to set values that dictate how assets within the downstream app are generated. The most common uses for rules include adding and removing dashboard widgets and dataflow actions. - The `app-to-template-rules.json` file defines templatizing the source app. It’s edited only when you change the source app to change the template. - The `folder.json` file enables you to set a preferred order of the dashboards in the downstream app, as opposed to leaving them alphabetized. - The optional `auto-install.json` file is used when a template is part of a managed package. It defines the auto-install hook and the automated app configuration settings used to generate an auto-install request when the package is installed. This file is created manually, it isn’t generated on template creation. And yet, editing these JSON files is an optional step. A template is complete even without you touching any of these files. Such a minimal template creates apps that mirror the source app without any customization. You can test your template without any editing to validate that app creation works before moving on to more complex customizations. Don’t confuse the template assets discussed here with the JSON files representing the _source app assets_. For example, `dashboard_name.json` and `lens_name.json` are also exported as part of the Metadata API retrieval. We recommend that you alter app assets and widgets in CRM Analytics Studio, remembering to update the template object using Analytics Studio to update the template. That means you don’t manually edit their corresponding JSON files. - **[Wizard Best Practices](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-best-practices.md)** To deliver an optimal user experience, adopt these best practices when creating a wizard. - **[Edit template-info.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-edit-template-info-json.md)** `template-info.json` describes the template. It references all the information required to create an app from the template. - **[Edit folder.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-edit-folder-json.md)** The `folder.json` file describes the `featuredAssets` for the application. - **[Edit auto-install.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-edit-auto-install-json.md)** `auto-install.json` configures the template for the auto-install framework. Always create this optional file if you plan to design your template for auto-installation via a managed package with an auto-install request. - **[Edit org-readiness.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-edit-org-readiness-json.md)** The `org-readiness.json` file configures the validations to run on a user org to ensure it can create an app successfully. - **[Edit variables.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-edit-variables-json.md)** The `variables.json` file describes all the variables used in the `template-info.json`, `ui.json`, and the different `rules.json` files. - **[Edit ui.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-edit-ui-json.md)** The `ui.json` file determines how your template displays the configuration wizard questions defined in `variables.json`. - **[Edit Rules Files](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-edit-rules-json.md)** Rules files define how an app gets created by the template. - **[Use the Apex WaveTemplateConfigurationModifier Class](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-apex-class.md)** The `WaveTemplateConfigurationModifier` class checks an org’s data. Also, to simplify app creation, it can modify the template configuration wizard accordingly. - **[Use the Apex Access Methods](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-apex-access-class.md)** The `Access` class provides utility methods to check Integration User access to sObjects and sObjectFields. Use these methods in your `WaveTemplateConfigurationModifier` implementation. # Step 4: Deploy the WaveTemplate Object After editing its JSON files, deploy the template object back to the development org to see the results of your work and for testing. Deploying your edited files pushes the changes you’ve made to the development org for testing and collaborative development by the rest of your team. Before you deploy your changes, they reside only in your local file system. Deploying your changes overwrites any files in your development org. Retrieving them again from the development org overwrites your local files. - Deploy with CLI. Use the `force:source:push` command to push them back to your scratch org. - Deploy with Salesforce Extensions for Visual Studio Code. Use the Command Palette **Push Source from Default Scratch Org** # Step 5: Test the Template Test the template throughout the development process. After creating the template and exporting its files, you edit them, and then deploy them for testing. Based on the results, reexport the files and edit, deploy, and test again until you’ve achieved the result that you want. 1. Create the source app. 2. Create the template object with CRM Analytics Studio, CLI, or VS Code. **→ Test 1**—Create an app from the unmodified template to make sure that everything works. **note:** CRM Analytics usually tokenizes the template correctly, but there are occasionally problems that require manual editing. Incorrect tokens in the template cause app creation to fail because CRM Analytics doesn't know what to substitute for the incorrect token. When app creation fails, you usually see a message like the following: `Expression error occurred [Error processing expression "${App.Dashboards.SupportingDashboard..Name}". Variable part [SupportingDashboard] not found in context map, check for typo in EL Expression.]`. The message indicates that the referenced piece of the context doesn't exist. To fix that, edit `template-info.json` to add the context piece with the correct name. 3. Create an app from your template. 1. For app templates, create the app from the template in Analytics Studio. You can view the app creation log after app creation completes. With the app open, select **Details**. The **App Log** shows each asset that was created in the order it that was created, the asset status, and the overall app status. If app creation fails, the error messages are logged here. 2. For data templates, create the data assets from the template in Data Manager. 3. For embedded app and data templates, the installation process can be monitored on the Auto-Installed Apps page. For more details on how to find and use this page, see [Monitor, Update, and Delete Auto-Installed Apps](https://help.salesforce.com/s/articleView?id=analytics.bi_auto_install_overview.htm&type=5) 4. To inspect and debug the app in detail, use the App Install History page in Setup. This page contains detailed logs and the runtime state for each install task. For more details, see the [Use the App Install History Page](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-app-install-history.md). 5. Retrieve the template object using CLI or VS Code. 6. Edit the JSON files. 7. Deploy the updates with CLI or VS Code. **→ Test 2**— To evaluate the wizard and the app assets that it creates, create an app from the updated template. 8. Most likely you’ll make many changes, mostly to the template assets, but sometimes also to the source app. 1. Make changes in the source app to the dashboards, lenses, or dataset. Update the template object by using Analytics Studio to update the template, with CLI (`analytics:template:update`), or the VS Code **Update Analytics Template From App** command. These changes probably require more changes to the wizard or other template assets, so export the template files again and edit them. Update the template object again. Run **→ Test 2** again. OR 2. Make changes to the wizard, rules, or variables. Update the template object again. Run **→ Test 2** again. 9. If you’re using Smart Wizard functionality, test the Apex class after you have a fully functional template wizard. Test it to make sure that the Apex class is working as expected; giving variables programmatically assigned values, hiding or changing the visibility of variables and UI pages, giving feedback to the user, and so forth. Save your template in the source control system of your choice, such as GitHub. - **[Use the App Install History Page](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-app-install-history.md)** Use the App Install History page to monitor installations in progress, track the assets created for the app, and view logs to troubleshoot any installation issues. - **[Debug the Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-debug-template-steps.md)** CRM Analytics provides debug logs for templated apps to inspect the app creation lifecycle. These debug logs give you visibility into asset creation and the processing of any rules or Apex configuration modifier classes that you created. Use the debug logs during template testing when app creation isn’t working as expected. - **[Reading the Template Debug Logs](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-read-debug-log.md)** Each `Analytics Templated App Poller` log contains multiple log lines generated from different log events. # Step 6: Share the Template Distribute the template to others in your Salesforce org or other orgs by deploying to the Metadata API. Others with the correct permissions can then retrieve the template object from the Metadata API and make their own contributions. See the Prerequisites section in this document. - Create and install a first or second-generation package with WaveTemplate as the component type. - For templates that create embedded apps via the auto-install framework, to use the install hooks, you must include the `auto-install.json` file in the managed package with the other template files. When your managed package is deployed in a customer org, the app is automatically created from your packaged template with an auto-install request. Each org can only allow 10 auto-install requests to run at one time. If an org has 10 requests that are in progress, any subsequent requests are marked as new and must be manually started from the [Auto-Installed Apps setup page](https://help.salesforce.com/s/articleView?id=analytics.bi_auto_install_overview.htm&type=5). Use this page to monitor auto-install requests and app creation statuses and possible failures. Embedded apps may also be installed using custom Apex pages to generate auto-install requests for app creation. **See Also** - [First-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg1_dev.meta/pkg1_dev/sharing_apps.htm) - [Second-Generation Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp.htm) # Step 7: Create New (Downstream) Apps from the Template Users can now create apps using your template as follows: 1. Create a Standard App 1. In CRM Analytics Studio, select **Create--\>App**. 2. Select the template you shared in the template picker. 3. Follow the configuration wizard! If there were changes made to the template since the downstream app's last use, the user receives a prompt to upgrade the app anytime they open the app. It's important to accept this prompt to keep their downstream apps on the upgrade path and in sync with the source app and the template. 2. Create an Embedded App 1. Install your managed package in a customer org. 2. Verify the embedded app installed in the customer org using the Auto-Installed Apps setup page. Reference details in the [Monitor, Update, and Delete Auto-Installed Apps](https://help.salesforce.com/articleView?id=bi_auto_install_overview.htm&type=5) help. 3. To give users access to the embedded apps dashboard(s), use the Lightning App Builder and CRM Analytics Dashboard component to embed the dashboards(s) inside Salesforce. For details, see [Embed CRM Analytics Dashboards in Lightning Pages](https://help.salesforce.com/articleView?id=bi_embed_lightning.htm&type=5). # Step 8: Update an Existing Template Update a template after changing the source app’s dashboards, lenses, and datasets in CRM Analytics Studio. - Using Analytics Studio. Update the template. For more information, see [Managing Your Templates](https://help.salesforce.com/s/articleView?id=analytics.bi_template_manage.htm&type=5). - Using Analytics CLI. Use the `analytics template update` command. - Using VS Code. Use the **Update Analytics Template** command. **important:** You update a template only after changing the source app in Analytics Studio. When you edit template JSON files in your IDE, you deploy those changes to the template using the CLI or VS Code `push` command. See Step 4, Deploy the WaveTemplate Object. When you update the template, it’s saved to your development org with a new version. For example, the version 1.0 becomes 2.0. You can then update the existing managed package for the template with the new version and deploy it. Admins managing standard apps based on the previous version of the template are prompted to upgrade their apps. Upgraded Apps From New Versions Overwrite Customizations to Downstream Apps **note:** Overwriting customizations applies to standard apps only. Embedded apps can’t be customized by users. If the admin upgrades the app from a new template version, any customizations made to downstream apps are overwritten. To preserve customizations, we advise admins to save customized app assets before upgrading so they can copy the customizations into the new version. Admins can elect to not upgrade from a new version and preserve the original downstream app with its customizations. To help admins determine the value of upgrading, provide details about the new template version in the `releaseNotes.html` file referred to by `template-info.json`. ## Updating the Asset Version When a template is created from an app, each asset is represented as a JSON file, generated at the current API version. The API version is stored as the `assetVersion` in `template-info.json`. When the template is installed in an org and used, in each subsequent release the Analytics assets are created using the template `assetVersion`, not the current API version. Updating the `assetVersion` allows the template to provide the latest features for the assets in the app. **note:** Updating a template without specifying the assetVersion downgrades assets to the `assetVersion` stored in `template-info.json`, even if the asset was created or updated at the current API version. Recipes are the only assets that are always created and updated with the current API version. To update the API version of the template assets, the `assetVersion` must be specified on the template update call via the CLI. The `assetVersion` takes an `Integer` that is a valid Salesforce API version. For the CLI, use the `-v` parameter to specify the `assetVersion`. For example, `analytics:template:update -v 54.0`. Specifying the `assetVersion` on a template update impacts all the template assets, including dashboards, datasets, and dataflows. Recipe assets are always created with the current API version, regardless of the `assetVersion`. We recommend template developers complete these steps when updating the `assetVersion`. - Retain a copy of the template before using the update call, in case template assets fail to update as expected. - Test the template update by creating apps in a test org. Verify that the updated assets work and have the new features for the version. - If there are template rules, it’s possible the JSON path attributes must be corrected to reflect any changes made by the `assetVersion` update. Test that all rules and any conditionals still work. # Step One: Obtain a Salesforce Developer Edition Organization Set up a Developer Edition organization for testing your code. To create a Developer Edition org, go to [`developer.salesforce.com/signup`](https://developer.salesforce.com/signup) and follow the instructions for signing up for a Developer Edition organization. If you already have a Developer Edition organization, verify that your user profile has the API Enabled permission. This permission is enabled by default, but may have been changed by an administrator. For more information, see Salesforce Help. # Step Three: Make an HTTP Request to Run a Report Use cURL or Workbench to obtain data about your organization. ## Run a Report with Workbench You can use the Workbench REST Explorer to make HTTP requests to Salesforce and obtain response data. 1. Log in to your organization. 2. Open a new browser tab and navigate to `https://developer.salesforce.com/page/Workbench`. 3. Log in to Workbench and allow access to your organization. Workbench is a public site and doesn’t retain your data. 4. Click **Utilities** | **REST Explorer**. 5. Choose **GET** as the HTTP method. The Execute text box is prepopulated with a portion of a resource path. Add the remaining information for your resource. For example, if your cURL syntax is ```nolang https://MyDomainName.my.salesforce.com/services/data/66.0/analytics/reports -H "Authorization: Bearer token" ``` type ```nolang /services/data/66.0/analytics/reports ``` 6. Click **Execute**. 7. Click **Expand All** or **Show Raw Response** to view your data. Show Raw Response shows the JSON format response **tip:** If you receive a “Service not found” message, verify your resource path. ## Run a Report with cURL # Step Two: Authorize Before working with the Reports and Dashboards REST API, get approval with Salesforce using OAuth. Salesforce uses the OAuth protocol to securely connect applications. To learn more about Salesforce authorization with OAuth, see [Authorize Apps with OAuth](https://help.salesforce.com/articleView?id=remoteaccess_authenticate.htm) in the *Salesforce Help*. To walk through the authorization process, see [Step Two: Set Up Authentication](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/quickstart_oauth.htm) in the Salesforce REST API Developer Guide. # steps JSON The `steps` key defines all steps available in a CRM Analytics dashboard. It contains a separate node for each step. Each step node has properties that define the query or list of static values. It also contains properties that control the behavior of the step, like whether to facet the step. The properties and JSON syntax vary based on the step type and whether the step is in compact form or SAQL form. - **[aggregateflex Step Type Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-types-aggregateflex.md)** Use the `aggregateflex` step type to perform aggregate queries on a Analytics dataset. An aggregate query summarizes rows, like returning one row per grouping. For example, this step type can return the total amount per sales rep. - **[apex Step Type Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-types-apex.md)** Use to include custom Apex functionality in a dashboard to access Salesforce platform features that aren’t inherently supported in Analytics. For example, pull in data using any API, manipulate data using your Apex classes, or apply simple case statements or complex machine learning. You can even harness AppExchange for things like integrating Twitter with Analytics—all in a way that is familiar. - **[columns Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-columns.md)** Use the `columns` property to add a column to a step query source in Compact form 2.0. - **[grain Step Type Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-types-grain.md)** Use the `grain` step type for a values table. Values tables have no groupings, just a list of dataset fields to display as columns in the table. - **[saql Step Type Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-types-saql.md)** Use the `saql` step type for special cases when querying a Analytics dataset. With this step type, you can write a custom SAQL query to create derived fields in a values table. You can specify dimensions without groupings. Also, you can bind the dataset name or entire query. For example, you can bind this step type to a static step that provides different SAQL queries or datasets based on a selection. - **[soql Step Type Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-types-soql.md)** Use to directly query Salesforce objects—both standard and custom—to get Salesforce data that’s not available in datasets. You can also query external objects created with an OData adapter for Salesforce Connect. To view the results in the dashboard, the user viewing the dashboard must have access to the object and fields queried by the `soql` step. The SOQL query returns only records to which the user has access. - **[source Step Type Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-sources.md)** Use the `sources` property to add `columns`, `groups`, `filters`, and formulas to a step query. - **[staticflex Step Type Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-types-staticflex.md)** Use the `staticflex` step type to manually define your own set of data. For example, you can use this step to populate a list of static values in a toggle or list widget. It can also be used to provide values to a binding. For example, it can provide possible filters, groups, measures, sort order, and limits. - **[visualizationParameters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-visualizationparameters-properties.md)** The `visualizationParameters` key contains chart properties defined for the step. When you associate the step with a widget, the widget properties override these settings. - **[filters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-filters.md)** Use the `filters` property to add a filter to a step query. Although you can create filters for query steps in the user interface, you have to manually define filters for static steps in the dashboard JSON. # steps Properties for Compact Form and SAQL Form The properties and JSON syntax in the `query` node of an `aggregateflex` step type vary based on whether the step is in compact form or SAQL form. These examples display the `aggregateflex`step type in compact form and in SAQL form. For an explanation of the `aggregateflex` step type and its properties, see [aggregateflex Step Type Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-steps-types-aggregateflex.md) ## Example: Compact-Form aggregateflex Step ```nolang "steps": { "all_Amount_1": { "type": "aggregateflex", "query": { "measures": [ [ "avg", "Amount" ] ], "groups": [ "Account_Name" ], "order": [ [ "avg_Amount", { "ascending": false } ] ] }, "visualizationParameters": { "options": {}, "type": "chart", "parameters": { "visualizationType": "hbar", "autoFitMode": "keepLabels", "theme": "wave", "title": { "label": "", "fontSize": 14, "subtitleLabel": "", "subtitleFontSize": 11, "align": "center" }, "showValues": true, "axisMode": "multi", "binValues": false, "bins": { "breakpoints": { "low": 0, "high": 100 }, "bands": { "low": { "label": "", "color": "#B22222" }, "medium": { "label": "", "color": "#ffa500" }, "high": { "label": "", "color": "#008000" } } }, "dimensionAxis": { "showAxis": true, "showTitle": true, "title": "", "customSize": "auto", "icons": { "useIcons": false, "iconProps": { "column": "", "fit": "cover", "type": "round" } } }, "measureAxis1": { "sqrtScale": false, "showAxis": true, "customDomain": { "showDomain": false }, "showTitle": true, "title": "" }, "measureAxis2": { "sqrtScale": false, "showAxis": true, "customDomain": { "showDomain": false }, "showTitle": true, "title": "" }, "legend": { "show": true, "showHeader": true, "inside": false, "descOrder": false, "position": "right-top", "customSize": "auto" }, "tooltip": { "customizeTooltip": false, "showDimensions": true, "dimensions": "", "showMeasures": true, "measures": "", "showPercentage": true, "showNullValues": true, "showBinLabel": true }, "trellis": { "enable": false, "showGridLines": true, "flipLabels": false, "type": "x", "chartsPerLine": 4, "size": [ 100, 100 ] }, "applyConditionalFormatting": true, "showActionMenu": true, "columnMap": { "trellis": [], "plots": [ "avg_Amount" ], "dimensionAxis": [ "Account_Name" ] } } }, "datasets": [ { "id": "0Fb6g000000HTE1CAO", "name": "DTC_Opportunity_SAMPLE", "label": "DTC Opportunity", "url": "/services/data/v48.0/wave/datasets/0Fb6g000000HTE1CAO" } ], "useGlobal": true, "isGlobal": false, "label": "all_Amount_1", "broadcastFacet": true, "receiveFacetSource": { "mode": "all", "steps": [] }, "selectMode": "single" }, ``` ## Example: SAQL-Form aggregateflex Step When the step is in SAQL form, notice how each group and measure are defined in the `groups` and `measures` properties, respectively, and also in the `pigql` property. Other parts of the query—like filters, limits, and order—only need to be defined one time in the `pigql` property. You specify the compact form elements of `"groups"` and `"measures"` so that the associated chart widget can render the correct projections. In the following sample step, notice that the `'sum_Amount'` and `'sum_quantity'` projections in the `pigql` property are referenced in `"measures"` as `[[ "count", "*", "sum_Amount" ], [ "count", "*", "sum_quantity" ]]`. Measure projections in the `pigql` property always include the aggregation, underscore (`_`), and the name of the measure (`'sum_Amount'`) so that they can be referenced in the compact form. ```nolang "steps": { "Product_StageName_2": { "type": "aggregateflex", "visualizationParameters": { "options": {} }, "query": { "pigql": "q = load \"Flexy_Sales\";\n q = group q by ('Product', 'StageName');\n q = foreach q generate 'Product' as 'Product', 'StageName' as 'StageName', sum('Amount') as 'sum_Amount', sum('quantity') as 'sum_quantity';\n q = filter q by 'sum_Amount' >= 14550720 && 'sum_Amount' <= 58807698;\n q = order q by 'sum_Amount' desc;\nq = limit q 10000;", "measures": [ [ "count", "*", "sum_Amount" ], [ "count", "*", "sum_quantity" ] ], "groups": [ "Product", "StageName" ] }, "broadcastFacet": true, "receiveFacetSource": { "mode": "all", "steps": [] }, "useGlobal": true, "isGlobal": false, "datasets": [{ "name": "Flexy_Sales", "url": "/services/data/v38.0/wave/datasets/0FbB00000000q5gKAA", "id": "0FbB00000000q5gKAA" }] } } ``` # `string` Functions Use `string` functions in rules to manipulate text strings in asset JSON at runtime. For instance, a `string` function can replace all occurrences of one string with another or convert strings from uppercase to lowercase. If a user enters a dashboard title in the wizard using all lowercase letters, the `string` function changes the text to sentence case at runtime. ## `toUpperCase` Parameters: `Object object` Returns: `Object` Recursive: Supported Description: Converts all characters in an object to uppercase. The object can be a single string or a JSON object with multiple strings ### Example This sample JSON: ```json "objecttest" : { "obj" : {     "greeting1" : "hello world",     "greeting2" : "salut world", "greeting3" : "hallo world" }, "list" : ["hello world", "salut world", "hallo world"] } ``` And the rule: ```json {    "action": "set",    "description": "Convert all strings to upper case",    "path": "$.objecttest",    "value" : "${string:toUpperCase(Rules.CurrentNode)}" } ``` Returns: ```json "objecttest" : { "obj" : { "greeting1" : "HELLO WORLD", "greeting2" : "SALUT WORLD", "greeting3" : "HALLO WORLD" }, "list" : ["HELLO WORLD", "SALUT WORLD", "HALLO WORLD"] } ``` ## `toLowerCase` Parameters: `Object object` Returns: `Object` Recursive: Supported Description: Converts all characters in a string to lowercase. ### Example This sample JSON: ```json "objecttest" : { "obj" : { "greeting1" : "Hello World", "greeting2" : "Salut World", "greeting3" : "Hallo World" }, "list" : ["Hello World", "Salut World", "Hallo World"] } ``` And the rule: ```json {    "action": "set",    "description": "Convert all strings to lower case",    "path": "$.objecttest",    "value" : "${string:toLowerCase(Rules.CurrentNode)}" } ``` Returns: ```json "objecttest" : { "obj" : { "greeting1" : "hello world", "greeting2" : "salut world", "greeting3" : "hallo world" }, "list" : ["hello world", "salut world", "hallo world"] } ``` ## `replace` Parameters: `Object object`, `String oldStr`, `String newStr` Returns: `Object` Recursive: Supported Description: Returns a new object with all occurrences of `oldStr` replaced with `newStr`. ### Example This sample JSON: ```json "objecttest" : { "obj" : { "greeting1" : "Hello World" }, "list" : ["Hello World"] } ``` And the rule: ```json {    "action": "set",    "description": "Replace all Hello instances with Goodbye",    "path": "$.objecttest",    "value" : "${string:replace(Rules.CurrentNode, 'Hello', 'Goodbye')}" } ``` Returns: ```json "objecttest" : { "obj" : { "greeting1" : "Goodbye World" }, "list" : ["Goodbye World"] } ``` ## `replaceAll` Parameters: `Object object`, `String regex`, `String newStr` Returns: `Object` Recursive: Supported Description: Replaces all substrings of this string that match the given [regular expression](https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#sum). ### Example This sample JSON: ```json "objecttest" : { "obj" : { "greeting1" : "Hello World" }, "list" : ["Hello World"] } ``` And the rule: ```json {    "action": "set",    "description": "Replace all 'l' instances with 'L'",    "path": "$.objecttest",    "value" : "${string:replaceAll(Rules.CurrentNode, 'l.?', 'L')}" } ``` Returns: ```json "objecttest" : { "obj" : { "greeting1" : "HeLLo WorLd" }, "list" : ["HeLLo WorLd"] } ``` ## `replaceFirst` Parameters: `Object object`, `String regex`, `String newStr` Returns: `Object` Recursive: Supported Description: Replaces the first substring of this string that matches the given [regular expression](https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#sum). ### Example This sample JSON: ```json "objecttest" : { "obj" : { "greeting1" : "Hello World" }, "list" : ["Hello World"] } ``` And the rule: ```json {    "action": "set",    "description": "Replace the first 'l' instance with 'L'",    "path": "$.objecttest",    "value" : "${string:replaceFirst(Rules.CurrentNode, 'l.?', 'L')}" } ``` Returns: ```json "objecttest" : { "obj" : { "greeting1" : "HeLlo World" }, "list" : ["HeLlo World"] } ``` ## `split` Parameters: `Object object`, `String regex` Returns: `Object` Recursive: Supported Description: Parses a string and splits it into an array defined by the specified delimiter represented by the given [regular expression](https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#sum). ### Example This function call: ``` ${string:split('one:two:three', ':')} ``` Results in array of strings: ``` ['one','two','three'] ``` ## `match` Parameters: `Object object`, `String regex` Returns: `Object` Recursive: Supported Description: Performs complex regular expression matching and returns an array of matching results. ### Example To capture items surrounded by square double quote and square brackets: ```json { "match" : "${string:match('[\"foo\"][\"bar\"][\"baz\"]', '\\[\\\"(.*?)\\\"\\]')}" } ``` Returns the following array: ```json { "match" : "[\"foo\",\"bar\",\"baz\"]" } ``` ## `join` Parameters: `Object object`, `String delimiter` Returns: `Object` Recursive: Supported Description: Creates a string from an array of strings and separates each item by the specified delimiter. ### Example This function call: ``` ${string:join(['foo','bar','baz'], ':')} ``` Results in: ``` "foo:bar:baz" ``` ## `qualifyNamespace` Parameters: `String name` Returns: `String` Recursive: Not supported Description: Adds a Salesforce namespace and the `__` delimiter to a given name if a namespace is available. If there is no namespace, the name is returned without alteration. ### Example This sample JSON: ```json {    "fieldName" : "myName" } ``` With: ```json "${string:qualifyNamespace(Variables.fieldName)}" ``` Returns: ```json {    "fieldName" : "myNamespace__myName" } ``` ## `hash` Parameters: `Object object`, `int length` Returns: `Object` Recursive: Supported Description: Returns the hash value for the given string. Useful for determining Salesforce ID lengths and uniqueness. Uses the SHA-256 algorithm to determine the hash value. ### Example This function call returns a truncated hash value: ```json { "hash" : "${string:hash('00D000000000001EAA', 5)}" } ``` Results in: ```json { "hash" : "336d4" } ``` # string Functions Use `string` functions in rules to manipulate text strings in asset JSON at runtime. For instance, a string function can replace all occurrences of one string with another or convert strings from uppercase to lowercase. If a user enters a dashboard title in the wizard using all lowercase letters, the string function changes the text to sentence case at runtime. ## toUpperCase Parameters: Object Returns: Object Recursive: Supported Description: Converts all characters in an object to uppercase. The object can be a single string or a JSON object with multiple strings ## Example This JSON ```nolang    "objecttest" : {        "obj" : {            "greeting1" : "hello world",            "greeting2" : "salut world",            "greeting3" : "hallo world"        },        "list" : ["hello world", "salut world", "hallo world"]    }, ``` And the rule: ```nolang {    "action": "set",    "description": "Convert all strings to upper case",    "path": "$.objecttest",    "value" : "${string:toUpperCase(Rules.CurrentNode)}" } ``` Returns: ```nolang "objecttest" : {        "obj" : {            "greeting1" : "HELLO WORLD",            "greeting2" : "SALUT WORLD",            "greeting3" : "HALLO WORLD"        },        "list" : ["HELLO WORLD", "SALUT WORLD", "HALLO WORLD"]    }, ``` ## toLowerCase Parameters: Object Returns: Object Recursive: Supported Description: Converts all characters in a string to lowercase. ## replace Parameters: Object `obj`, String `oldStr`, String `newStr` Returns: Object Recursive: Supported Description: Returns a new object with all occurrences of `oldStr` replaced with `newStr`. ## replaceAll Parameters: Object `obj`, String `regex`, String `newStr` Returns: Object Recursive: Supported Description: Replaces all substrings of this string that match the given [regular expression](https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#sum). ## replaceFirst Parameters: Object `obj`, String `regex`, String `newStr` Returns: Object Recursive: Supported Description: Replaces the first substring of this string that matches the given [regular expression](https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#sum). ## split Parameters: Object `obj`, String `regex` Returns: Object Recursive: Supported Description: Parses a string and splits it into an array defined by the specified delimiter. For example: ```nolang ${string:split('one:two:three', ':')} ``` Results in array of strings: ```nolang ['one','two','three'] ``` If more complex regular expression matching is required, use `match` (next). ## match Parameters: Object `obj`, String `regex` Returns: Object Recursive: Supported **Description:** Performs complex regular expression matching and returns an array of matching results. For example, to capture items surrounded by square single quote and square brackets: ```nolang ${string:match('['foo']['bar']['baz']', '\\\\[\\'(.*?)\\'\\\\]') ``` Returns the following array: ```nolang foo
 bar baz ``` ## join Parameters: Object `obj`, String delimiter Returns: Object Recursive: Supported Description: Creates a string from an array of strings and separates each item by the specified delimiter. ```nolang ${string:join(, )} ``` # String Functions Use SAQL string functions to format your measure and dimension fields. - **[ascii()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-ascii.md)** Returns the UTF-8 code value of a character _n_. - **[chr()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-chr.md)** Returns the UTF-8 character of integer _n_. - **[ends_with()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-ew.md)** Returns `true` if the string ends with the specified characters. - **[index_of()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-io.md)** Returns the location (index) of the specified characters. - **[len()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-len.md)** Returns the number of characters in the string. - **[lower()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-lower.md)** Returns a copy of the string with all characters in lower case. - **[ltrim()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-ltrim.md)** Removes the specified characters from the beginning of a string. - **[mv_to_string()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-mts.md)** Converts multivalue fields to string fields. - **[number_to_string](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-nts.md)** Converts a number literal to a string literal. - **[replace()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-replace.md)** Replaces a substring with the specified characters. - **[rtrim()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-rtrim.md)** Removes the specified characters from the end of a string. - **[starts_with()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-sw.md)** Returns `true` if the string starts with the specified characters. - **[string_to_number](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-stn.md)** Converts a string literal to a number literal. - **[substr()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-substr.md)** Returns a substring that starts at the specified position. You can also specify the length of the substring to return. - **[trim()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-trim.md)** Removes the specified substring from the beginning and the end of a string. - **[upper()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-string-up.md)** Returns a copy of the string with all characters in upper case. # String Functions and Operators SQL for CRM Analytics supports the following string functions and operators. - **[ascii(char)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-ascii.md)** Returns UTF-8 numeric value of the specified character. Returns `null` if `{n}` is `null`. - **[chr(int)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-chr.md)** Returns the UTF-8 character for integer `n`. Returns `null` if `{n}` is `null`. - **[char_length(str)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-char-length.md)** Returns the number of characters in a given string. - **[ends_with(source_str, search_str)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-ends-with.md)** Returns a Boolean indicating whether a string ends with the search string. - **[index_of(source_str, search_str, [position,occurrence])](bi-sql-string-index-of.md)** Returns a boolean indicating whether a string ends with the search string. - **[lower(str)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-lower.md)** Returns a copy of string _str_ with all cased characters converted to lowercase. - **[mv_to_string(multivalue_column_name, [delimeter])](bi-sql-string-mts.md)** Converts multivalue fields to string fields. - **[position(search_str IN source_str)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-position.md)** Returns an integer that indicates the first occurrence of a substring in a given string. If the substring is not found, the function returns 0. - **[replace(str, old_str, new_str)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-replace.md)** Replaces all occurrences in string _str_ of a substring _old_str_ with a new substring _new_str_. Returns a new string. - **[starts_with(source_str, search_str)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-starts-with.md)** Returns a Boolean indicating whether a string begins with the search string. - **[substring(str FROM start FOR length)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-substring.md)** Returns a substring from string _str_ that begins with the character at the _start_ position. - **[trim(LEADING | TRAILING | BOTH, chars, str)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-trim.md)** Removes leading or trailing characters from a string. If no characters are specified, the function removes blank spaces. - **[upper(str)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-upper.md)** Returns a copy of string _str_ with all cased characters converted to uppercase. # String Literals A string is a set of characters inside double quotes ("). Example: `"This is a string."` This example uses valid syntax: ```nolang accounts = load "Data"; opps = load "0Fcyy000000002qCAA/0Fcyy000000002WCAQ"; c = group accounts by 'Year', opps by 'Year'; d = foreach c generate opps.Year as 'Year'; e = filter d by Year == "2002"; ``` **note:** Identifiers are either unquoted or enclosed in single quotation marks. # String Operators To concatenate strings, use the plus sign (+). | Operator | Description | | -------- | ----------- | | `+` | Concatenate | ## Example To combine the year, month, and day into a value that’s called `CreatedDate`: `q = foreach q generate Id as Id, Year + "-" + Month + "-" + Day as CreatedDate;` # string_to_number Converts a string literal to a number literal. ## Syntax `string_to_number(string)` ## Usage If the string can't be parsed as a number or contains a separator, such as a comma, the query fails. ## Example ```nolang -- creates a field called "Number" that contains the number 12345 q = foreach q generate string_to_number("12345") as 'Number'; ``` # Structuring and Organizing Rules The rules section of `template-to-app-rules.json` defines the rules followed by the template. The section is made up of three parts: - Action: Designates the operation to perform. - Path: Defines the path to the location where the action is performed. - AppliesTo: Determines the asset files to apply the rules to. Consists of a name. Rules can be divided into multiple files, which are executed in the order in which you list them in `template-info.json`. Be sure that a rule that runs first doesn’t refer to a constant referenced in a rule that runs later. Here are a few guidelines to consider when working with multiple rules files: - One rules file can contain all constants, another all actions. - Use multiple rules when actions grow to 500 lines. You could divide them into a rules file for dashboards, another for datasets or the dataflow. - If you have content to be used by many rules, include it in the first rules file to be executed. Here is a simple example, a rule for changing the title text on a dashboard: ```nolang { "name": "Update dashboard title", "appliesTo": [ { "type": "dashboard", "name": "DashboardOne" } ], "actions": [ { "action": "set", "description": "change the title text of the dashboard", "path": "$.state.widgets.title_text.parameters.text", "value": "${Variables.DashboardTitle}" } ] } ``` Make rules more powerful using functions. See [Use Functions in Rules](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-functions.md). # style Properties The `style` key contains the dashboard properties, like cell spacing in the grid, as well as the dashboard's background color or image.
Property NameTypeDetails
alignmentXString

The horizontal alignment of the background image applied to the dashboard.

Valid values are: left (default), center, and right.

Included in the Dashboard Designer's user interface.

alignmentYString

The vertical alignment of the background image applied to the dashboard.

Valid values are: top (default), center, and bottom.

Included in the Dashboard Designer's user interface.

backgroundColorString

Background color of the dashboard, specified in hex color code. The default is #FFFFFF. Included in the Dashboard Designer's user interface.

cellSpacingXInteger

Horizontal spacing (in pixels) between cells in the dashboard grid.

Valid values are 0, 4, 8 (default), and 16.

Included in the Dashboard Designer's user interface.

cellSpacingYInteger

Vertical spacing (in pixels) between cells in the dashboard grid.

Valid values are 0, 4, 8 (default), and 16.

Included in the Dashboard Designer's user interface.

documentIdStringThe 15-character document ID of the image to apply as the dashboard's background. To ensure security, upload the image file to Salesforce as a document, and select the Externally Available Image option. If this option is not selected or the referenced document is not an image, the image doesn't show up. Included in the Dashboard Designer's user interface.
fitStringIndicates how to scale the image.

Valid values are: original (default), stretch, tile, fitwidth, and fitheight.

Included in the Dashboard Designer's user interface.

imageArray

Identifies the image using the following properties.

  • name: Name of the image.

  • namespace: Optional. Namespace of the image. Default is null.

Included in the Dashboard Designer's user interface.

## image Example ```nolang "image": { "name": "My_Corporate_Logo", "namespace": "" } ``` # Subquery A subquery is a query that is nested inside a `SELECT` statement. Nesting queries allows you to perform multi-step operations. A subquery follows this syntax. ```nolang SELECT field FROM ( SELECT_STATEMENT || UNION_ALL ) ``` To pass fields to a math or string function in a subquery, include it in the outer query’s `WHERE` clause. If you use it in the innermost query, SQL throws an error. ## Simple Example This query returns the sum of all profits and the max profit value from the Superstore dataset where all the profits are greater than zero. Values greater than zero mean that no losses are reflected in the results. ```nolang SELECT d.sumProfit, maxProfit FROM ( SELECT SUM(Profit) as sumProfit, MAX(Profit) as maxProfit FROM ( SELECT Profit FROM "Superstore" WHERE Profit > 0 ) ) as d; ``` CRM Analytics first runs the innermost query: `SELECT Profit FROM "Superstore" WHERE Profit > 0`. The output from this query becomes the dataset on which the outer query operates. ```nolang SELECT SUM(Profit) as sumProfit, MAX(Profit) as maxProfit FROM (INNERMOST QUERY); ``` Optionally, you can refer to an inner query by its alias, if you choose to use one. In the outermost query, you can refer to `sumProfit` as `d.sumProfit`, as shown in the example, or you can refer to it simply as `sumProfit`. ```nolang SELECT d.sumProfit, maxProfit FROM (NESTED SUBQUERIES as d); ``` | sumProfit | maxProfit | | ---------- | --------- | | 442,649.60 | 8,399.98 | ## Subqueries with UNION ALL The `UNION ALL` operator combines the results of two datasets into one. It doesn't remove any duplicate rows. This example includes `UNION ALL` after a subquery. The first part of this example, up to the `UNION ALL` statement, returns the total profit and the maximum profit values from the Superstore dataset. After the `UNION ALL` statement, the query returns the total and maximum profit values from the ClearanceSales dataset. Note that ClearanceSales is intended for example purposes only. ```nolang SELECT d.sumProfit as total, maxProfit as max_profit FROM ( SELECT SUM(Profit) as sumProfit, MAX(Profit) as maxProfit FROM ( SELECT Profit FROM "Superstore" WHERE Profit > 0 ) ) as d UNION ALL ( SELECT SUM("Profit") as total, MAX("Profit") as max_profit FROM "ClearanceSales" GROUP BY () ) ``` | total | max_profit | | ---------- | ---------- | | 442,649.60 | 8,399.98 | | 286,397.02 | 4,519.50 | You can also include `UNION ALL` within a subquery. This example finds all the names in the Superstore and Opportunity datasets that contain "an." The outer query then filters for names that have counts over 30 and returns that subset of results. ```nolang SELECT Customer_Name as "name", "count" FROM ( (SELECT Customer_Name, count(*) as "count" FROM "Superstore" WHERE Customer_Name LIKE '%an%' GROUP BY Customer_Name ) UNION ALL ( SELECT User_Name as "name", count(*) as "count" FROM "Opportunity" WHERE User_Name LIKE '%an%' GROUP BY User_Name ) ) WHERE "count" > 30 ``` | name | count | | ---------------- | ----- | | Emily Phan | 31 | | Jonathan Doherty | 32 | | Matt Abelman | 34 | | Han Solo | 654 | | Indiana Jones | 583 | # substr() Returns a substring that starts at the specified position. You can also specify the length of the substring to return. ## Syntax ``substr`(string,position[, length])` ## Usage substr returns the characters in _string_, starting at position _position_. If you specify _length_, this function returns _length_ number of characters. If any of the parameters are _null_, then the function returns _null_. _length_ is optional. The first character in _string_ is at position 1. If _position_ is negative then the position is relative to the end of the string. So a _position_ of -1 denotes the last character. If _length_ is negative, then the function returns _null_. If _position_ > len (_string_) or _position_ \< -len(_string_) or _position_ = 0, then the empty string is returned. ## Example ```nolang -- we want a substring that is one character long, starting at position 1. -- The character "C" is returned. substr("CRM", 1, 1) -- we want a substring that is 2 characters long, starting at position 1 -- The string "CR" is returned substr("CRM", 1, 2) == "CR" -- we want a substring that is two characters long, starting from the *end* of the string -- The string "RM" is returned substr("CRM", -2, 2) == "RM" -- we want to get the first 10 characters from this string -- the string "2018-03-16" is returned substr("2018-03-16T00:00:03.000Z",10) ``` ## Example Suppose that you want to display the current time, but not the current date. Use `substr()` to return the last 11 characters from `date_to_string()` . ```nolang q = foreach q generate substr(date_to_string(now(), "yyyy-MM-dd HH:mm:ss"), -11) as 'Time Now'; ``` # substring({str} FROM {start} FOR {length}) Returns a substring from string _str_ that begins with the character at the _start_ position. **note:** The substring function isn’t supported in Analytics Studio. An error occurs when the function is used in the UI. The function is available using the Query API. For more information, see [Query CRM Analytics Data with the Query API](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_rest_api_query_data.htm). - `start` - : Required. The starting position of the substring. This is the first character of the substring. The value can be positive or negative. If positive, the position is taken from the beginning of the string. If negative, the position is taken from the end of the string. - `length` - : Optional. The length of the substring, beginning at the _start_ position. If no value is provided, `substring()` extracts characters from the _start_ position through the end of the string. ## Example This example extracts the first three letters from each City field. ```nolang SELECT City, SUBSTRING(City FROM 1 FOR 3) as CityCode FROM "Superstore" GROUP BY City LIMIT 5; ``` | City | CityCode | | ----------- | -------- | | Aberdeen | Abe | | Abilene | Abi | | Akron | Akr | | Albuquerque | Alb | | Alexandria | Ale | # sum() Returns the sum of a numeric field. ## Example - Calculate the Total Meeting Time Suppose that you have a database of meeting information. Use `sum()` to see that the total time spent meeting with each account. ```nolang q = load "Meetings"; q = group q by 'Company'; q = foreach q generate 'Company' as 'Company', sum('MeetingDuration') as 'sum_meetings'; ``` # sum() Returns the sum of all rows values in a numeric column. `sum()` follows this syntax. ```nolang SELECT sum(COLUMN_NAME) FROM DATASET WHERE CONDITION; ``` Tableau Next Connect REST API # Tableau Next Connect REST API Use the Tableau Next REST APIs to manage dashboards, metrics, annotations, worksheets, templates, subscriptions, and related Tableau Next analytics resources. **Version:** latest ## Servers * `https://{MyDomainName}.my.salesforce.com/services/data/v67.0` ## Tags ### Assets Work with the relationships between Tableau Next assets. Use these operations to clone an asset, compare two assets, list the assets that a given asset depends on, and retrieve an asset's inner reference assets. An _asset_ is any Tableau Next object—such as a workspace, visualization, dashboard, data source, or semantic model. For managing access to and sharing of assets, see the **Records** category. ### Dashboards Tableau Next dashboards bring together multiple components — visualizations, metrics, and custom Lightning web components — into a single, interactive view of your data, with shared filters and parameters so that users can explore related insights in one place. A dashboard can also have custom views that capture a user's filter and parameter selections. For more information, see [Create Visualizations and Dashboards in Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_create.htm&type=5). Dashboard operations enable you to: * Get a list of dashboards available to the user. * Create a new dashboard. * Get, update, or delete a dashboard by ID or name. * Get a dashboard bundle by ID or name. * Get a list of custom views for a dashboard, or create a custom view. * Get the default custom view for a dashboard, or get a custom view by ID. * Delete a custom view of a dashboard. * Get a dashboard from a template. ### Follow (Followers) Tableau Next followers operations enable you to: * Get the count of unique followers for a specified Tableau Next asset. * Unfollow a specified Tableau Next asset for a specified user. * Get a list of followers of a followed Tableau Next asset. * Add a follower of a specified Tableau Next asset. * Update a follower of a specified Tableau Next asset. * List the followed Tableau Next assets of a user. ### Marketplace Share and reuse Tableau Next assets through the marketplace. Use these operations to browse marketplace listings, publish an asset as a listing, unpublish a listing, install a listing into a workspace, and track the progress of an installation. A _listing_ is a packaged asset made available for others to install. When you install a listing, its _package_ is unpacked into your workspace; use the package-components operation to inspect what a package version contains. You can also create a _marketplace template_ to seed new content from a listing. ### Personal Orgs Manage a user's Personal Org in Tableau Next. A _Personal Org_ is a private workspace where a user can explore and build with Tableau Next assets before sharing them more broadly. Use these operations to retrieve a Personal Org and its details, update a Personal Org, delete a Personal Org, and create the mirrored `AnalyticsPersonalOrgInfo` record that tracks a Personal Org's analytics information. ### Records "Record" is a general term for an instance of data in a Salesforce object. The record types that these operations manage access for include: Tableau Next workspaces, visualizations, and dashboards. For more information see [Manage Access to Assets in Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_share_access.htm) ### Kinds of access There are three kinds of access permissions that can be granted in Tableau Next: * **Owner** - Can create, edit, view, share and delete assets. * You have this access to any assets you create. * **Editor** - Can edit and view assets and add assets to a workspace shared with them by the owner. * You get this by having a workspace shared with you with `Editor` access. * **Viewer** - Can view assets. * You get this by having a workspace, visualization, or dashboard shared with you with `Viewer` access. ### How access works with referenced assets Assets can be created in a workspace or can appear in a workspace because they were referred to from another workspace. Referencing an asset does not change its access permissions. Here are examples of how that impacts a user's access: * If a user has access to view a workspace that contains a referenced dashboards or visualizations that have not been shared with them, they will not see those assets. * If that user can view a dashboard in that workspace, but the dashboard contains a visualization that has not been shared with them, the dashboard will not show that visualization for that user. ### What these operations enable * Get a list of users who have access shared for a specified asset. * Update a user's access to an asset. * Share access for a set of users to a specified asset. * Delete a user's access to an asset. * Delete all access sharing for an asset. Currently, record access sharing is for users, but will be expanded to support larger scopes of users in future releases. ### Subscriptions Tableau Next subscriptions operations enable you to: * Update a user's subscription digest configuration. * Get a user's subscription digest configuration. ### Visualizations Tableau Next workspaces can contain visualizations, also called views, which are graphical representations of data designed to reveal patterns, trends, and insights. The data for a visualization comes from the semantic model of a datasource. For more information, See [Create Visualizations and Dashboards in Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_create.htm&type=5). Visualization operations enable you to: * Update a visualization by ID or name. * Get a visualization by ID or name. * Delete a visualization by ID or name. * Get a visualization and semantic model by ID or name. * Create a new visualization. * Get a list of visualizations available to the user. ### Workspaces Tableau Next workspaces operations enable you to: * Update a workspace. * Get a workspace by ID or name. * Delete a workspace by ID or name. * Add an asset to a workspace. * Get assets in a workspace. * Delete an asset from a workspace. * Create a workspace. * Get a list of workspaces. ## Operations ### POST Clone asset `POST /tableau/assets/clone` Operation ID: `cloneAsset`. Tags: Assets. API resource to clone Tableau Next assets Clone a Tableau Next asset with specified options. #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.clone.connect.api.input.AnalyticsAssetCloneInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "sourceAssetId": "example_sourceAssetId", "sourceAssetType": "example_sourceAssetType", "includeDependencies": { "semanticModel": true, "visualization": true }, "targetWorkspaceId": "example_targetWorkspaceId" } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.clone.connect.api.output.AnalyticsAssetCloneResultRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "addedDependencies": [ { "assetId": "example_assetId", "assetType": "example_assetType", "developerName": "Example developer", "label": "Label" } ], "clonedAssetDeveloperName": "Example clonedAssetDeveloper", "clonedAssetId": "example_clonedAssetId", "clonedAssetLabel": "clonedAsset", "clonedAssetType": "example_clonedAssetType", "clonedDependencies": [ { "assetId": "example_assetId", "assetType": "example_assetType", "developerName": "Example developer", "label": "Label" } ], "errors": [ { "assetId": "example_assetId", "errorCode": "example_errorCode", "errorMessage": "example_errorMessage" } ], "status": "example_status", "targetWorkspaceDeveloperName": "Example targetWorkspaceDeveloper", "targetWorkspaceLabel": "targetWorkspace" } ``` ### POST Compare assets `POST /tableau/assets/compare` Operation ID: `compareAssets`. Tags: Assets. Compare two Tableau assets and return structured differences. Compare source and target assets and return structured block-level differences. #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.assetsCompare.AnalyticsAssetsCompareInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "assetType": "AnalyticsDashboard", "source": { "assetIdOrApiName": "Example assetIdOrApi" }, "target": { "assetIdOrApiName": "Example assetIdOrApi" } } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.assetsCompare.AnalyticsAssetsCompareOutputRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "assetType": "AnalyticsDashboard", "source": { "assetApiName": "Example assetApi", "diff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ] }, "target": { "assetApiName": "Example assetApi", "diff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [ { "changeType": "example_changeType", "delta": { "key1": {} }, "id": "example_id", "nestedDiff": [], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ], "type": "example_type" } ] } } ``` ### POST List asset dependents `POST /tableau/assets/dependencies` Operation ID: `getAssetDependents`. Tags: Assets. API resource to list the dependent assets of Tableau Next assets Get the dependent assets of the given Tableau Next assets. #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.dependents.connect.api.input.AssetDependentsQueryInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "assets": [ { "assetApiName": "Example assetApi", "assetType": "example_assetType" } ] } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.dependents.connect.api.output.AssetDependentCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "results": [ { "asset": { "assetApiName": "Example assetApi", "assetId": "example_assetId", "assetLabel": "asset", "assetType": "AnalyticsDashboard" }, "dependentsByType": [ { "count": 100, "dependentAssetType": "AnalyticsDashboard", "dependents": [ { "assetApiName": "Example assetApi", "assetId": "example_assetId", "assetLabel": "asset", "assetType": "AnalyticsDashboard" } ] } ], "totalCount": 100 } ] } ``` ### GET Get asset references `GET /tableau/assets/{assetId}/references` Operation ID: `getAssetInnerReference`. Tags: Assets. Resource to access assets and their inner reference assets Get type asset presentation of an asset and all its inner reference assets. #### Parameters * `assetId` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.TypedAssetReferenceCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "assets": [ { "description": "This is an example description", "id": "0FKgS4WC00IUtVy", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKhhqwMp5PbV1g", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKrAPHWnBX0sUc", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "assetDevName": "Example assetDev", "assetId": "example_assetId", "assetLabel": "asset", "assetType": "AnalyticsDashboard" } ] } ``` ### GET List dashboards `GET /tableau/dashboards` Operation ID: `getDashboards`. Tags: Dashboards. Creates a dashboard. Get all available Tableau Next Dashboards. #### Parameters * `limit` (query, integer) * `minorVersion` (query, integer) * `offset` (query, integer) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.dashboard.DashboardCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "dashboards": [ { "description": "This is an example description", "id": "0FKJZLePQW1ptIv", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FK2a1Jgc80RTEo", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKGlTiHM8P9Iu9", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "backgroundSource": { "description": "This is an example description", "id": "0FKXzdgs9u9lApm", "label": "Label", "name": "Example Name", "type": "Image", "url": "https://example.com" }, "customConfig": { "queryCacheEnabled": true, "queryCacheStaleness": "example_queryCacheStaleness" }, "customViews": [ { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } } ], "defaultView": { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } }, "layouts": [ { "description": "This is an example description", "id": "0FK1HYkw9DxtGmm", "label": "Label", "name": "Example Name", "columnCount": 100, "maxWidth": 100, "pages": [ { "description": "This is an example description", "id": "0FKzaeCIx5I0GeE", "label": "Label", "name": "Example Name", "navigationHidden": false, "widgets": [ { "description": "This is an example description", "id": "0FKKQ3SNBhHloSH", "label": "Label", "name": "Example Name", "colspan": 100, "column": 100, "row": 100, "rowspan": 100 } ] } ], "rowHeight": 100, "style": { "backgroundColor": "example_backgroundColor", "cellSpacingX": 100, "cellSpacingY": 100, "gutterColor": "example_gutterColor" } } ], "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "style": { "background": { "alignmentX": "example_alignmentX", "alignmentY": "example_alignmentY", "imageScale": "Fill", "opacity": 100 }, "widgetStyle": { "backgroundColor": "example_backgroundColor", "borderColor": "example_borderColor", "borderEdges": [ "example_borderEdges" ], "borderRadius": 100, "borderWidth": 100 } }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "url": "https://example.com", "widgets": { "widget1": { "description": "This is an example description", "id": "0FKx6wiMwhBrKrb", "label": "Label", "name": "Example Name", "actions": [ { "description": "This is an example description", "id": "0FK1K9Gl6gCLBKo", "label": "Label", "name": "Example Name", "actionType": "Filter", "assetId": "example_assetId", "eventType": "Click", "parameters": {} } ], "dynamicTokens": { "key1": { "description": "This is an example description", "id": "0FK4aCQQu5nRFXN", "label": "Label", "name": "Example Name", "source": { "description": "This is an example description", "id": "0FKiJn9Fq2XhcBi", "label": "Label", "name": "Example Name", "type": "Image", "url": "https://example.com" }, "status": "DataAccessError", "type": "Insights" } }, "status": "DataAccessError", "type": "Button" } }, "workspaceIdOrApiName": "Example workspaceIdOrApi" } ] } ``` ### POST Create dashboard `POST /tableau/dashboards` Operation ID: `postDashboardCollection`. Tags: Dashboards. Creates a dashboard. Creates a Tableau Next dashboard. #### Parameters * `minorVersion` (query, integer) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.dashboard.DashboardInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "description": "This is an example description", "label": "Label", "name": "Example Name", "backgroundSource": { "id": "example_id", "name": "Example Name" }, "customConfig": { "queryCacheEnabled": true, "queryCacheStaleness": "example_queryCacheStaleness" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "layouts": [ { "description": "This is an example description", "label": "Label", "name": "Example Name", "columnCount": 100, "maxWidth": 100, "pages": [ { "description": "This is an example description", "label": "Label", "name": "Example Name", "navigationHidden": false, "widgets": [ { "description": "This is an example description", "label": "Label", "name": "Example Name", "colspan": 100, "column": 100, "row": 100, "rowspan": 100 } ] } ], "rowHeight": 100, "style": { "backgroundColor": "example_backgroundColor", "cellSpacingX": 100, "cellSpacingY": 100, "gutterColor": "example_gutterColor" } } ], "style": { "background": { "alignmentX": "example_alignmentX", "alignmentY": "example_alignmentY", "imageScale": "Fill", "opacity": 100 }, "widgetStyle": { "backgroundColor": "example_backgroundColor", "borderColor": "example_borderColor", "borderEdges": [ "example_borderEdges" ], "borderRadius": 100, "borderWidth": 100 } }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "widgets": { "widget1": { "description": "This is an example description", "label": "Label", "name": "Example Name", "actions": [ { "description": "This is an example description", "label": "Label", "name": "Example Name", "actionType": "Filter", "eventType": "Click", "parameters": {} } ], "dynamicTokens": { "key1": { "description": "This is an example description", "label": "Label", "name": "Example Name", "source": { "id": "example_id", "name": "Example Name" }, "tokenSpec": { "key1": {} }, "type": "Insights" } }, "type": "Button" } }, "workspaceIdOrApiName": "Example workspaceIdOrApi" } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.dashboard.DashboardRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FKrHnn4hvIvTcd", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKVM7FdOHH7B4X", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FK5TXAlplhe0Y1", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "backgroundSource": { "description": "This is an example description", "id": "0FK1IZPidiIxriL", "label": "Label", "name": "Example Name", "type": "Image", "url": "https://example.com" }, "customConfig": { "queryCacheEnabled": true, "queryCacheStaleness": "example_queryCacheStaleness" }, "customViews": [ { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } } ], "defaultView": { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } }, "layouts": [ { "description": "This is an example description", "id": "0FKZSNG2xyLfOHp", "label": "Label", "name": "Example Name", "columnCount": 100, "maxWidth": 100, "pages": [ { "description": "This is an example description", "id": "0FKJaIm0Cec8499", "label": "Label", "name": "Example Name", "navigationHidden": false, "widgets": [ { "description": "This is an example description", "id": "0FKwe9Nvp3rMYq2", "label": "Label", "name": "Example Name", "colspan": 100, "column": 100, "row": 100, "rowspan": 100 } ] } ], "rowHeight": 100, "style": { "backgroundColor": "example_backgroundColor", "cellSpacingX": 100, "cellSpacingY": 100, "gutterColor": "example_gutterColor" } } ], "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "style": { "background": { "alignmentX": "example_alignmentX", "alignmentY": "example_alignmentY", "imageScale": "Fill", "opacity": 100 }, "widgetStyle": { "backgroundColor": "example_backgroundColor", "borderColor": "example_borderColor", "borderEdges": [ "example_borderEdges" ], "borderRadius": 100, "borderWidth": 100 } }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "url": "https://example.com", "widgets": { "widget1": { "description": "This is an example description", "id": "0FK5ykz70ykR6LC", "label": "Label", "name": "Example Name", "actions": [ { "description": "This is an example description", "id": "0FKJUBsFeDx8F6J", "label": "Label", "name": "Example Name", "actionType": "Filter", "assetId": "example_assetId", "eventType": "Click", "parameters": {} } ], "dynamicTokens": { "key1": { "description": "This is an example description", "id": "0FKyeHBJlYl75oh", "label": "Label", "name": "Example Name", "source": { "description": "This is an example description", "id": "0FK0DsncIC4AiC0", "label": "Label", "name": "Example Name", "type": "Image", "url": "https://example.com" }, "status": "DataAccessError", "type": "Insights" } }, "status": "DataAccessError", "type": "Button" } }, "workspaceIdOrApiName": "Example workspaceIdOrApi" } ``` ### GET Get dashboard `GET /tableau/dashboards/{dashboardIdOrApiName}` Operation ID: `getDashboard`. Tags: Dashboards. Resource to access Tableau Next Dashboard by ID or name. Get Tableau Next Dashboard by ID or Name. #### Parameters * `dashboardIdOrApiName` (path, string, required) * `minorVersion` (query, integer) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.dashboard.DashboardRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FKoZQUSrNSgFVA", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKig6z8xYJozzY", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKOWL5Zzs9lLJl", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "backgroundSource": { "description": "This is an example description", "id": "0FKMlE6He3txwzm", "label": "Label", "name": "Example Name", "type": "Image", "url": "https://example.com" }, "customConfig": { "queryCacheEnabled": true, "queryCacheStaleness": "example_queryCacheStaleness" }, "customViews": [ { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } } ], "defaultView": { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } }, "layouts": [ { "description": "This is an example description", "id": "0FKtG4Gcl7FNgnY", "label": "Label", "name": "Example Name", "columnCount": 100, "maxWidth": 100, "pages": [ { "description": "This is an example description", "id": "0FKNILh3LrRjySh", "label": "Label", "name": "Example Name", "navigationHidden": false, "widgets": [ { "description": "This is an example description", "id": "0FKOv2vdGrpwzua", "label": "Label", "name": "Example Name", "colspan": 100, "column": 100, "row": 100, "rowspan": 100 } ] } ], "rowHeight": 100, "style": { "backgroundColor": "example_backgroundColor", "cellSpacingX": 100, "cellSpacingY": 100, "gutterColor": "example_gutterColor" } } ], "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "style": { "background": { "alignmentX": "example_alignmentX", "alignmentY": "example_alignmentY", "imageScale": "Fill", "opacity": 100 }, "widgetStyle": { "backgroundColor": "example_backgroundColor", "borderColor": "example_borderColor", "borderEdges": [ "example_borderEdges" ], "borderRadius": 100, "borderWidth": 100 } }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "url": "https://example.com", "widgets": { "widget1": { "description": "This is an example description", "id": "0FK2UHzmESxPWSI", "label": "Label", "name": "Example Name", "actions": [ { "description": "This is an example description", "id": "0FK3gijgfXpRQt2", "label": "Label", "name": "Example Name", "actionType": "Filter", "assetId": "example_assetId", "eventType": "Click", "parameters": {} } ], "dynamicTokens": { "key1": { "description": "This is an example description", "id": "0FKjKPE6AxGwXyl", "label": "Label", "name": "Example Name", "source": { "description": "This is an example description", "id": "0FKsWdqvY7C6huh", "label": "Label", "name": "Example Name", "type": "Image", "url": "https://example.com" }, "status": "DataAccessError", "type": "Insights" } }, "status": "DataAccessError", "type": "Button" } }, "workspaceIdOrApiName": "Example workspaceIdOrApi" } ``` ### DELETE Delete dashboard `DELETE /tableau/dashboards/{dashboardIdOrApiName}` Operation ID: `deleteDashboard`. Tags: Dashboards. Resource to access Tableau Next Dashboard by ID or name. Delete Tableau Next Dashboard by ID or Name. #### Parameters * `dashboardIdOrApiName` (path, string, required) #### Responses * **200** Success. ### PATCH Update dashboard `PATCH /tableau/dashboards/{dashboardIdOrApiName}` Operation ID: `patchDashboard`. Tags: Dashboards. Resource to access Tableau Next Dashboard by ID or name. Update Tableau Next Dashboard Metadata by ID or Name. #### Parameters * `dashboardIdOrApiName` (path, string, required) * `minorVersion` (query, integer) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.dashboard.DashboardInputRepresentation`. _Example fullExample: same as POST /tableau/dashboards request._ Full operation example — complete request body _Example: fullExample_ Full operation example — complete request body #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.dashboard.DashboardRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FKygw3sUuwjxdX", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FK6HtEkihPGxxh", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FK2n8j2MIqGsTl", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "backgroundSource": { "description": "This is an example description", "id": "0FKQaa99acoTyXJ", "label": "Label", "name": "Example Name", "type": "Image", "url": "https://example.com" }, "customConfig": { "queryCacheEnabled": true, "queryCacheStaleness": "example_queryCacheStaleness" }, "customViews": [ { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } } ], "defaultView": { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } }, "layouts": [ { "description": "This is an example description", "id": "0FK8mLUoRH7QMqK", "label": "Label", "name": "Example Name", "columnCount": 100, "maxWidth": 100, "pages": [ { "description": "This is an example description", "id": "0FK0QRrO0quxOKj", "label": "Label", "name": "Example Name", "navigationHidden": false, "widgets": [ { "description": "This is an example description", "id": "0FKaRU9G7mAxChV", "label": "Label", "name": "Example Name", "colspan": 100, "column": 100, "row": 100, "rowspan": 100 } ] } ], "rowHeight": 100, "style": { "backgroundColor": "example_backgroundColor", "cellSpacingX": 100, "cellSpacingY": 100, "gutterColor": "example_gutterColor" } } ], "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "style": { "background": { "alignmentX": "example_alignmentX", "alignmentY": "example_alignmentY", "imageScale": "Fill", "opacity": 100 }, "widgetStyle": { "backgroundColor": "example_backgroundColor", "borderColor": "example_borderColor", "borderEdges": [ "example_borderEdges" ], "borderRadius": 100, "borderWidth": 100 } }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "url": "https://example.com", "widgets": { "widget1": { "description": "This is an example description", "id": "0FKkAl5jLH7RFGg", "label": "Label", "name": "Example Name", "actions": [ { "description": "This is an example description", "id": "0FKH2sP6ZKVBBk2", "label": "Label", "name": "Example Name", "actionType": "Filter", "assetId": "example_assetId", "eventType": "Click", "parameters": {} } ], "dynamicTokens": { "key1": { "description": "This is an example description", "id": "0FKIeYTQszD38fQ", "label": "Label", "name": "Example Name", "source": { "description": "This is an example description", "id": "0FKLj1Myr3PyvNT", "label": "Label", "name": "Example Name", "type": "Image", "url": "https://example.com" }, "status": "DataAccessError", "type": "Insights" } }, "status": "DataAccessError", "type": "Button" } }, "workspaceIdOrApiName": "Example workspaceIdOrApi" } ``` ### GET Get dashboard bundle `GET /tableau/dashboards/{dashboardIdOrApiName}/bundle` Operation ID: `getDashboardBundle`. Tags: Dashboards. Endpoint for dashboard custom bundle response. Gets the bundle response for the specified Tableau Next dashboard. _Updated April 2026: added `customViewId`, `forceReload`, `height`, `minorVersion`._ #### Parameters * `dashboardIdOrApiName` (path, string, required) The ID or name of the dashboard. * `addSdm` (query, boolean) Specifies whether to include referenced SDMs in the bundle response (`true`) or exclude them (`false`). * `addVisualization` (query, boolean) Specifies whether to include referenced visualizations in the bundle response (`true`) or exclude them (`false`). * `customViewId` (query, string) The custom view ID (if passed) to load as part of bundle. * `debug` (query, boolean) Specifies whether to return extra API execution details in the response (`true`) or not (`false`). * `forceReload` (query, boolean) Specifies whether to force a reload of the bundle instead of using cached data (`true`) or use cached data if available (`false`). * `height` (query, integer) The dashboard height on the viewport in pixels. If passed, bundle only includes assets that display in the height. * `minorVersion` (query, integer) The minor supported for the API. * `pageName` (query, string) The specific page name (GUID) of the dashboard. #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.DashboardBundleRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "bundledAssets": { "key1": { "assetAppTemplate": "example_assetAppTemplate", "status": "example_status", "type": "Dashboard" } }, "cached": true, "executionDelay": { "key1": 100.5 }, "executionTime": { "key1": 100.5 } } ``` ### GET List dashboard custom views `GET /tableau/dashboards/{dashboardIdOrApiName}/customviews` Operation ID: `getViews`. Tags: Dashboards. Endpoint for dashboard custom view collection which user has access to. Gets the collection of saved views of a dashboard. #### Parameters * `dashboardIdOrApiName` (path, string, required) The ID or name of the dashboard. * `limit` (query, integer) The collection limit. * `offset` (query, integer) The collection offset. * `shallow` (query, boolean) Specifies whether to return a shallow version of the collection (`true`) or the full collection (`false`). #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.DashboardCustomViewCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "customViews": [ { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } } ] } ``` ### POST Create dashboard custom view `POST /tableau/dashboards/{dashboardIdOrApiName}/customviews` Operation ID: `saveView`. Tags: Dashboards. Endpoint for dashboard custom view collection which user has access to. Creates a custom view of a Tableau Next dashboard. #### Parameters * `dashboardIdOrApiName` (path, string, required) The ID or name of the dashboard. * `limit` (query, integer) The collection limit. * `offset` (query, integer) The collection offset. * `shallow` (query, boolean) Specifies whether to return a shallow version of the collection (`true`) or the full collection (`false`). #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.DashboardCustomViewInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "defaultPage": "example_defaultPage", "isDefault": true, "label": "Label", "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "name": "Example Name" } } ], "parameters": [ { "source": { "id": "example_id", "name": "Example Name" } } ], "selections": [ { "source": { "id": "example_id", "name": "Example Name" } } ] } } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.DashboardCustomViewRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "defaultPage": "example_defaultPage", "id": "example_id", "isDefault": true, "label": "Label", "owner": { "id": "example_id", "name": "Example Name" }, "type": "Private", "viewSpec": { "filters": [ { "details": { "fieldName": "Example field", "operator": "Between" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "parameters": [ { "details": { "name": "Example Name", "value": "example_value" }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ], "selections": [ { "details": { "axes": [], "dataSource": "example_dataSource", "headers": [ { "fieldId": { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" }, "partitionFieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "partitionValues": [] } ], "marks": [ { "fieldIds": [ { "disambiguationIndex": 100, "displayCategory": "example_displayCategory", "fieldName": "Example field", "function": "example_function", "objectName": "Example object", "role": "example_role", "type": "example_type" } ], "values": [] } ], "nodes": [] }, "source": { "id": "example_id", "label": "Label", "name": "Example Name" }, "status": "DataAccessError" } ] } } ``` ### GET Get default dashboard custom view `GET /tableau/dashboards/{dashboardIdOrApiName}/customviews/default` Operation ID: `getDefaultView`. Tags: Dashboards. Endpoint for interacting with Tableau Next dashboard default custom view for which user has access. Gets the default custom view of a Tableau Next dashboard for the current user. #### Parameters * `dashboardIdOrApiName` (path, string, required) The ID or name of the dashboard. #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.DashboardCustomViewRepresentation`. _Example fullExample: same as POST /tableau/dashboards/{dashboardIdOrApiName}/customviews 200 response._ Full operation example — complete response body _Example: fullExample_ Full operation example — complete response body ### GET Get dashboard custom view `GET /tableau/dashboards/{dashboardIdOrApiName}/customviews/{viewId}` Operation ID: `getView`. Tags: Dashboards. Endpoint for interacting with dashboard custom view for which user has access. Get the custom view of dashboard by the ID. #### Parameters * `dashboardIdOrApiName` (path, string, required) The ID or name of the dashboard. * `viewId` (path, string, required) The ID of the custom view. #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.DashboardCustomViewRepresentation`. _Example fullExample: same as POST /tableau/dashboards/{dashboardIdOrApiName}/customviews 200 response._ Full operation example — complete response body _Example: fullExample_ Full operation example — complete response body ### POST Delete dashboard custom view `POST /tableau/dashboards/{dashboardIdOrApiName}/customviews/{viewId}` Operation ID: `deleteView`. Tags: Dashboards. Endpoint for interacting with dashboard custom view for which user has access. Deletes a custom view of a Tableau Next dashboard, specified by the view's view ID. #### Parameters * `dashboardIdOrApiName` (path, string, required) The ID or name of the dashboard. * `viewId` (path, string, required) The ID of the custom view. #### Responses * **200** Success. ### GET Get asset follower count `GET /tableau/follow/assets/{followedAssetId}/follower-count` Operation ID: `getUniqueFollowerCount`. Tags: Follow (Followers). Unique follower metadata. Gets the count of unique followers for a specified followed Tableau Next asset. #### Parameters * `followedAssetId` (path, string, required) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.follow.UniqueFollowerCountRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "uniqueFollowerCount": 100 } ``` ### GET Get asset followers `GET /tableau/follow/assets/{followedAssetId}/followers` Operation ID: `getFollowerCollection`. Tags: Follow (Followers). Followers metadata. Gets a list of followers of a followed Tableau Next asset. You can filter by follower type or a specified follower ID. #### Parameters * `followedAssetId` (path, string, required) * `followerId` (query, string) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.follow.FollowerCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "followers": [ { "description": "This is an example description", "id": "0FKaQCiUpnoBbqh", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" } ] } ``` ### GET List followed assets `GET /tableau/follow/followers/{followerId}/followed-asset-refs` Operation ID: `getFollowedAssetRefCollection`. Tags: Follow (Followers). Resource to access followed assets references of a follower. _Available April 2026 and later._ Gets all followed asset references for a follower filterable by asset type. _Available April 2026 and later._ #### Parameters * `followerId` (path, string, required) * `assetsOrderBy` (query, sfdc.unified.analytics.connect.api.resource.follow.OrderBy) Determines the field to sort by * `followedAssetType` (query, sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowedAssetTypeEnum) Determines what asset type to select * `limit` (query, integer) * `offset` (query, integer) * `sortOrder` (query, sfdc.unified.analytics.connect.api.resource.follow.SortOrder) Determines the sorting order Valid values are app, ASC and DESC. #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.follow.FollowedAssetRefCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "followedAssetRefs": [ { "assetId": "0FKSIdgCKud5J0D", "assetType": "SemanticMetricDefinition", "createdBy": { "description": "This is an example description", "id": "0FKV4lZE7i9PmZY", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "followedTimeRange": { "fieldName": "Example field", "values": [] }, "followerType": "Group", "id": "0FK8IfZJMNlA2bf", "lastModifiedBy": { "description": "This is an example description", "id": "0FKfXHgwHq6B0ZD", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "shouldShowForecast": true } ] } ``` ### GET List followed assets `GET /tableau/follow/followers/{followerId}/followed-assets` Operation ID: `getFollowedAssetCollection`. Tags: Follow (Followers). Gets the followed assets of a follower. Lists the followed Tableau Next assets of a follower. You can filter by asset type. #### Parameters * `followerId` (path, string, required) * `assetsOrderBy` (query, string) The determines the field to sort by. #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.follow.FollowedAssetCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "followedAssets": [ { "description": "This is an example description", "id": "0FK0EHxKEZGewTB", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKsXnOpirFrtUb", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FK08EXHi6h9IWF", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "assetType": "SemanticMetricDefinition", "followedTimeRange": { "fieldName": "Example field", "values": [] } } ] } ``` ### POST Create follow `POST /tableau/follow/followers/{followerId}/follows` Operation ID: `postFollow`. Tags: Follow (Followers). Actions on followed assets. Follow an asset. #### Parameters * `followerId` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.follow.FollowInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "assetId": "example_assetId", "assetType": "SemanticMetricDefinition", "followedTimeRange": { "fieldName": "Example field", "values": [] }, "followerType": "Group", "shouldShowForecast": true } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.follow.FollowerAssetRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "createdBy": { "description": "This is an example description", "id": "0FKde0TJR2bjm0y", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "followedAssetId": "example_followedAssetId", "followedAssetType": "SemanticMetricDefinition", "followedTimeRange": { "fieldName": "Example field", "values": [] }, "followerId": "example_followerId", "followerType": "Group" } ``` ### PATCH Update follow `PATCH /tableau/follow/followers/{followerId}/follows` Operation ID: `patchFollow`. Tags: Follow (Followers). Actions on followed assets. Update a followed asset. #### Parameters * `followerId` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.follow.UpdateFollowInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "assetId": "example_assetId", "followedTimeRange": { "fieldName": "Example field", "values": [] }, "shouldShowForecast": true, "updateAllAssets": true } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.follow.FollowerAssetCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "followerAssets": [ { "createdBy": { "description": "This is an example description", "id": "0FKJlxhoZ9BLdfR", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "followedAssetId": "example_followedAssetId", "followedAssetType": "SemanticMetricDefinition", "followedTimeRange": { "fieldName": "Example field", "values": [] }, "followerId": "example_followerId", "followerType": "Group" } ], "followerId": "example_followerId" } ``` ### DELETE Delete follow `DELETE /tableau/follow/followers/{followerId}/follows/{followedAssetId}` Operation ID: `deleteUnfollow`. Tags: Follow (Followers). An asset action. Unfollow an asset. #### Parameters * `followedAssetId` (path, string, required) * `followerId` (path, string, required) #### Responses * **200** Success ### POST Get submetric info `POST /tableau/follow/submetric-info` Operation ID: `postSubMetricInfo`. Tags: Follow (Followers). Resource for getting sub-metric info Get SubMetric Info including metric and goal details. #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.follow.SubMetricInfoInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "filterLogic": "example_filterLogic", "filters": [], "metricIdOrApiName": "Example metricIdOrApi", "modelIdOrApiName": "Example modelIdOrApi", "subMetricId": "example_subMetricId" } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.follow.SubMetricInfoOutputRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "isFollowed": true } ``` ### GET Get a marketplace installation `GET /tableau/marketplace/installations/{installationId}` Operation ID: `getAnalyticsTableauMarketplaceListingInstallationTracking`. Tags: Marketplace. Tracks the installation progress of a Marketplace. listing. Fetch progress of Tableau Marketplace Listing Installation. #### Parameters * `installationId` (path, string, required) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.marketplace.TableauMarketplaceListingInstallationProgressResponse`. _Example: fullExample_ Full operation example — complete response body ``` { "errors": [ "example_errors" ], "id": "example_id", "status": "example_status" } ``` ### GET Get marketplace listings `GET /tableau/marketplace/listings` Operation ID: `getMarketplaceListings`. Tags: Marketplace. API resource for marketplace listings Collection _Available April 2026 and later._ Get the list of assets published to Tableau Marketplace _Available April 2026 and later._ #### Parameters * `assetId` (query, string) The ID of asset to query * `assetType` (query, sfdc.analyticsdashboard.connect.api.enums.MarketplaceAssetTypeEnum) The type of asset to query * `assetVersion` (query, string) The version of asset to query * `limit` (query, integer) Collection limit * `offset` (query, integer) Collection offset #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.analyticsdashboard.connect.api.output.MarketplaceListingCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "marketplaceListings": [ { "assetId": "example_assetId", "assetType": "DominoTemplate", "assetVersion": "example_assetVersion", "id": "example_id" } ], "totalCount": 100 } ``` ### POST Publish to marketplace `POST /tableau/marketplace/listings` Operation ID: `publishToMarketplace`. Tags: Marketplace. API resource for marketplace listings Collection _Available April 2026 and later._ Adds a new asset to the marketplace listings collection. _Available April 2026 and later._ #### Request body Media type: `application/json`. Schema: `sfdc.analyticsdashboard.connect.api.input.MarketplaceListingInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "assetId": "example_assetId", "assetType": "DominoTemplate", "assetVersion": "example_assetVersion" } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.analyticsdashboard.connect.api.output.MarketplaceListingRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "id": "example_id" } ``` ### DELETE Unpublish from marketplace `DELETE /tableau/marketplace/listings/{listingId}` Operation ID: `unpublishFromMarketplace`. Tags: Marketplace. API resource for marketplace listings _Available April 2026 and later._ Unpublishes an asset from marketplace listings _Available April 2026 and later._ #### Parameters * `listingId` (path, string, required) The ID of the Marketplace Listings #### Responses * **200** Success ### GET Install a marketplace listing `GET /tableau/marketplace/listings/{listingId}/install` Operation ID: `getAnalyticsTableauMarketplaceListing`. Tags: Marketplace. Installs a package from the Tableau Marketplace. Install the package. #### Parameters * `listingId` (path, string, required) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.marketplace.TableauMarketplaceListingInstallationResponse`. _Example: fullExample_ Full operation example — complete response body ``` { "packageInstallRequestID": "example_packageInstallRequestID", "success": true } ``` ### GET List marketplace package components `GET /tableau/marketplace/packages/{packageVersionId}/components` Operation ID: `getPackageComponents`. Tags: Marketplace. API resource for fetching the list of components installed as part of a given package version. Get the list of components installed as part of the given package version. #### Parameters * `packageVersionId` (path, string, required) The ID of the package version #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.analyticsdashboard.connect.api.output.PackageComponentCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "components": [ { "componentId": "example_componentId", "componentType": "example_componentType" } ], "packageGeneration": "FirstGeneration", "packageVersionId": "example_packageVersionId", "totalCount": 100 } ``` ### POST Create a marketplace template `POST /tableau/marketplace/templates` Operation ID: `postMarketplaceTemplateBuilder`. Tags: Marketplace. Creates a new BPO template using the Tableau Marketplace template builder. Creates a new template. #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.marketplaceTemplateBuilder.MarketplaceTemplateInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "assetIdOrApiName": "Example assetIdOrApi", "description": "This is an example description", "label": "Label", "name": "Example Name", "tags": { "key1": [ "example_tags" ] } } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.marketplaceTemplateBuilder.MarketplaceTemplateOutputRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "id": "example_id" } ``` ### POST Sync personal org info `POST /tableau/analytics-personal-org-infos` Operation ID: `postAnalyticsPersonalOrgInfoSync`. Tags: Personal Orgs. Internal cross-org receiver to create or update the mirrored AnalyticsPersonalOrgInfo record in a Personal Org Create or update the mirrored AnalyticsPersonalOrgInfo record in this Personal Org. #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.personalOrg.AnalyticsPersonalOrgInfoSyncInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "details": "example_details", "developerName": "Example developer", "isAnalyticsReuseEditable": true, "isPersonalOrgDeleted": true, "masterLabel": "master", "owners": "example_owners", "personalOrgCreatedBy": "example_personalOrgCreatedBy", "personalOrgCreatedDate": "2026-02-16 10:00:00+00:00", "personalOrgIdentifier": "example_personalOrgIdentifier", "personalOrgName": "Example personalOrg", "personalOrgOwnerUserName": "Example personalOrgOwnerUser", "personalOrgStatus": "example_personalOrgStatus", "systemAddedOwners": "example_systemAddedOwners" } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.personalOrg.AnalyticsPersonalOrgInfoSyncResultRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "id": "example_id", "success": true } ``` ### GET List personal orgs `GET /tableau/personal-orgs` Operation ID: `getAnalyticsPersonalOrgInfoCollection`. Tags: Personal Orgs. Resource for listing Personal Orgs with their owners List the Personal Orgs owned by a user, augmented with their owners. #### Parameters * `limit` (query, integer) * `offset` (query, integer) * `owner` (query, string) * `queryFields` (query, string) * `queryValue` (query, string) * `sortBy` (query, string) * `sortOrder` (query, string) #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.personalOrg.AnalyticsPersonalOrgInfoCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "personalOrgs": [ { "createdBy": "example_createdBy", "createdDate": "2026-02-16 10:00:00+00:00", "details": "example_details", "errorCode": "example_errorCode", "id": "example_id", "isAnalyticsReuseEditable": true, "name": "Example Name", "owners": [ "example_owners" ], "personalOrgIdentifier": "example_personalOrgIdentifier", "signupRecordId": "example_signupRecordId", "status": "example_status", "systemAddedOwners": [ "example_systemAddedOwners" ] } ] } ``` ### GET Get personal org `GET /tableau/personal-orgs/{personalOrgInfoId}` Operation ID: `getAnalyticsPersonalOrgInfo`. Tags: Personal Orgs. Resource to read and update a single Personal Org Get a single Personal Org by its PersonalOrgInfo record ID. #### Parameters * `personalOrgInfoId` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.personalOrg.AnalyticsPersonalOrgInfoRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "createdBy": "example_createdBy", "createdDate": "2026-02-16 10:00:00+00:00", "details": "example_details", "errorCode": "example_errorCode", "id": "example_id", "isAnalyticsReuseEditable": true, "name": "Example Name", "owners": [ "example_owners" ], "personalOrgIdentifier": "example_personalOrgIdentifier", "signupRecordId": "example_signupRecordId", "status": "example_status", "systemAddedOwners": [ "example_systemAddedOwners" ] } ``` ### DELETE Delete personal org `DELETE /tableau/personal-orgs/{personalOrgInfoId}` Operation ID: `deleteAnalyticsPersonalOrgInfo`. Tags: Personal Orgs. Resource to read and update a single Personal Org Delete a Personal Org by its PersonalOrgInfo record ID (soft-delete; triggers cross-org deprovisioning). #### Parameters * `personalOrgInfoId` (path, string, required) #### Responses * **200** Success ### PATCH Update personal org `PATCH /tableau/personal-orgs/{personalOrgInfoId}` Operation ID: `patchAnalyticsPersonalOrgInfo`. Tags: Personal Orgs. Resource to read and update a single Personal Org Update a Personal Org (owner deltas; name/details reserved for a follow-up story). #### Parameters * `personalOrgInfoId` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.personalOrg.AnalyticsPersonalOrgInfoUpdateInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "details": "example_details", "name": "Example Name", "ownersToAdd": [ "example_ownersToAdd" ], "ownersToRemove": [ "example_ownersToRemove" ], "systemAddedOwners": [ "example_systemAddedOwners" ] } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.personalOrg.AnalyticsPersonalOrgInfoRepresentation`. _Example fullExample: same as GET /tableau/personal-orgs/{personalOrgInfoId} 200 response._ Full operation example — complete response body _Example: fullExample_ Full operation example — complete response body ### GET List record shares `GET /tableau/records/{recordId}/shares` Operation ID: `getSetupRecordShareCollection`. Tags: Records. Resource to access collections of share for a record. Get record shares for requested registered grantee for a record. #### Parameters * `recordId` (path, string, required) * `filterByAccessType` (query, array of sfdc.unified.analytics.connect.api.enums.share.SetupObjectAccessTypeEnum) * `filterByRecipientType` (query, array of sfdc.unified.analytics.connect.api.enums.share.SetupObjectRecipientTypeEnum) * `limit` (query, integer) * `offset` (query, integer) * `orderBy` (query, string) * `recipientSearchTerm` (query, string) * `sortOrder` (query, string) * `userOrGroupId` (query, string) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.share.SetupRecordAccessCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "filterByAccessType": [ "Commenter" ], "filterByRecipientType": [ "Group" ], "filterByUserOrGroupId": "example_filterByUserOrGroupId", "limit": 100, "offset": 100, "orderBy": "CreatedDate", "ownerCount": 100, "recordAccessMappings": [ { "accessType": "Commenter", "applicationDomain": "DataCloud", "createdDate": "2026-02-16 10:00:00+00:00", "targetRecord": { "createdBy": { "description": "This is an example description", "id": "0FKBL3OIdTbHjYV", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "developerName": "Example developer", "label": "Label", "lastModifiedBy": { "description": "This is an example description", "id": "0FKMJrbfrNTBTye", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "recordId": "example_recordId" }, "userOrGroup": { "displayName": "Example display", "email": "user@example.com", "groupMemberCount": 100, "id": "example_id", "profilePhotoUrl": "https://example.com", "username": "Example user" }, "userOrGroupId": "example_userOrGroupId" } ], "recordId": "example_recordId", "sortOrder": "example_sortOrder" } ``` ### POST Create record shares `POST /tableau/records/{recordId}/shares` Operation ID: `postSetupRecordShareCollection`. Tags: Records. Resource to access collections of share for a record. Add record shares to be associated with a record. #### Parameters * `recordId` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.share.SetupRecordAccessInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "accessRequestItems": [ { "accessType": "Commenter", "applicationDomain": "DataCloud", "setupObjectType": "AnalyticsDashboard", "userOrGroupId": "example_userOrGroupId" } ], "sendNotificationToRecipients": true } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.share.SetupRecordShareCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "failedRecordShares": [ { "errorCode": "example_errorCode", "errorMessage": "example_errorMessage", "userOrGroupId": "example_userOrGroupId" } ], "recordId": "example_recordId", "setupObjectType": "AnalyticsDashboard", "successfulRecordShares": [ { "accessType": "Commenter", "applicationDomain": "DataCloud", "createdBy": { "description": "This is an example description", "id": "0FK8WTy08LjCiK1", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKIFaN6jdNOMNv", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "userOrGroupId": "example_userOrGroupId" } ] } ``` ### DELETE Delete record shares `DELETE /tableau/records/{recordId}/shares` Operation ID: `deleteSetupRecordShareCollection`. Tags: Records. Resource to access collections of share for a record. Delete all shares for an record. #### Parameters * `recordId` (path, string, required) #### Responses * **200** Success. ### PATCH Update record shares `PATCH /tableau/records/{recordId}/shares` Operation ID: `patchSetupRecordShareCollection`. Tags: Records. Resource to access collections of share for a record. Update an record share to be associated with a record Item. #### Parameters * `recordId` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.share.UpdateSetupRecordAccessInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "updateSetupRecordAccessItems": [ { "accessType": "Commenter", "userOrGroupId": "example_userOrGroupId" } ] } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.share.SetupRecordShareCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "failedRecordShares": [ { "errorCode": "example_errorCode", "errorMessage": "example_errorMessage", "userOrGroupId": "example_userOrGroupId" } ], "recordId": "example_recordId", "setupObjectType": "AnalyticsDashboard", "successfulRecordShares": [ { "accessType": "Commenter", "applicationDomain": "DataCloud", "createdBy": { "description": "This is an example description", "id": "0FKV7p1JvOU5OeY", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKzYlOHN4zvctT", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "userOrGroupId": "example_userOrGroupId" } ] } ``` ### DELETE Delete a record share `DELETE /tableau/records/{recordId}/shares/{userOrGroupId}` Operation ID: `deleteSetupRecordShare`. Tags: Records. Resource to access share for a record. Delete a record shares for a record and a user or group. #### Parameters * `recordId` (path, string, required) * `userOrGroupId` (path, string, required) #### Responses * **200** Success. ### GET Get subscription digest configuration `GET /tableau/subscriptions/digest/{digestConfigOwner}` Operation ID: `getSubscriptionDigestConfig`. Tags: Subscriptions. Accesses subscription digest configuration. Get user's subscription digest configuration. #### Parameters * `digestConfigOwner` (path, string, required) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.subscription.SubscriptionDigestConfigOutputRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "isEnabled": true, "scheduleType": "Daily", "userId": "example_userId" } ``` ### PATCH Update subscription digest configuration `PATCH /tableau/subscriptions/digest/{digestConfigOwner}` Operation ID: `patchSubscriptionDigestConfig`. Tags: Subscriptions. Accesses subscription digest configuration. Update user's subscription digest configuration. #### Parameters * `digestConfigOwner` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.subscription.SubscriptionDigestConfigInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "isEnabled": true, "scheduleType": "Daily" } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.subscription.SubscriptionDigestConfigOutputRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "isEnabled": true, "scheduleType": "Daily", "userId": "example_userId" } ``` ### GET List visualizations `GET /tableau/visualizations` Operation ID: `getVisualizations`. Tags: Visualizations. Accesses a collection of Tableau Next visualizations. Get all available Tableau Next visualizations. #### Parameters * `limit` (query, integer) The collection limit. * `minorVersion` (query, integer) The minor API version for visualization operations. * `offset` (query, integer) The collection offset. #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.VisualizationCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "visualizations": [ { "description": "This is an example description", "id": "0FKsEZfFzGNIvhg", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FK758wrhyKTDoX", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKVAQN1vHcZiJa", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "dataSource": { "description": "This is an example description", "id": "0FKkUSWl1aCnfWq", "label": "Label", "name": "Example Name", "type": "SemanticModel", "url": "https://example.com" }, "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "workspace": { "description": "This is an example description", "id": "0FK7LeXVgEwP8Ax", "label": "Label", "name": "Example Name", "url": "https://example.com" } } ] } ``` ### POST Create visualization `POST /tableau/visualizations` Operation ID: `createVisualization`. Tags: Visualizations. Accesses a collection of Tableau Next visualizations. Create a new Tableau Next visualization. #### Parameters * `minorVersion` (query, integer) The minor API version for visualization operations. #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.VisualizationInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "description": "This is an example description", "label": "Label", "name": "Example Name", "dataSource": { "description": "This is an example description", "label": "Label", "name": "Example Name", "type": "SemanticModel" }, "fields": { "field1": { "adHocCalc": { "dataType": "Boolean", "decimalPlace": 100, "description": "This is an example description", "displayCategory": "Continuous", "expression": "example_expression", "filters": [ { "fieldName": "Example field", "value": "example_value", "values": [ "example_values" ] } ], "label": "Label", "shouldTreatNullsAsZeros": true }, "computeUsing": { "type": "Cell", "useOrderByForExtraFields": true }, "displayCategory": "Continuous", "fieldName": "Example field", "function": "Attr", "hierarchyLevel": 100, "hierarchyName": "Example hierarchy", "label": "Label", "latitudeOrY": "example_latitudeOrY", "longitudeOrX": "example_longitudeOrX", "objectName": "Example object", "positionName": "Example position", "positional": { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" }, "latitudeOrY": { "fieldName": "Example field", "objectName": "Example object" }, "longitudeOrX": { "fieldName": "Example field", "objectName": "Example object" } }, "quickTableCalc": { "type": "Difference", "order": "Ascending", "nextValues": 100, "previousValues": 100, "useCurrentValue": true }, "role": "Dimension", "type": "Field" } }, "interactions": [ { "description": "This is an example description", "label": "Label", "name": "Example Name", "actionType": "Filter", "eventType": "Click", "parameters": {} } ], "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "view": { "description": "This is an example description", "label": "Label", "name": "Example Name", "viewSpecification": { "advancedDimensionFilters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All", "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value" } ], "includeAllValues": true, "isContext": true } ], "aggregateFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All", "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value" } ], "includeAllValues": true, "isContext": true } ] }, "contextFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All", "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value" } ], "includeAllValues": true, "isContext": true } ] }, "filter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All", "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value" } ], "includeAllValues": true, "isContext": true } ] }, "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All", "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value" } ], "includeAllValues": true, "isContext": true } ], "grandTotals": { "columns": true, "rows": true }, "sortOrders": { "columns": [ { "byField": "example_byField", "order": "Ascending" } ], "fields": { "AlphabeticField1": { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" }, "FieldField2": { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "NestedField3": { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } }, "rows": [ { "byField": "example_byField", "order": "Ascending" } ] }, "sorts": [ { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ], "style": { "headers": { "columns": { "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "groups": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } }, "rows": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } } }, "subtotals": { "columns": true, "rows": true }, "tableCalcFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All", "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value" } ], "includeAllValues": true, "isContext": true } ] } } }, "visualSpecification": { "layout": "Flow", "columns": [ "example_columns" ], "forecasts": { "HoltWinters1": { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } }, "RidgeRegression2": { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } }, "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "marks": { "key1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "mode": "Table", "referenceLines": { "Band1": { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } }, "Line2": { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } }, "rows": [ "example_rows" ], "style": { "allHeaders": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "axis": { "key1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "Entire", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "key1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "key1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "panes": { "key1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } }, "referenceLines": { "key1": { "fillAboveColor": "example_fillAboveColor", "fillBelowColor": "example_fillBelowColor", "fillColor": "example_fillColor", "isVisible": true, "labelAlignment": { "horizontal": "Auto", "vertical": "Auto" }, "lineFormat": { "color": "example_color", "type": "None" } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "showDataPlaceholder": true, "title": { "isVisible": true, "titleText": "example_titleText" } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] } }, "workspace": { "description": "This is an example description", "label": "Label", "name": "Example Name" } } ``` _Example: Cell\_computeUsing_ fields.computeUsing — Cell ``` { "type": "Cell", "useOrderByForExtraFields": true } ``` _Example: PaneAcross\_computeUsing_ fields.computeUsing — PaneAcross ``` { "type": "PaneAcross", "useOrderByForExtraFields": true } ``` _Example: PaneAcrossThenDown\_computeUsing_ fields.computeUsing — PaneAcrossThenDown ``` { "type": "PaneAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: PaneDown\_computeUsing_ fields.computeUsing — PaneDown ``` { "type": "PaneDown", "useOrderByForExtraFields": true } ``` _Example: PaneDownThenAcross\_computeUsing_ fields.computeUsing — PaneDownThenAcross ``` { "type": "PaneDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcross\_computeUsing_ fields.computeUsing — TableAcross ``` { "type": "TableAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcrossThenDown\_computeUsing_ fields.computeUsing — TableAcrossThenDown ``` { "type": "TableAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: TableDown\_computeUsing_ fields.computeUsing — TableDown ``` { "type": "TableDown", "useOrderByForExtraFields": true } ``` _Example: TableDownThenAcross\_computeUsing_ fields.computeUsing — TableDownThenAcross ``` { "type": "TableDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: Geocoded\_positional_ fields.positional — Geocoded ``` { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" } } ``` _Example: Xy\_positional_ fields.positional — Xy ``` { "type": "Xy", "latitudeOrY": { "fieldName": "Example field", "objectName": "Example object" }, "longitudeOrX": { "fieldName": "Example field", "objectName": "Example object" } } ``` _Example: Difference\_quickTableCalc_ fields.quickTableCalc — Difference ``` { "type": "Difference" } ``` _Example: MovingAverage\_quickTableCalc_ fields.quickTableCalc — MovingAverage ``` { "type": "MovingAverage", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMax\_quickTableCalc_ fields.quickTableCalc — MovingMax ``` { "type": "MovingMax", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMin\_quickTableCalc_ fields.quickTableCalc — MovingMin ``` { "type": "MovingMin", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingSum\_quickTableCalc_ fields.quickTableCalc — MovingSum ``` { "type": "MovingSum", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: PercentDifference\_quickTableCalc_ fields.quickTableCalc — PercentDifference ``` { "type": "PercentDifference" } ``` _Example: PercentOfTotal\_quickTableCalc_ fields.quickTableCalc — PercentOfTotal ``` { "type": "PercentOfTotal" } ``` _Example: Percentile\_quickTableCalc_ fields.quickTableCalc — Percentile ``` { "type": "Percentile", "order": "Ascending" } ``` _Example: Rank\_quickTableCalc_ fields.quickTableCalc — Rank ``` { "type": "Rank", "order": "Ascending" } ``` _Example: RankDense\_quickTableCalc_ fields.quickTableCalc — RankDense ``` { "type": "RankDense", "order": "Ascending" } ``` _Example: RankModified\_quickTableCalc_ fields.quickTableCalc — RankModified ``` { "type": "RankModified", "order": "Ascending" } ``` _Example: RankUnique\_quickTableCalc_ fields.quickTableCalc — RankUnique ``` { "type": "RankUnique", "order": "Ascending" } ``` _Example: RunningAvg\_quickTableCalc_ fields.quickTableCalc — RunningAvg ``` { "type": "RunningAvg" } ``` _Example: RunningMax\_quickTableCalc_ fields.quickTableCalc — RunningMax ``` { "type": "RunningMax" } ``` _Example: RunningMin\_quickTableCalc_ fields.quickTableCalc — RunningMin ``` { "type": "RunningMin" } ``` _Example: RunningSum\_quickTableCalc_ fields.quickTableCalc — RunningSum ``` { "type": "RunningSum" } ``` _Example: GreaterThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — GreaterThan ``` { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: In\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — In ``` { "type": "In", "isCustom": true, "isExcludes": true, "useAll": true, "values": [] } ``` _Example: LessThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — LessThan ``` { "type": "LessThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: Nulls\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Nulls ``` { "type": "Nulls", "nullType": "All" } ``` _Example: Range\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Range ``` { "type": "Range", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: RelativeDate\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate ``` { "type": "RelativeDate", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "includeNulls": true, "isFiscal": true } ``` _Example: TopN\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — TopN ``` { "type": "TopN", "byField": "example_byField", "count": 100, "direction": "Bottom" } ``` _Example: WildCard\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — WildCard ``` { "type": "WildCard", "includeAllValuesWhenEmpty": true, "isExcludes": true, "operator": "Contains", "value": "example_value" } ``` _Example: Alphabetic\_fields_ view.viewSpecification.sortOrders.fields — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_fields_ view.viewSpecification.sortOrders.fields — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_fields_ view.viewSpecification.sortOrders.fields — nested ``` { "type": "nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Alphabetic\_sorts_ view.viewSpecification.sorts — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_sorts_ view.viewSpecification.sorts — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_sorts_ visualSpecification — \* ``` { "layout": "*", "columns": [ "example_columns" ], "forecasts": { "HoltWinters1": { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } }, "RidgeRegression2": { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } }, "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "marks": { "key1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "mode": "Table", "referenceLines": { "Band1": { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } }, "Line2": { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } }, "rows": [ "example_rows" ], "style": { "allHeaders": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "axis": { "key1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "Entire", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "key1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "key1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "panes": { "key1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } }, "referenceLines": { "key1": { "fillAboveColor": "example_fillAboveColor", "fillBelowColor": "example_fillBelowColor", "fillColor": "example_fillColor", "isVisible": true, "labelAlignment": { "horizontal": "Auto", "vertical": "Auto" }, "lineFormat": { "color": "example_color", "type": "None" } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "showDataPlaceholder": true, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Flow\_visualSpecification_ visualSpecification — Flow ``` { "layout": "Flow", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "levels": [ "example_levels" ], "link": "https://example.com", "marks": { "fields": { "field1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "links": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" }, "nodes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "levels": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "fields": { "field1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "links": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } }, "nodes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Map\_visualSpecification_ visualSpecification — Map ``` { "layout": "Map", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "locations": [ "example_locations" ], "marks": { "fields": { "field1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "panes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "background": { "type": "Blank", "domain": { "x": { "max": 100.5, "min": 100.5 }, "y": { "max": 100.5, "min": 100.5 } }, "style": { "type": "Name", "value": "example_value" }, "styleName": "Example style", "styleUrl": "https://example.com" }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "fields": { "field1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "panes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Radial\_visualSpecification_ visualSpecification — Radial ``` { "layout": "Radial", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "ban": [ "example_ban" ], "marks": { "panes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "rings": [ "example_rings" ], "slices": [ "example_slices" ], "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "axis": { "fields": { "field1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } } }, "ban": { "fields": { "field1": { "fieldLabel": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } } } }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rings": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "slices": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "headers": { "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "panes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Table\_visualSpecification_ visualSpecification — Table ``` { "layout": "Table", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "groups": [ "example_groups" ], "marks": { "fields": { "field1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "headers": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Color" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Bar" }, "panes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "rows": [ "example_rows" ], "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "groups": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "RowHeadersWidth", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "groups": { "mergeRepeatedCells": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "fields": { "field1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "headers": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } }, "panes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "subtotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Vizql\_visualSpecification_ visualSpecification — Vizql ``` { "layout": "Vizql", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "columns": [ "example_columns" ], "forecasts": { "HoltWinters1": { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } }, "RidgeRegression2": { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } }, "marks": { "fields": { "field1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "headers": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Color" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Bar" }, "panes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "referenceLines": { "Band1": { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } }, "Line2": { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } }, "rows": [ "example_rows" ], "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "axis": { "fields": { "field1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } } }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "Entire", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "fields": { "field1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "headers": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } }, "panes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "fieldKey": "example_fieldKey", "value": "example_value" } ], "showActions": true } } }, "referenceLines": { "key1": { "fillAboveColor": "example_fillAboveColor", "fillBelowColor": "example_fillBelowColor", "fillColor": "example_fillColor", "isVisible": true, "labelAlignment": { "horizontal": "Auto", "vertical": "Auto" }, "lineFormat": { "color": "example_color", "type": "None" } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "showDataPlaceholder": true, "subtotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: HoltWinters\_forecasts_ visualSpecification.forecasts — HoltWinters ``` { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } ``` _Example: RidgeRegression\_forecasts_ visualSpecification.forecasts — RidgeRegression ``` { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } ``` _Example: Band\_referenceLines_ visualSpecification.referenceLines — Band ``` { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } ``` _Example: Line\_referenceLines_ visualSpecification.referenceLines — Line ``` { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } ``` _Example: Computation\_endLine_ visualSpecification.referenceLines.endLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_endLine_ visualSpecification.referenceLines.endLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_label_ visualSpecification.referenceLines.endLine.label — Computation ``` { "type": "Computation" } ``` _Example: Custom\_label_ visualSpecification.referenceLines.endLine.label — Custom ``` { "type": "Custom", "labelText": "Text" } ``` _Example: None\_label_ visualSpecification.referenceLines.endLine.label — None ``` { "type": "None" } ``` _Example: Value\_label_ visualSpecification.referenceLines.endLine.label — Value ``` { "type": "Value" } ``` _Example: Computation\_startLine_ visualSpecification.referenceLines.startLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_startLine_ visualSpecification.referenceLines.startLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_line_ visualSpecification.referenceLines.line — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_line_ visualSpecification.referenceLines.line — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Auto\_range_ visualSpecification.style.axis.range — auto ``` { "type": "auto", "includeZero": true } ``` _Example: Custom\_range_ visualSpecification.style.axis.range — Custom ``` { "type": "Custom", "end": { "type": "Auto" }, "start": { "type": "Auto" } } ``` _Example: Auto\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — None ``` { "type": "None" } ``` _Example: Auto\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — None ``` { "type": "None" } ``` _Example: All\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — All ``` { "type": "All" } ``` _Example: LineEnds\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — LineEnds ``` { "type": "LineEnds", "labelEnd": true, "labelStart": true } ``` _Example: PropertyToken\_customText_ visualSpecification.style.marks.tooltip.customText — PropertyToken ``` { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime" } ``` _Example: SdmFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — SdmFieldToken ``` { "type": "SdmFieldToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "apiName": "Example api", "tokenType": "Parameter" } ``` _Example: Text\_customText_ visualSpecification.style.marks.tooltip.customText — Text ``` { "type": "Text", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "value": "example_value" } ``` _Example: VisualizationFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken ``` { "type": "VisualizationFieldToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "fieldKey": "example_fieldKey" } ``` _Example: Continuous\_colors_ visualSpecification.style.panes.colors — Continuous ``` { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] } } ``` _Example: Discrete\_colors_ visualSpecification.style.panes.colors — Discrete ``` { "type": "Discrete", "customColors": [ { "color": "example_color" } ], "palette": { "type": "Custom", "colors": [ "example_colors" ] } } ``` _Example: Custom\_palette_ visualSpecification.style.panes.colors.palette — Custom ``` { "type": "Custom", "colors": [ "example_colors" ] } ``` _Example: Blank\_background_ visualSpecification.style.background — Blank ``` { "type": "Blank" } ``` _Example: Grid\_background_ visualSpecification.style.background — Grid ``` { "type": "Grid", "domain": { "x": { "max": 100.5, "min": 100.5 }, "y": { "max": 100.5, "min": 100.5 } } } ``` _Example: Map\_background_ visualSpecification.style.background — Map ``` { "type": "Map", "domain": { "latitude": { "max": 100.5, "min": 100.5 }, "longitude": { "max": 100.5, "min": 100.5 } }, "style": { "type": "Name", "value": "example_value" }, "styleName": "Example style", "styleUrl": "https://example.com" } ``` _Example: Name\_style_ visualSpecification.style.background.style — Name ``` { "type": "Name", "value": "example_value" } ``` _Example: Url\_style_ visualSpecification.style.background.style — Url ``` { "type": "Url", "value": "example_value" } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.VisualizationRepresentation`. _Example Xy\_positional: same as POST /tableau/visualizations request._ fields.positional — Xy _Example RelativeDate\_filterInfos: same as POST /tableau/visualizations request._ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example nested\_sorts: same as POST /tableau/visualizations request._ visualSpecification — \* _Example HoltWinters\_forecasts: same as POST /tableau/visualizations request._ visualSpecification.forecasts — HoltWinters _Example RidgeRegression\_forecasts: same as POST /tableau/visualizations request._ visualSpecification.forecasts — RidgeRegression _Example Band\_referenceLines: same as POST /tableau/visualizations request._ visualSpecification.referenceLines — Band _Example Line\_referenceLines: same as POST /tableau/visualizations request._ visualSpecification.referenceLines — Line _Example PropertyToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — PropertyToken _Example SdmFieldToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example Text\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — Text _Example VisualizationFieldToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example Continuous\_colors: same as POST /tableau/visualizations request._ visualSpecification.style.panes.colors — Continuous _Example Map\_background: same as POST /tableau/visualizations request._ visualSpecification.style.background — Map _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FKtMF7bwBw4B88", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKAiXPrDQhkgyL", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKoWZUE3UNbR8R", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "dataSource": { "description": "This is an example description", "id": "0FKa5RhOcokoXUb", "label": "Label", "name": "Example Name", "type": "SemanticModel", "url": "https://example.com" }, "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "workspace": { "description": "This is an example description", "id": "0FKUVVs1VAS7H3f", "label": "Label", "name": "Example Name", "url": "https://example.com" }, "fields": { "field1": { "adHocCalc": { "dataType": "Boolean", "decimalPlace": 100, "description": "This is an example description", "displayCategory": "Continuous", "expression": "example_expression", "filters": [], "label": "Label", "shouldTreatNullsAsZeros": true }, "computeUsing": { "type": "Cell", "useOrderByForExtraFields": true }, "displayCategory": "Continuous", "fieldName": "Example field", "function": "Attr", "hierarchyLevel": 100, "hierarchyName": "Example hierarchy", "id": "0FKz6EDQ9bAwQW2", "label": "Label", "latitudeOrY": "example_latitudeOrY", "longitudeOrX": "example_longitudeOrX", "objectName": "Example object", "positionName": "Example position", "positional": { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" }, "latitudeOrY": { "fieldName": "Example field", "objectName": "Example object" }, "longitudeOrX": { "fieldName": "Example field", "objectName": "Example object" } }, "quickTableCalc": { "type": "Difference", "order": "Ascending", "nextValues": 100, "previousValues": 100, "useCurrentValue": true }, "role": "Dimension", "type": "Field" } }, "interactions": [ { "description": "This is an example description", "id": "0FKVASkVBndGbje", "label": "Label", "name": "Example Name", "actionType": "Filter", "assetId": "example_assetId", "eventType": "Click", "parameters": {} } ], "view": { "description": "This is an example description", "id": "0FKE39IBGhoFNBY", "label": "Label", "name": "Example Name", "isOriginal": true, "viewSpecification": { "advancedDimensionFilters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ], "aggregateFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "contextFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "filter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ], "grandTotals": { "columns": true, "rows": true }, "sortOrders": { "columns": [ { "byField": "example_byField", "order": "Ascending" } ], "fields": { "AlphabeticField1": { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" }, "FieldField2": { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "NestedField3": { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "alphabeticField4": { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } }, "rows": [ { "byField": "example_byField", "order": "Ascending" } ] }, "sorts": [ { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ], "style": { "headers": { "columns": { "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "groups": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } }, "rows": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } } }, "subtotals": { "columns": true, "rows": true }, "tableCalcFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] } } }, "visualSpecification": { "layout": "Flow", "columns": [ "example_columns" ], "forecasts": { "HoltWinters1": { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } }, "RidgeRegression2": { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } }, "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "marks": { "key1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "mode": "Table", "referenceLines": { "Band1": { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } }, "Line2": { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } }, "rows": [ "example_rows" ], "style": { "allHeaders": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "axis": { "key1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "Entire", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "key1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "key1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "panes": { "key1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } }, "referenceLines": { "key1": { "fillAboveColor": "example_fillAboveColor", "fillBelowColor": "example_fillBelowColor", "fillColor": "example_fillColor", "isVisible": true, "labelAlignment": { "horizontal": "Auto", "vertical": "Auto" }, "lineFormat": { "color": "example_color", "type": "None" } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "showDataPlaceholder": true, "title": { "isVisible": true, "titleText": "example_titleText" } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] } } } ``` _Example: Cell\_computeUsing_ fields.computeUsing — Cell ``` { "type": "Cell", "useOrderByForExtraFields": true } ``` _Example: PaneAcross\_computeUsing_ fields.computeUsing — PaneAcross ``` { "type": "PaneAcross", "useOrderByForExtraFields": true } ``` _Example: PaneAcrossThenDown\_computeUsing_ fields.computeUsing — PaneAcrossThenDown ``` { "type": "PaneAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: PaneDown\_computeUsing_ fields.computeUsing — PaneDown ``` { "type": "PaneDown", "useOrderByForExtraFields": true } ``` _Example: PaneDownThenAcross\_computeUsing_ fields.computeUsing — PaneDownThenAcross ``` { "type": "PaneDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcross\_computeUsing_ fields.computeUsing — TableAcross ``` { "type": "TableAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcrossThenDown\_computeUsing_ fields.computeUsing — TableAcrossThenDown ``` { "type": "TableAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: TableDown\_computeUsing_ fields.computeUsing — TableDown ``` { "type": "TableDown", "useOrderByForExtraFields": true } ``` _Example: TableDownThenAcross\_computeUsing_ fields.computeUsing — TableDownThenAcross ``` { "type": "TableDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: Geocoded\_positional_ fields.positional — Geocoded ``` { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" } } ``` _Example: Xy\_positional_ fields.positional — Xy _Example: Difference\_quickTableCalc_ fields.quickTableCalc — Difference ``` { "type": "Difference" } ``` _Example: MovingAverage\_quickTableCalc_ fields.quickTableCalc — MovingAverage ``` { "type": "MovingAverage", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMax\_quickTableCalc_ fields.quickTableCalc — MovingMax ``` { "type": "MovingMax", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMin\_quickTableCalc_ fields.quickTableCalc — MovingMin ``` { "type": "MovingMin", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingSum\_quickTableCalc_ fields.quickTableCalc — MovingSum ``` { "type": "MovingSum", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: PercentDifference\_quickTableCalc_ fields.quickTableCalc — PercentDifference ``` { "type": "PercentDifference" } ``` _Example: PercentOfTotal\_quickTableCalc_ fields.quickTableCalc — PercentOfTotal ``` { "type": "PercentOfTotal" } ``` _Example: Percentile\_quickTableCalc_ fields.quickTableCalc — Percentile ``` { "type": "Percentile", "order": "Ascending" } ``` _Example: Rank\_quickTableCalc_ fields.quickTableCalc — Rank ``` { "type": "Rank", "order": "Ascending" } ``` _Example: RankDense\_quickTableCalc_ fields.quickTableCalc — RankDense ``` { "type": "RankDense", "order": "Ascending" } ``` _Example: RankModified\_quickTableCalc_ fields.quickTableCalc — RankModified ``` { "type": "RankModified", "order": "Ascending" } ``` _Example: RankUnique\_quickTableCalc_ fields.quickTableCalc — RankUnique ``` { "type": "RankUnique", "order": "Ascending" } ``` _Example: RunningAvg\_quickTableCalc_ fields.quickTableCalc — RunningAvg ``` { "type": "RunningAvg" } ``` _Example: RunningMax\_quickTableCalc_ fields.quickTableCalc — RunningMax ``` { "type": "RunningMax" } ``` _Example: RunningMin\_quickTableCalc_ fields.quickTableCalc — RunningMin ``` { "type": "RunningMin" } ``` _Example: RunningSum\_quickTableCalc_ fields.quickTableCalc — RunningSum ``` { "type": "RunningSum" } ``` _Example: GreaterThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — GreaterThan ``` { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: In\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — In ``` { "type": "In", "isCustom": true, "isExcludes": true, "useAll": true, "values": [] } ``` _Example: LessThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — LessThan ``` { "type": "LessThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: Nulls\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Nulls ``` { "type": "Nulls", "nullType": "All" } ``` _Example: Range\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Range ``` { "type": "Range", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: RelativeDate\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example: TopN\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — TopN ``` { "type": "TopN", "byField": "example_byField", "count": 100, "direction": "Bottom" } ``` _Example: WildCard\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — WildCard ``` { "type": "WildCard", "includeAllValuesWhenEmpty": true, "isExcludes": true, "operator": "Contains", "value": "example_value" } ``` _Example: Alphabetic\_fields_ view.viewSpecification.sortOrders.fields — Alphabetic ``` { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_fields_ view.viewSpecification.sortOrders.fields — Field ``` { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_fields_ view.viewSpecification.sortOrders.fields — Nested ``` { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: alphabetic\_fields_ view.viewSpecification.sortOrders.fields — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: field\_fields_ view.viewSpecification.sortOrders.fields — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: nested\_fields_ view.viewSpecification.sortOrders.fields — nested ``` { "type": "nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Alphabetic\_sorts_ view.viewSpecification.sorts — Alphabetic ``` { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_sorts_ view.viewSpecification.sorts — Field ``` { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_sorts_ view.viewSpecification.sorts — Nested ``` { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: alphabetic\_sorts_ view.viewSpecification.sorts — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: field\_sorts_ view.viewSpecification.sorts — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: nested\_sorts_ visualSpecification — \* _Example: Flow\_visualSpecification_ visualSpecification — Flow ``` { "layout": "Flow", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "levels": [ "example_levels" ], "link": "https://example.com", "marks": { "fields": { "field1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "links": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" }, "nodes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "levels": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "fields": { "field1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "links": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } }, "nodes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Map\_visualSpecification_ visualSpecification — Map ``` { "layout": "Map", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "locations": [ "example_locations" ], "marks": { "fields": { "field1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "panes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "background": { "type": "Blank", "domain": { "latitude": { "max": 100.5, "min": 100.5 }, "longitude": { "max": 100.5, "min": 100.5 } }, "style": { "type": "Name", "value": "example_value" }, "styleName": "Example style", "styleUrl": "https://example.com" }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "fields": { "field1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "panes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Radial\_visualSpecification_ visualSpecification — Radial ``` { "layout": "Radial", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "ban": [ "example_ban" ], "marks": { "panes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "rings": [ "example_rings" ], "slices": [ "example_slices" ], "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "axis": { "fields": { "field1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } } }, "ban": { "fields": { "field1": { "fieldLabel": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } } } }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rings": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "slices": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "headers": { "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "panes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Table\_visualSpecification_ visualSpecification — Table ``` { "layout": "Table", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "groups": [ "example_groups" ], "marks": { "fields": { "field1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "headers": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Color" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Bar" }, "panes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "rows": [ "example_rows" ], "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "groups": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "RowHeadersWidth", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "groups": { "mergeRepeatedCells": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "fields": { "field1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "headers": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } }, "panes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "subtotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: Vizql\_visualSpecification_ visualSpecification — Vizql ``` { "layout": "Vizql", "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] }, "columns": [ "example_columns" ], "forecasts": { "HoltWinters1": { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } }, "RidgeRegression2": { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } }, "marks": { "fields": { "field1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "headers": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Color" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Bar" }, "panes": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "referenceLines": { "Band1": { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } }, "Line2": { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } }, "rows": [ "example_rows" ], "style": { "tooltip": { "container": { "color": "example_color", "transparency": 100 }, "isVisible": true }, "axis": { "fields": { "field1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } } }, "encodings": { "fields": { "field1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "Entire", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "fields": { "field1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "headers": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } }, "panes": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "referenceLines": { "key1": { "fillAboveColor": "example_fillAboveColor", "fillBelowColor": "example_fillBelowColor", "fillColor": "example_fillColor", "isVisible": true, "labelAlignment": { "horizontal": "Auto", "vertical": "Auto" }, "lineFormat": { "color": "example_color", "type": "None" } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "showDataPlaceholder": true, "subtotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "title": { "isVisible": true, "titleText": "example_titleText" } } } ``` _Example: HoltWinters\_forecasts_ visualSpecification.forecasts — HoltWinters _Example: RidgeRegression\_forecasts_ visualSpecification.forecasts — RidgeRegression _Example: Band\_referenceLines_ visualSpecification.referenceLines — Band _Example: Line\_referenceLines_ visualSpecification.referenceLines — Line _Example: Computation\_endLine_ visualSpecification.referenceLines.endLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_endLine_ visualSpecification.referenceLines.endLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_label_ visualSpecification.referenceLines.endLine.label — Computation ``` { "type": "Computation" } ``` _Example: Custom\_label_ visualSpecification.referenceLines.endLine.label — Custom ``` { "type": "Custom", "labelText": "Text" } ``` _Example: None\_label_ visualSpecification.referenceLines.endLine.label — None ``` { "type": "None" } ``` _Example: Value\_label_ visualSpecification.referenceLines.endLine.label — Value ``` { "type": "Value" } ``` _Example: Computation\_startLine_ visualSpecification.referenceLines.startLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_startLine_ visualSpecification.referenceLines.startLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_line_ visualSpecification.referenceLines.line — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_line_ visualSpecification.referenceLines.line — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Auto\_range_ visualSpecification.style.axis.range — Auto ``` { "type": "Auto", "includeZero": true } ``` _Example: Custom\_range_ visualSpecification.style.axis.range — Custom ``` { "type": "Custom", "end": { "type": "Auto" }, "start": { "type": "Auto" } } ``` _Example: auto\_range_ visualSpecification.style.axis.range — auto ``` { "type": "auto", "includeZero": true } ``` _Example: Auto\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — None ``` { "type": "None" } ``` _Example: Auto\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — None ``` { "type": "None" } ``` _Example: All\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — All ``` { "type": "All" } ``` _Example: LineEnds\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — LineEnds ``` { "type": "LineEnds", "labelEnd": true, "labelStart": true } ``` _Example: PropertyToken\_customText_ visualSpecification.style.marks.tooltip.customText — PropertyToken _Example: SdmFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example: Text\_customText_ visualSpecification.style.marks.tooltip.customText — Text _Example: VisualizationFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example: Continuous\_colors_ visualSpecification.style.panes.colors — Continuous _Example: Discrete\_colors_ visualSpecification.style.panes.colors — Discrete ``` { "type": "Discrete", "customColors": [ { "color": "example_color" } ], "palette": { "type": "Custom", "colors": [ "example_colors" ] } } ``` _Example: Custom\_palette_ visualSpecification.style.panes.colors.palette — Custom ``` { "type": "Custom", "colors": [ "example_colors" ] } ``` _Example: Blank\_background_ visualSpecification.style.background — Blank ``` { "type": "Blank" } ``` _Example: Grid\_background_ visualSpecification.style.background — Grid ``` { "type": "Grid", "domain": { "x": { "max": 100.5, "min": 100.5 }, "y": { "max": 100.5, "min": 100.5 } } } ``` _Example: Map\_background_ visualSpecification.style.background — Map _Example: Name\_style_ visualSpecification.style.background.style — Name ``` { "type": "Name", "value": "example_value" } ``` _Example: Url\_style_ visualSpecification.style.background.style — Url ``` { "type": "Url", "value": "example_value" } ``` ### GET Get visualization `GET /tableau/visualizations/{visualizationIdOrApiName}` Operation ID: `getVisualization`. Tags: Visualizations. Accesses a Tableau Next Visualization by ID or name. Get a Tableau Next visualization by ID or API name. #### Parameters * `visualizationIdOrApiName` (path, string, required) The ID or API name of the visualization. * `minorVersion` (query, integer) The minor API version for visualization operations. #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.VisualizationRepresentation`. _Example Xy\_positional: same as POST /tableau/visualizations request._ fields.positional — Xy _Example RelativeDate\_filterInfos: same as POST /tableau/visualizations request._ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example Nested\_sorts: same as POST /tableau/visualizations request._ visualSpecification — \* _Example nested\_sorts: same as POST /tableau/visualizations request._ visualSpecification — \* _Example Flow\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Flow _Example Map\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Map _Example Radial\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Radial _Example Table\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Table _Example Vizql\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Vizql _Example HoltWinters\_forecasts: same as POST /tableau/visualizations request._ visualSpecification.forecasts — HoltWinters _Example RidgeRegression\_forecasts: same as POST /tableau/visualizations request._ visualSpecification.forecasts — RidgeRegression _Example Band\_referenceLines: same as POST /tableau/visualizations request._ visualSpecification.referenceLines — Band _Example Line\_referenceLines: same as POST /tableau/visualizations request._ visualSpecification.referenceLines — Line _Example PropertyToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — PropertyToken _Example SdmFieldToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example Text\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — Text _Example VisualizationFieldToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example Continuous\_colors: same as POST /tableau/visualizations request._ visualSpecification.style.panes.colors — Continuous _Example Map\_background: same as POST /tableau/visualizations request._ visualSpecification.style.background — Map _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FKtXmacPltH9H1", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKlUGrXu6I7RG2", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKZ4NER1UDln27", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "dataSource": { "description": "This is an example description", "id": "0FK1ERukNd6vPt6", "label": "Label", "name": "Example Name", "type": "SemanticModel", "url": "https://example.com" }, "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "workspace": { "description": "This is an example description", "id": "0FK8OOE1NA5d9Kd", "label": "Label", "name": "Example Name", "url": "https://example.com" }, "fields": { "field1": { "adHocCalc": { "dataType": "Boolean", "decimalPlace": 100, "description": "This is an example description", "displayCategory": "Continuous", "expression": "example_expression", "filters": [], "label": "Label", "shouldTreatNullsAsZeros": true }, "computeUsing": { "type": "Cell", "useOrderByForExtraFields": true }, "displayCategory": "Continuous", "fieldName": "Example field", "function": "Attr", "hierarchyLevel": 100, "hierarchyName": "Example hierarchy", "id": "0FKXJQzjkMvE96w", "label": "Label", "latitudeOrY": "example_latitudeOrY", "longitudeOrX": "example_longitudeOrX", "objectName": "Example object", "positionName": "Example position", "positional": { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" }, "latitudeOrY": { "fieldName": "Example field", "objectName": "Example object" }, "longitudeOrX": { "fieldName": "Example field", "objectName": "Example object" } }, "quickTableCalc": { "type": "Difference", "order": "Ascending", "nextValues": 100, "previousValues": 100, "useCurrentValue": true }, "role": "Dimension", "type": "Field" } }, "interactions": [ { "description": "This is an example description", "id": "0FKz9nkTKF0rnzR", "label": "Label", "name": "Example Name", "actionType": "Filter", "assetId": "example_assetId", "eventType": "Click", "parameters": {} } ], "view": { "description": "This is an example description", "id": "0FK2Btzr10xCMOi", "label": "Label", "name": "Example Name", "isOriginal": true, "viewSpecification": { "advancedDimensionFilters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ], "aggregateFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "contextFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "filter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ], "grandTotals": { "columns": true, "rows": true }, "sortOrders": { "columns": [ { "byField": "example_byField", "order": "Ascending" } ], "fields": { "AlphabeticField1": { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" }, "FieldField2": { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "NestedField3": { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "alphabeticField4": { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } }, "rows": [ { "byField": "example_byField", "order": "Ascending" } ] }, "sorts": [ { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ], "style": { "headers": { "columns": { "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "groups": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } }, "rows": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } } }, "subtotals": { "columns": true, "rows": true }, "tableCalcFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] } } }, "visualSpecification": { "layout": "Flow", "columns": [ "example_columns" ], "forecasts": { "HoltWinters1": { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } }, "RidgeRegression2": { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } }, "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "marks": { "key1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "mode": "Table", "referenceLines": { "Band1": { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } }, "Line2": { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } }, "rows": [ "example_rows" ], "style": { "allHeaders": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "axis": { "key1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "Entire", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "key1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "key1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "panes": { "key1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } }, "referenceLines": { "key1": { "fillAboveColor": "example_fillAboveColor", "fillBelowColor": "example_fillBelowColor", "fillColor": "example_fillColor", "isVisible": true, "labelAlignment": { "horizontal": "Auto", "vertical": "Auto" }, "lineFormat": { "color": "example_color", "type": "None" } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "showDataPlaceholder": true, "title": { "isVisible": true, "titleText": "example_titleText" } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] } } } ``` _Example: Cell\_computeUsing_ fields.computeUsing — Cell ``` { "type": "Cell", "useOrderByForExtraFields": true } ``` _Example: PaneAcross\_computeUsing_ fields.computeUsing — PaneAcross ``` { "type": "PaneAcross", "useOrderByForExtraFields": true } ``` _Example: PaneAcrossThenDown\_computeUsing_ fields.computeUsing — PaneAcrossThenDown ``` { "type": "PaneAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: PaneDown\_computeUsing_ fields.computeUsing — PaneDown ``` { "type": "PaneDown", "useOrderByForExtraFields": true } ``` _Example: PaneDownThenAcross\_computeUsing_ fields.computeUsing — PaneDownThenAcross ``` { "type": "PaneDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcross\_computeUsing_ fields.computeUsing — TableAcross ``` { "type": "TableAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcrossThenDown\_computeUsing_ fields.computeUsing — TableAcrossThenDown ``` { "type": "TableAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: TableDown\_computeUsing_ fields.computeUsing — TableDown ``` { "type": "TableDown", "useOrderByForExtraFields": true } ``` _Example: TableDownThenAcross\_computeUsing_ fields.computeUsing — TableDownThenAcross ``` { "type": "TableDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: Geocoded\_positional_ fields.positional — Geocoded ``` { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" } } ``` _Example: Xy\_positional_ fields.positional — Xy _Example: Difference\_quickTableCalc_ fields.quickTableCalc — Difference ``` { "type": "Difference" } ``` _Example: MovingAverage\_quickTableCalc_ fields.quickTableCalc — MovingAverage ``` { "type": "MovingAverage", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMax\_quickTableCalc_ fields.quickTableCalc — MovingMax ``` { "type": "MovingMax", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMin\_quickTableCalc_ fields.quickTableCalc — MovingMin ``` { "type": "MovingMin", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingSum\_quickTableCalc_ fields.quickTableCalc — MovingSum ``` { "type": "MovingSum", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: PercentDifference\_quickTableCalc_ fields.quickTableCalc — PercentDifference ``` { "type": "PercentDifference" } ``` _Example: PercentOfTotal\_quickTableCalc_ fields.quickTableCalc — PercentOfTotal ``` { "type": "PercentOfTotal" } ``` _Example: Percentile\_quickTableCalc_ fields.quickTableCalc — Percentile ``` { "type": "Percentile", "order": "Ascending" } ``` _Example: Rank\_quickTableCalc_ fields.quickTableCalc — Rank ``` { "type": "Rank", "order": "Ascending" } ``` _Example: RankDense\_quickTableCalc_ fields.quickTableCalc — RankDense ``` { "type": "RankDense", "order": "Ascending" } ``` _Example: RankModified\_quickTableCalc_ fields.quickTableCalc — RankModified ``` { "type": "RankModified", "order": "Ascending" } ``` _Example: RankUnique\_quickTableCalc_ fields.quickTableCalc — RankUnique ``` { "type": "RankUnique", "order": "Ascending" } ``` _Example: RunningAvg\_quickTableCalc_ fields.quickTableCalc — RunningAvg ``` { "type": "RunningAvg" } ``` _Example: RunningMax\_quickTableCalc_ fields.quickTableCalc — RunningMax ``` { "type": "RunningMax" } ``` _Example: RunningMin\_quickTableCalc_ fields.quickTableCalc — RunningMin ``` { "type": "RunningMin" } ``` _Example: RunningSum\_quickTableCalc_ fields.quickTableCalc — RunningSum ``` { "type": "RunningSum" } ``` _Example: GreaterThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — GreaterThan ``` { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: In\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — In ``` { "type": "In", "isCustom": true, "isExcludes": true, "useAll": true, "values": [] } ``` _Example: LessThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — LessThan ``` { "type": "LessThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: Nulls\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Nulls ``` { "type": "Nulls", "nullType": "All" } ``` _Example: Range\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Range ``` { "type": "Range", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: RelativeDate\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example: TopN\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — TopN ``` { "type": "TopN", "byField": "example_byField", "count": 100, "direction": "Bottom" } ``` _Example: WildCard\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — WildCard ``` { "type": "WildCard", "includeAllValuesWhenEmpty": true, "isExcludes": true, "operator": "Contains", "value": "example_value" } ``` _Example: Alphabetic\_fields_ view.viewSpecification.sortOrders.fields — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_fields_ view.viewSpecification.sortOrders.fields — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_fields_ view.viewSpecification.sortOrders.fields — nested ``` { "type": "nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: alphabetic\_fields_ view.viewSpecification.sortOrders.fields — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: field\_fields_ view.viewSpecification.sortOrders.fields — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: nested\_fields_ view.viewSpecification.sortOrders.fields — nested ``` { "type": "nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Alphabetic\_sorts_ view.viewSpecification.sorts — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_sorts_ view.viewSpecification.sorts — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_sorts_ visualSpecification — \* _Example: alphabetic\_sorts_ view.viewSpecification.sorts — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: field\_sorts_ view.viewSpecification.sorts — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: nested\_sorts_ visualSpecification — \* _Example: Flow\_visualSpecification_ visualSpecification — Flow _Example: Map\_visualSpecification_ visualSpecification — Map _Example: Radial\_visualSpecification_ visualSpecification — Radial _Example: Table\_visualSpecification_ visualSpecification — Table _Example: Vizql\_visualSpecification_ visualSpecification — Vizql _Example: HoltWinters\_forecasts_ visualSpecification.forecasts — HoltWinters _Example: RidgeRegression\_forecasts_ visualSpecification.forecasts — RidgeRegression _Example: Band\_referenceLines_ visualSpecification.referenceLines — Band _Example: Line\_referenceLines_ visualSpecification.referenceLines — Line _Example: Computation\_endLine_ visualSpecification.referenceLines.endLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_endLine_ visualSpecification.referenceLines.endLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_label_ visualSpecification.referenceLines.endLine.label — Computation ``` { "type": "Computation" } ``` _Example: Custom\_label_ visualSpecification.referenceLines.endLine.label — Custom ``` { "type": "Custom", "labelText": "Text" } ``` _Example: None\_label_ visualSpecification.referenceLines.endLine.label — None ``` { "type": "None" } ``` _Example: Value\_label_ visualSpecification.referenceLines.endLine.label — Value ``` { "type": "Value" } ``` _Example: Computation\_startLine_ visualSpecification.referenceLines.startLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_startLine_ visualSpecification.referenceLines.startLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_line_ visualSpecification.referenceLines.line — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_line_ visualSpecification.referenceLines.line — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Auto\_range_ visualSpecification.style.axis.range — auto ``` { "type": "auto", "includeZero": true } ``` _Example: Custom\_range_ visualSpecification.style.axis.range — Custom ``` { "type": "Custom", "end": { "type": "Auto" }, "start": { "type": "Auto" } } ``` _Example: auto\_range_ visualSpecification.style.axis.range — auto ``` { "type": "auto", "includeZero": true } ``` _Example: Auto\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — None ``` { "type": "None" } ``` _Example: Auto\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — None ``` { "type": "None" } ``` _Example: All\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — All ``` { "type": "All" } ``` _Example: LineEnds\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — LineEnds ``` { "type": "LineEnds", "labelEnd": true, "labelStart": true } ``` _Example: PropertyToken\_customText_ visualSpecification.style.marks.tooltip.customText — PropertyToken _Example: SdmFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example: Text\_customText_ visualSpecification.style.marks.tooltip.customText — Text _Example: VisualizationFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example: Continuous\_colors_ visualSpecification.style.panes.colors — Continuous _Example: Discrete\_colors_ visualSpecification.style.panes.colors — Discrete ``` { "type": "Discrete", "customColors": [ { "color": "example_color" } ], "palette": { "type": "Custom", "colors": [ "example_colors" ] } } ``` _Example: Custom\_palette_ visualSpecification.style.panes.colors.palette — Custom ``` { "type": "Custom", "colors": [ "example_colors" ] } ``` _Example: Blank\_background_ visualSpecification.style.background — Blank ``` { "type": "Blank" } ``` _Example: Grid\_background_ visualSpecification.style.background — Grid ``` { "type": "Grid", "domain": { "x": { "max": 100.5, "min": 100.5 }, "y": { "max": 100.5, "min": 100.5 } } } ``` _Example: Map\_background_ visualSpecification.style.background — Map _Example: Name\_style_ visualSpecification.style.background.style — Name ``` { "type": "Name", "value": "example_value" } ``` _Example: Url\_style_ visualSpecification.style.background.style — Url ``` { "type": "Url", "value": "example_value" } ``` ### DELETE Delete visualization `DELETE /tableau/visualizations/{visualizationIdOrApiName}` Operation ID: `deleteVisualization`. Tags: Visualizations. Accesses a Tableau Next Visualization by ID or name. Delete a Tableau Next visualization by ID or API name. #### Parameters * `visualizationIdOrApiName` (path, string, required) The ID or API name of the visualization. #### Responses * **200** Success. ### PATCH Update visualization `PATCH /tableau/visualizations/{visualizationIdOrApiName}` Operation ID: `updateVisualization`. Tags: Visualizations. Accesses a Tableau Next Visualization by ID or name. Update a Tableau Next visualization by ID or API name. #### Parameters * `visualizationIdOrApiName` (path, string, required) The ID or API name of the visualization. * `minorVersion` (query, integer) The minor API version for visualization operations. #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.VisualizationInputRepresentation`. _Example fullExample: same as POST /tableau/visualizations request._ Full operation example — complete request body _Example Xy\_positional: same as POST /tableau/visualizations request._ fields.positional — Xy _Example RelativeDate\_filterInfos: same as POST /tableau/visualizations request._ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example Nested\_sorts: same as POST /tableau/visualizations request._ visualSpecification — \* _Example Flow\_visualSpecification: same as POST /tableau/visualizations request._ visualSpecification — Flow _Example Map\_visualSpecification: same as POST /tableau/visualizations request._ visualSpecification — Map _Example Radial\_visualSpecification: same as POST /tableau/visualizations request._ visualSpecification — Radial _Example Table\_visualSpecification: same as POST /tableau/visualizations request._ visualSpecification — Table _Example Vizql\_visualSpecification: same as POST /tableau/visualizations request._ visualSpecification — Vizql _Example HoltWinters\_forecasts: same as POST /tableau/visualizations request._ visualSpecification.forecasts — HoltWinters _Example RidgeRegression\_forecasts: same as POST /tableau/visualizations request._ visualSpecification.forecasts — RidgeRegression _Example Band\_referenceLines: same as POST /tableau/visualizations request._ visualSpecification.referenceLines — Band _Example Line\_referenceLines: same as POST /tableau/visualizations request._ visualSpecification.referenceLines — Line _Example PropertyToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — PropertyToken _Example SdmFieldToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example Text\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — Text _Example VisualizationFieldToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example Continuous\_colors: same as POST /tableau/visualizations request._ visualSpecification.style.panes.colors — Continuous _Example Map\_background: same as POST /tableau/visualizations request._ visualSpecification.style.background — Map _Example: fullExample_ Full operation example — complete request body _Example: Cell\_computeUsing_ fields.computeUsing — Cell ``` { "type": "Cell", "useOrderByForExtraFields": true } ``` _Example: PaneAcross\_computeUsing_ fields.computeUsing — PaneAcross ``` { "type": "PaneAcross", "useOrderByForExtraFields": true } ``` _Example: PaneAcrossThenDown\_computeUsing_ fields.computeUsing — PaneAcrossThenDown ``` { "type": "PaneAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: PaneDown\_computeUsing_ fields.computeUsing — PaneDown ``` { "type": "PaneDown", "useOrderByForExtraFields": true } ``` _Example: PaneDownThenAcross\_computeUsing_ fields.computeUsing — PaneDownThenAcross ``` { "type": "PaneDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcross\_computeUsing_ fields.computeUsing — TableAcross ``` { "type": "TableAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcrossThenDown\_computeUsing_ fields.computeUsing — TableAcrossThenDown ``` { "type": "TableAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: TableDown\_computeUsing_ fields.computeUsing — TableDown ``` { "type": "TableDown", "useOrderByForExtraFields": true } ``` _Example: TableDownThenAcross\_computeUsing_ fields.computeUsing — TableDownThenAcross ``` { "type": "TableDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: Geocoded\_positional_ fields.positional — Geocoded ``` { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" } } ``` _Example: Xy\_positional_ fields.positional — Xy _Example: Difference\_quickTableCalc_ fields.quickTableCalc — Difference ``` { "type": "Difference" } ``` _Example: MovingAverage\_quickTableCalc_ fields.quickTableCalc — MovingAverage ``` { "type": "MovingAverage", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMax\_quickTableCalc_ fields.quickTableCalc — MovingMax ``` { "type": "MovingMax", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMin\_quickTableCalc_ fields.quickTableCalc — MovingMin ``` { "type": "MovingMin", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingSum\_quickTableCalc_ fields.quickTableCalc — MovingSum ``` { "type": "MovingSum", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: PercentDifference\_quickTableCalc_ fields.quickTableCalc — PercentDifference ``` { "type": "PercentDifference" } ``` _Example: PercentOfTotal\_quickTableCalc_ fields.quickTableCalc — PercentOfTotal ``` { "type": "PercentOfTotal" } ``` _Example: Percentile\_quickTableCalc_ fields.quickTableCalc — Percentile ``` { "type": "Percentile", "order": "Ascending" } ``` _Example: Rank\_quickTableCalc_ fields.quickTableCalc — Rank ``` { "type": "Rank", "order": "Ascending" } ``` _Example: RankDense\_quickTableCalc_ fields.quickTableCalc — RankDense ``` { "type": "RankDense", "order": "Ascending" } ``` _Example: RankModified\_quickTableCalc_ fields.quickTableCalc — RankModified ``` { "type": "RankModified", "order": "Ascending" } ``` _Example: RankUnique\_quickTableCalc_ fields.quickTableCalc — RankUnique ``` { "type": "RankUnique", "order": "Ascending" } ``` _Example: RunningAvg\_quickTableCalc_ fields.quickTableCalc — RunningAvg ``` { "type": "RunningAvg" } ``` _Example: RunningMax\_quickTableCalc_ fields.quickTableCalc — RunningMax ``` { "type": "RunningMax" } ``` _Example: RunningMin\_quickTableCalc_ fields.quickTableCalc — RunningMin ``` { "type": "RunningMin" } ``` _Example: RunningSum\_quickTableCalc_ fields.quickTableCalc — RunningSum ``` { "type": "RunningSum" } ``` _Example: GreaterThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — GreaterThan ``` { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: In\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — In ``` { "type": "In", "isCustom": true, "isExcludes": true, "useAll": true, "values": [] } ``` _Example: LessThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — LessThan ``` { "type": "LessThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: Nulls\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Nulls ``` { "type": "Nulls", "nullType": "All" } ``` _Example: Range\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Range ``` { "type": "Range", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: RelativeDate\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example: TopN\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — TopN ``` { "type": "TopN", "byField": "example_byField", "count": 100, "direction": "Bottom" } ``` _Example: WildCard\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — WildCard ``` { "type": "WildCard", "includeAllValuesWhenEmpty": true, "isExcludes": true, "operator": "Contains", "value": "example_value" } ``` _Example: Alphabetic\_fields_ view.viewSpecification.sortOrders.fields — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_fields_ view.viewSpecification.sortOrders.fields — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_fields_ view.viewSpecification.sortOrders.fields — nested ``` { "type": "nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Alphabetic\_sorts_ view.viewSpecification.sorts — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_sorts_ view.viewSpecification.sorts — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_sorts_ visualSpecification — \* _Example: Flow\_visualSpecification_ visualSpecification — Flow _Example: Map\_visualSpecification_ visualSpecification — Map _Example: Radial\_visualSpecification_ visualSpecification — Radial _Example: Table\_visualSpecification_ visualSpecification — Table _Example: Vizql\_visualSpecification_ visualSpecification — Vizql _Example: HoltWinters\_forecasts_ visualSpecification.forecasts — HoltWinters _Example: RidgeRegression\_forecasts_ visualSpecification.forecasts — RidgeRegression _Example: Band\_referenceLines_ visualSpecification.referenceLines — Band _Example: Line\_referenceLines_ visualSpecification.referenceLines — Line _Example: Computation\_endLine_ visualSpecification.referenceLines.endLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_endLine_ visualSpecification.referenceLines.endLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_label_ visualSpecification.referenceLines.endLine.label — Computation ``` { "type": "Computation" } ``` _Example: Custom\_label_ visualSpecification.referenceLines.endLine.label — Custom ``` { "type": "Custom", "labelText": "Text" } ``` _Example: None\_label_ visualSpecification.referenceLines.endLine.label — None ``` { "type": "None" } ``` _Example: Value\_label_ visualSpecification.referenceLines.endLine.label — Value ``` { "type": "Value" } ``` _Example: Computation\_startLine_ visualSpecification.referenceLines.startLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_startLine_ visualSpecification.referenceLines.startLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_line_ visualSpecification.referenceLines.line — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_line_ visualSpecification.referenceLines.line — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Auto\_range_ visualSpecification.style.axis.range — auto ``` { "type": "auto", "includeZero": true } ``` _Example: Custom\_range_ visualSpecification.style.axis.range — Custom ``` { "type": "Custom", "end": { "type": "Auto" }, "start": { "type": "Auto" } } ``` _Example: Auto\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — None ``` { "type": "None" } ``` _Example: Auto\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — None ``` { "type": "None" } ``` _Example: All\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — All ``` { "type": "All" } ``` _Example: LineEnds\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — LineEnds ``` { "type": "LineEnds", "labelEnd": true, "labelStart": true } ``` _Example: PropertyToken\_customText_ visualSpecification.style.marks.tooltip.customText — PropertyToken _Example: SdmFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example: Text\_customText_ visualSpecification.style.marks.tooltip.customText — Text _Example: VisualizationFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example: Continuous\_colors_ visualSpecification.style.panes.colors — Continuous _Example: Discrete\_colors_ visualSpecification.style.panes.colors — Discrete ``` { "type": "Discrete", "customColors": [ { "color": "example_color" } ], "palette": { "type": "Custom", "colors": [ "example_colors" ] } } ``` _Example: Custom\_palette_ visualSpecification.style.panes.colors.palette — Custom ``` { "type": "Custom", "colors": [ "example_colors" ] } ``` _Example: Blank\_background_ visualSpecification.style.background — Blank ``` { "type": "Blank" } ``` _Example: Grid\_background_ visualSpecification.style.background — Grid ``` { "type": "Grid", "domain": { "x": { "max": 100.5, "min": 100.5 }, "y": { "max": 100.5, "min": 100.5 } } } ``` _Example: Map\_background_ visualSpecification.style.background — Map _Example: Name\_style_ visualSpecification.style.background.style — Name ``` { "type": "Name", "value": "example_value" } ``` _Example: Url\_style_ visualSpecification.style.background.style — Url ``` { "type": "Url", "value": "example_value" } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.VisualizationRepresentation`. _Example Xy\_positional: same as POST /tableau/visualizations request._ fields.positional — Xy _Example RelativeDate\_filterInfos: same as POST /tableau/visualizations request._ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example nested\_sorts: same as POST /tableau/visualizations request._ visualSpecification — \* _Example Flow\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Flow _Example Map\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Map _Example Radial\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Radial _Example Table\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Table _Example Vizql\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualSpecification — Vizql _Example HoltWinters\_forecasts: same as POST /tableau/visualizations request._ visualSpecification.forecasts — HoltWinters _Example RidgeRegression\_forecasts: same as POST /tableau/visualizations request._ visualSpecification.forecasts — RidgeRegression _Example Band\_referenceLines: same as POST /tableau/visualizations request._ visualSpecification.referenceLines — Band _Example Line\_referenceLines: same as POST /tableau/visualizations request._ visualSpecification.referenceLines — Line _Example PropertyToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — PropertyToken _Example SdmFieldToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example Text\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — Text _Example VisualizationFieldToken\_customText: same as POST /tableau/visualizations request._ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example Continuous\_colors: same as POST /tableau/visualizations request._ visualSpecification.style.panes.colors — Continuous _Example Map\_background: same as POST /tableau/visualizations request._ visualSpecification.style.background — Map _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FKWzKGwDJwNsu2", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKZlQHWg8yRXbC", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKOyPBfKC9K8tv", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "dataSource": { "description": "This is an example description", "id": "0FKtbUHT2Nl4wUk", "label": "Label", "name": "Example Name", "type": "SemanticModel", "url": "https://example.com" }, "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "workspace": { "description": "This is an example description", "id": "0FKRcUmonYkTDNh", "label": "Label", "name": "Example Name", "url": "https://example.com" }, "fields": { "field1": { "adHocCalc": { "dataType": "Boolean", "decimalPlace": 100, "description": "This is an example description", "displayCategory": "Continuous", "expression": "example_expression", "filters": [], "label": "Label", "shouldTreatNullsAsZeros": true }, "computeUsing": { "type": "Cell", "useOrderByForExtraFields": true }, "displayCategory": "Continuous", "fieldName": "Example field", "function": "Attr", "hierarchyLevel": 100, "hierarchyName": "Example hierarchy", "id": "0FKygxL5wdxMsnh", "label": "Label", "latitudeOrY": "example_latitudeOrY", "longitudeOrX": "example_longitudeOrX", "objectName": "Example object", "positionName": "Example position", "positional": { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" }, "latitudeOrY": { "fieldName": "Example field", "objectName": "Example object" }, "longitudeOrX": { "fieldName": "Example field", "objectName": "Example object" } }, "quickTableCalc": { "type": "Difference", "order": "Ascending", "nextValues": 100, "previousValues": 100, "useCurrentValue": true }, "role": "Dimension", "type": "Field" } }, "interactions": [ { "description": "This is an example description", "id": "0FKYMVrn3RXKZuX", "label": "Label", "name": "Example Name", "actionType": "Filter", "assetId": "example_assetId", "eventType": "Click", "parameters": {} } ], "view": { "description": "This is an example description", "id": "0FKviVAnOCPbdSp", "label": "Label", "name": "Example Name", "isOriginal": true, "viewSpecification": { "advancedDimensionFilters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ], "aggregateFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "contextFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "filter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ], "grandTotals": { "columns": true, "rows": true }, "sortOrders": { "columns": [ { "byField": "example_byField", "order": "Ascending" } ], "fields": { "AlphabeticField1": { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" }, "FieldField2": { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "NestedField3": { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "alphabeticField4": { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } }, "rows": [ { "byField": "example_byField", "order": "Ascending" } ] }, "sorts": [ { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ], "style": { "headers": { "columns": { "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "groups": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } }, "rows": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } } }, "subtotals": { "columns": true, "rows": true }, "tableCalcFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] } } }, "visualSpecification": { "layout": "Flow", "columns": [ "example_columns" ], "forecasts": { "HoltWinters1": { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } }, "RidgeRegression2": { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } }, "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "marks": { "key1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "mode": "Table", "referenceLines": { "Band1": { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } }, "Line2": { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } }, "rows": [ "example_rows" ], "style": { "allHeaders": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "axis": { "key1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "Entire", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "key1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "key1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "panes": { "key1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } }, "referenceLines": { "key1": { "fillAboveColor": "example_fillAboveColor", "fillBelowColor": "example_fillBelowColor", "fillColor": "example_fillColor", "isVisible": true, "labelAlignment": { "horizontal": "Auto", "vertical": "Auto" }, "lineFormat": { "color": "example_color", "type": "None" } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "showDataPlaceholder": true, "title": { "isVisible": true, "titleText": "example_titleText" } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] } } } ``` _Example: Cell\_computeUsing_ fields.computeUsing — Cell ``` { "type": "Cell", "useOrderByForExtraFields": true } ``` _Example: PaneAcross\_computeUsing_ fields.computeUsing — PaneAcross ``` { "type": "PaneAcross", "useOrderByForExtraFields": true } ``` _Example: PaneAcrossThenDown\_computeUsing_ fields.computeUsing — PaneAcrossThenDown ``` { "type": "PaneAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: PaneDown\_computeUsing_ fields.computeUsing — PaneDown ``` { "type": "PaneDown", "useOrderByForExtraFields": true } ``` _Example: PaneDownThenAcross\_computeUsing_ fields.computeUsing — PaneDownThenAcross ``` { "type": "PaneDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcross\_computeUsing_ fields.computeUsing — TableAcross ``` { "type": "TableAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcrossThenDown\_computeUsing_ fields.computeUsing — TableAcrossThenDown ``` { "type": "TableAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: TableDown\_computeUsing_ fields.computeUsing — TableDown ``` { "type": "TableDown", "useOrderByForExtraFields": true } ``` _Example: TableDownThenAcross\_computeUsing_ fields.computeUsing — TableDownThenAcross ``` { "type": "TableDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: Geocoded\_positional_ fields.positional — Geocoded ``` { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" } } ``` _Example: Xy\_positional_ fields.positional — Xy _Example: Difference\_quickTableCalc_ fields.quickTableCalc — Difference ``` { "type": "Difference" } ``` _Example: MovingAverage\_quickTableCalc_ fields.quickTableCalc — MovingAverage ``` { "type": "MovingAverage", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMax\_quickTableCalc_ fields.quickTableCalc — MovingMax ``` { "type": "MovingMax", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMin\_quickTableCalc_ fields.quickTableCalc — MovingMin ``` { "type": "MovingMin", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingSum\_quickTableCalc_ fields.quickTableCalc — MovingSum ``` { "type": "MovingSum", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: PercentDifference\_quickTableCalc_ fields.quickTableCalc — PercentDifference ``` { "type": "PercentDifference" } ``` _Example: PercentOfTotal\_quickTableCalc_ fields.quickTableCalc — PercentOfTotal ``` { "type": "PercentOfTotal" } ``` _Example: Percentile\_quickTableCalc_ fields.quickTableCalc — Percentile ``` { "type": "Percentile", "order": "Ascending" } ``` _Example: Rank\_quickTableCalc_ fields.quickTableCalc — Rank ``` { "type": "Rank", "order": "Ascending" } ``` _Example: RankDense\_quickTableCalc_ fields.quickTableCalc — RankDense ``` { "type": "RankDense", "order": "Ascending" } ``` _Example: RankModified\_quickTableCalc_ fields.quickTableCalc — RankModified ``` { "type": "RankModified", "order": "Ascending" } ``` _Example: RankUnique\_quickTableCalc_ fields.quickTableCalc — RankUnique ``` { "type": "RankUnique", "order": "Ascending" } ``` _Example: RunningAvg\_quickTableCalc_ fields.quickTableCalc — RunningAvg ``` { "type": "RunningAvg" } ``` _Example: RunningMax\_quickTableCalc_ fields.quickTableCalc — RunningMax ``` { "type": "RunningMax" } ``` _Example: RunningMin\_quickTableCalc_ fields.quickTableCalc — RunningMin ``` { "type": "RunningMin" } ``` _Example: RunningSum\_quickTableCalc_ fields.quickTableCalc — RunningSum ``` { "type": "RunningSum" } ``` _Example: GreaterThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — GreaterThan ``` { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: In\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — In ``` { "type": "In", "isCustom": true, "isExcludes": true, "useAll": true, "values": [] } ``` _Example: LessThan\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — LessThan ``` { "type": "LessThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: Nulls\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Nulls ``` { "type": "Nulls", "nullType": "All" } ``` _Example: Range\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — Range ``` { "type": "Range", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: RelativeDate\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example: TopN\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — TopN ``` { "type": "TopN", "byField": "example_byField", "count": 100, "direction": "Bottom" } ``` _Example: WildCard\_filterInfos_ view.viewSpecification.advancedDimensionFilters.filterInfos — WildCard ``` { "type": "WildCard", "includeAllValuesWhenEmpty": true, "isExcludes": true, "operator": "Contains", "value": "example_value" } ``` _Example: Alphabetic\_fields_ view.viewSpecification.sortOrders.fields — Alphabetic ``` { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_fields_ view.viewSpecification.sortOrders.fields — Field ``` { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_fields_ view.viewSpecification.sortOrders.fields — Nested ``` { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: alphabetic\_fields_ view.viewSpecification.sortOrders.fields — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: field\_fields_ view.viewSpecification.sortOrders.fields — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: nested\_fields_ view.viewSpecification.sortOrders.fields — nested ``` { "type": "nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Alphabetic\_sorts_ view.viewSpecification.sorts — Alphabetic ``` { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_sorts_ view.viewSpecification.sorts — Field ``` { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_sorts_ view.viewSpecification.sorts — Nested ``` { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: alphabetic\_sorts_ view.viewSpecification.sorts — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: field\_sorts_ view.viewSpecification.sorts — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: nested\_sorts_ visualSpecification — \* _Example: Flow\_visualSpecification_ visualSpecification — Flow _Example: Map\_visualSpecification_ visualSpecification — Map _Example: Radial\_visualSpecification_ visualSpecification — Radial _Example: Table\_visualSpecification_ visualSpecification — Table _Example: Vizql\_visualSpecification_ visualSpecification — Vizql _Example: HoltWinters\_forecasts_ visualSpecification.forecasts — HoltWinters _Example: RidgeRegression\_forecasts_ visualSpecification.forecasts — RidgeRegression _Example: Band\_referenceLines_ visualSpecification.referenceLines — Band _Example: Line\_referenceLines_ visualSpecification.referenceLines — Line _Example: Computation\_endLine_ visualSpecification.referenceLines.endLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_endLine_ visualSpecification.referenceLines.endLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_label_ visualSpecification.referenceLines.endLine.label — Computation ``` { "type": "Computation" } ``` _Example: Custom\_label_ visualSpecification.referenceLines.endLine.label — Custom ``` { "type": "Custom", "labelText": "Text" } ``` _Example: None\_label_ visualSpecification.referenceLines.endLine.label — None ``` { "type": "None" } ``` _Example: Value\_label_ visualSpecification.referenceLines.endLine.label — Value ``` { "type": "Value" } ``` _Example: Computation\_startLine_ visualSpecification.referenceLines.startLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_startLine_ visualSpecification.referenceLines.startLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_line_ visualSpecification.referenceLines.line — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_line_ visualSpecification.referenceLines.line — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Auto\_range_ visualSpecification.style.axis.range — Auto ``` { "type": "Auto", "includeZero": true } ``` _Example: Custom\_range_ visualSpecification.style.axis.range — Custom ``` { "type": "Custom", "end": { "type": "Auto" }, "start": { "type": "Auto" } } ``` _Example: auto\_range_ visualSpecification.style.axis.range — auto ``` { "type": "auto", "includeZero": true } ``` _Example: Auto\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_majorTicks_ visualSpecification.style.axis.ticks.majorTicks — None ``` { "type": "None" } ``` _Example: Auto\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_minorTicks_ visualSpecification.style.axis.ticks.minorTicks — None ``` { "type": "None" } ``` _Example: All\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — All ``` { "type": "All" } ``` _Example: LineEnds\_marksToLabel_ visualSpecification.style.marks.label.marksToLabel — LineEnds ``` { "type": "LineEnds", "labelEnd": true, "labelStart": true } ``` _Example: PropertyToken\_customText_ visualSpecification.style.marks.tooltip.customText — PropertyToken _Example: SdmFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example: Text\_customText_ visualSpecification.style.marks.tooltip.customText — Text _Example: VisualizationFieldToken\_customText_ visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example: Continuous\_colors_ visualSpecification.style.panes.colors — Continuous _Example: Discrete\_colors_ visualSpecification.style.panes.colors — Discrete ``` { "type": "Discrete", "customColors": [ { "color": "example_color" } ], "palette": { "type": "Custom", "colors": [ "example_colors" ] } } ``` _Example: Custom\_palette_ visualSpecification.style.panes.colors.palette — Custom ``` { "type": "Custom", "colors": [ "example_colors" ] } ``` _Example: Blank\_background_ visualSpecification.style.background — Blank ``` { "type": "Blank" } ``` _Example: Grid\_background_ visualSpecification.style.background — Grid ``` { "type": "Grid", "domain": { "x": { "max": 100.5, "min": 100.5 }, "y": { "max": 100.5, "min": 100.5 } } } ``` _Example: Map\_background_ visualSpecification.style.background — Map _Example: Name\_style_ visualSpecification.style.background.style — Name ``` { "type": "Name", "value": "example_value" } ``` _Example: Url\_style_ visualSpecification.style.background.style — Url ``` { "type": "Url", "value": "example_value" } ``` ### GET Get visualization bundle `GET /tableau/visualizations/{visualizationIdOrApiName}/bundle` Operation ID: `getVisualizationBundle`. Tags: Visualizations. Accesses a Tableau Next Visualization by ID or name along with additional information. Get a Tableau Next visualization by ID or Name with additional information. #### Parameters * `visualizationIdOrApiName` (path, string, required) The ID or API name of the visualization. * `minorVersion` (query, integer) The minor API version for visualization bundle operation. #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.VisualizationBundleRepresentation`. _Example Xy\_positional: same as POST /tableau/visualizations request._ visualization.fields.positional — Xy _Example RelativeDate\_filterInfos: same as POST /tableau/visualizations request._ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example Nested\_sorts: same as POST /tableau/visualizations request._ visualization.visualSpecification — \* _Example nested\_sorts: same as POST /tableau/visualizations request._ visualization.visualSpecification — \* _Example Flow\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualization.visualSpecification — Flow _Example Map\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualization.visualSpecification — Map _Example Radial\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualization.visualSpecification — Radial _Example Table\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualization.visualSpecification — Table _Example Vizql\_visualSpecification: same as POST /tableau/visualizations 200 response._ visualization.visualSpecification — Vizql _Example HoltWinters\_forecasts: same as POST /tableau/visualizations request._ visualization.visualSpecification.forecasts — HoltWinters _Example RidgeRegression\_forecasts: same as POST /tableau/visualizations request._ visualization.visualSpecification.forecasts — RidgeRegression _Example Band\_referenceLines: same as POST /tableau/visualizations request._ visualization.visualSpecification.referenceLines — Band _Example Line\_referenceLines: same as POST /tableau/visualizations request._ visualization.visualSpecification.referenceLines — Line _Example PropertyToken\_customText: same as POST /tableau/visualizations request._ visualization.visualSpecification.style.marks.tooltip.customText — PropertyToken _Example SdmFieldToken\_customText: same as POST /tableau/visualizations request._ visualization.visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example Text\_customText: same as POST /tableau/visualizations request._ visualization.visualSpecification.style.marks.tooltip.customText — Text _Example VisualizationFieldToken\_customText: same as POST /tableau/visualizations request._ visualization.visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example Continuous\_colors: same as POST /tableau/visualizations request._ visualization.visualSpecification.style.panes.colors — Continuous _Example Map\_background: same as POST /tableau/visualizations request._ visualization.visualSpecification.style.background — Map _Example: fullExample_ Full operation example — complete response body ``` { "dataSource": { "type": "SemanticModel" }, "visualization": { "description": "This is an example description", "id": "0FKKatWEjjWNkEE", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKNXWg5wVoATxj", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKUKCuu10Piyfd", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "dataSource": { "description": "This is an example description", "id": "0FK4Y5GDmymhz9m", "label": "Label", "name": "Example Name", "type": "SemanticModel", "url": "https://example.com" }, "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "sourceVersion": { "major": 100, "minor": 100 }, "templateSource": { "assetName": "Example asset", "name": "Example Name" }, "workspace": { "description": "This is an example description", "id": "0FKGhWVmwCwQJjw", "label": "Label", "name": "Example Name", "url": "https://example.com" }, "fields": { "field1": { "adHocCalc": { "dataType": "Boolean", "decimalPlace": 100, "description": "This is an example description", "displayCategory": "Continuous", "expression": "example_expression", "filters": [], "label": "Label", "shouldTreatNullsAsZeros": true }, "computeUsing": { "type": "Cell", "useOrderByForExtraFields": true }, "displayCategory": "Continuous", "fieldName": "Example field", "function": "Attr", "hierarchyLevel": 100, "hierarchyName": "Example hierarchy", "id": "0FKtzjQkK4lE3UG", "label": "Label", "latitudeOrY": "example_latitudeOrY", "longitudeOrX": "example_longitudeOrX", "objectName": "Example object", "positionName": "Example position", "positional": { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" }, "latitudeOrY": { "fieldName": "Example field", "objectName": "Example object" }, "longitudeOrX": { "fieldName": "Example field", "objectName": "Example object" } }, "quickTableCalc": { "type": "Difference", "order": "Ascending", "nextValues": 100, "previousValues": 100, "useCurrentValue": true }, "role": "Dimension", "type": "Field" } }, "interactions": [ { "description": "This is an example description", "id": "0FK3bzDZ1qHu10F", "label": "Label", "name": "Example Name", "actionType": "Filter", "assetId": "example_assetId", "eventType": "Click", "parameters": {} } ], "view": { "description": "This is an example description", "id": "0FKzFaQcgQ2344J", "label": "Label", "name": "Example Name", "isOriginal": true, "viewSpecification": { "advancedDimensionFilters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ], "aggregateFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "contextFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "filter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] }, "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ], "grandTotals": { "columns": true, "rows": true }, "sortOrders": { "columns": [ { "byField": "example_byField", "order": "Ascending" } ], "fields": { "AlphabeticField1": { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" }, "FieldField2": { "type": "Field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "NestedField3": { "type": "Nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" }, "alphabeticField4": { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } }, "rows": [ { "byField": "example_byField", "order": "Ascending" } ] }, "sorts": [ { "type": "Alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ], "style": { "headers": { "columns": { "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "groups": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } }, "rows": { "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } } }, "subtotals": { "columns": true, "rows": true }, "tableCalcFilter": { "filterLogic": "example_filterLogic", "filters": [ { "fieldKey": "example_fieldKey", "fieldKeys": [ "example_fieldKeys" ], "filter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [ { "expression": "example_expression", "model": "example_model" } ], "includeNulls": true, "measureCriteria": { "unifiedFilter": { "fields": [], "includeNulls": true, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] } }, "topBottomCriteria": { "expression": "example_expression", "isTop": true, "nullValuesPosition": "NullsFirst", "topBottomLimit": 100 }, "values": [] }, "filterInfos": [ { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true, "isCustom": true, "isExcludes": true, "useAll": true, "values": [], "includeAllValuesWhenEmpty": true, "operator": "Contains", "value": "example_value", "byField": "example_byField", "count": 100, "direction": "Bottom", "anchorRelativeDate": "example_anchorRelativeDate", "beginPeriod": { "unit": "Day", "value": 100 }, "endPeriod": { "unit": "Day", "value": 100 }, "isFiscal": true, "nullType": "All" } ], "includeAllValues": true, "isContext": true } ] } } }, "visualSpecification": { "layout": "Flow", "columns": [ "example_columns" ], "forecasts": { "HoltWinters1": { "forecastModel": "HoltWinters", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } }, "RidgeRegression2": { "forecastModel": "RidgeRegression", "confidenceLevel": 100, "dimensionFields": [ { "dateDim": { "fieldKey": "example_fieldKey", "granularity": "InferFromData" } } ], "fillNullsWithZero": true, "from": { "predefinedDate": "LatestData" }, "ignoreLastPeriods": 100, "includeBounds": true, "measureFieldKey": "example_measureFieldKey", "to": { "forecastInterval": { "timeUnit": "Days", "value": 100 } } } }, "legends": { "key1": { "isVisible": true, "position": "Bottom", "title": { "isVisible": true, "titleText": "example_titleText" } } }, "marks": { "key1": { "encodings": [ { "fieldKey": "example_fieldKey", "type": "Angle" } ], "isAutomatic": true, "stack": { "isAutomatic": true, "isStacked": true }, "type": "Area" } }, "measureValues": [ "example_measureValues" ], "mode": "Table", "referenceLines": { "Band1": { "type": "Band", "fieldKey": "example_fieldKey", "scope": "Cell", "endLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" }, "startLine": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } }, "Line2": { "type": "Line", "fieldKey": "example_fieldKey", "scope": "Cell", "line": { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } } }, "rows": [ "example_rows" ], "style": { "allHeaders": { "columns": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldHeight": { "field1": 100.5 }, "indexHeight": 100.5, "width": 100.5 } }, "fields": { "field1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "rows": { "mergeRepeatedCells": true, "showIndex": true, "sizing": { "fieldWidth": { "field1": 100.5 }, "height": 100.5, "indexWidth": 100.5 } } }, "axis": { "key1": { "dualAxis": { "synchronization": "FullRange" }, "isVisible": true, "isZeroLineVisible": true, "range": { "type": "Auto", "includeZero": true, "end": { "type": "Auto" }, "start": { "type": "Auto" } }, "scale": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "ticks": { "majorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" }, "minorTicks": { "type": "Auto", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } }, "titleText": "example_titleText" } }, "fieldLabels": { "columns": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true }, "rows": { "backgroundColor": "example_backgroundColor", "showDividerLine": true, "showLabels": true } }, "fit": "Entire", "fonts": { "actionableHeaders": { "color": "example_color", "size": 100 }, "axisTickLabels": { "color": "example_color", "size": 100 }, "ban": { "color": "example_color" }, "fieldLabels": { "color": "example_color", "size": 100 }, "grandTotalLabel": { "color": "example_color", "size": 100 }, "grandTotalValues": { "color": "example_color", "size": 100 }, "headers": { "color": "example_color", "size": 100 }, "legendLabels": { "color": "example_color", "size": 100 }, "markLabels": { "color": "example_color", "size": 100 }, "marks": { "color": "example_color", "size": 100 }, "subtotalLabel": { "color": "example_color", "size": 100 }, "subtotalValues": { "color": "example_color", "size": 100 } }, "grandTotals": { "columns": { "label": "Label", "position": "End" }, "rows": { "label": "Label", "position": "End" } }, "headers": { "key1": { "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "hiddenValues": [ "example_hiddenValues" ], "isVisible": true, "showMissingValues": true, "textDirection": "Auto" } }, "lines": { "axisLine": { "color": "example_color" }, "fieldLabelDividerLine": { "color": "example_color" }, "separatorLine": { "color": "example_color" }, "zeroLine": { "color": "example_color" } }, "marks": { "key1": { "color": { "color": "example_color" }, "connector": { "type": "Origami" }, "isAutomaticOpacity": true, "isAutomaticSize": true, "isStackingAxisCentered": true, "label": { "canOverlapLabels": true, "marksToLabel": { "type": "All", "labelEnd": true, "labelStart": true }, "showMarkLabels": true, "textDirection": "Auto" }, "opacity": 100, "range": { "reverse": true }, "size": { "isAutomatic": true, "type": "Percentage", "value": 100 }, "tooltip": { "customText": [ { "type": "PropertyToken", "properties": { "bold": true, "color": "example_color", "family": "example_family", "horizontalAlign": "Center", "italic": true, "size": 100, "underline": true }, "tokenType": "DataRefreshTime", "apiName": "Example api", "value": "example_value", "fieldKey": "example_fieldKey" } ], "showActions": true } } }, "panes": { "key1": { "colors": { "type": "Continuous", "palette": { "end": "example_end", "middle": "example_middle", "middleToEndSteps": [ "example_middleToEndSteps" ], "start": "example_start", "startToEndSteps": [ "example_startToEndSteps" ], "startToMiddleSteps": [ "example_startToMiddleSteps" ] }, "customColors": [ { "color": "example_color" } ] }, "defaults": { "format": { "dateTemplate": "example_dateTemplate", "numberFormatInfo": { "decimalPlaces": 100, "displayUnits": "Auto", "includeThousandSeparator": true, "negativeValuesFormat": "Auto", "prefix": "example_prefix", "suffix": "example_suffix", "type": "Currency" } } }, "isAutomaticSize": true, "size": { "isAutomatic": true, "max": 100, "min": 100, "type": "Percentage" } } }, "referenceLines": { "key1": { "fillAboveColor": "example_fillAboveColor", "fillBelowColor": "example_fillBelowColor", "fillColor": "example_fillColor", "isVisible": true, "labelAlignment": { "horizontal": "Auto", "vertical": "Auto" }, "lineFormat": { "color": "example_color", "type": "None" } } }, "shading": { "backgroundColor": "example_backgroundColor", "banding": { "rows": { "application": { "level": 100, "size": 100 }, "color": "example_color" } } }, "showDataPlaceholder": true, "title": { "isVisible": true, "titleText": "example_titleText" } }, "stylesheet": { "rules": [ { "scope": { "markType": "example_markType" }, "selector": "ActionableHeaderLabel", "style": { "backgroundColor": "example_backgroundColor", "border": { "radius": 100.5, "style": "Dashed", "width": 100.5 }, "color": "example_color", "font": { "family": "example_family", "italic": true, "size": 100, "underline": true, "weight": "Bold" }, "line": { "smoothness": 100.5, "style": "Dashed", "width": 100.5 }, "opacity": 100.5, "padding": { "bottom": 100, "left": 100, "right": 100, "top": 100 }, "text": { "halign": "Center", "textDirection": "Auto", "valign": "Bottom", "wrap": true }, "visibility": "Hidden" } } ] } } } } ``` _Example: SemanticModel\_dataSource_ dataSource — SemanticModel ``` { "type": "SemanticModel" } ``` _Example: Cell\_computeUsing_ visualization.fields.computeUsing — Cell ``` { "type": "Cell", "useOrderByForExtraFields": true } ``` _Example: PaneAcross\_computeUsing_ visualization.fields.computeUsing — PaneAcross ``` { "type": "PaneAcross", "useOrderByForExtraFields": true } ``` _Example: PaneAcrossThenDown\_computeUsing_ visualization.fields.computeUsing — PaneAcrossThenDown ``` { "type": "PaneAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: PaneDown\_computeUsing_ visualization.fields.computeUsing — PaneDown ``` { "type": "PaneDown", "useOrderByForExtraFields": true } ``` _Example: PaneDownThenAcross\_computeUsing_ visualization.fields.computeUsing — PaneDownThenAcross ``` { "type": "PaneDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcross\_computeUsing_ visualization.fields.computeUsing — TableAcross ``` { "type": "TableAcross", "useOrderByForExtraFields": true } ``` _Example: TableAcrossThenDown\_computeUsing_ visualization.fields.computeUsing — TableAcrossThenDown ``` { "type": "TableAcrossThenDown", "useOrderByForExtraFields": true } ``` _Example: TableDown\_computeUsing_ visualization.fields.computeUsing — TableDown ``` { "type": "TableDown", "useOrderByForExtraFields": true } ``` _Example: TableDownThenAcross\_computeUsing_ visualization.fields.computeUsing — TableDownThenAcross ``` { "type": "TableDownThenAcross", "useOrderByForExtraFields": true } ``` _Example: Geocoded\_positional_ visualization.fields.positional — Geocoded ``` { "type": "Geocoded", "geocoded": { "fieldName": "Example field", "objectName": "Example object" } } ``` _Example: Xy\_positional_ visualization.fields.positional — Xy _Example: Difference\_quickTableCalc_ visualization.fields.quickTableCalc — Difference ``` { "type": "Difference" } ``` _Example: MovingAverage\_quickTableCalc_ visualization.fields.quickTableCalc — MovingAverage ``` { "type": "MovingAverage", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMax\_quickTableCalc_ visualization.fields.quickTableCalc — MovingMax ``` { "type": "MovingMax", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingMin\_quickTableCalc_ visualization.fields.quickTableCalc — MovingMin ``` { "type": "MovingMin", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: MovingSum\_quickTableCalc_ visualization.fields.quickTableCalc — MovingSum ``` { "type": "MovingSum", "nextValues": 100, "previousValues": 100, "useCurrentValue": true } ``` _Example: PercentDifference\_quickTableCalc_ visualization.fields.quickTableCalc — PercentDifference ``` { "type": "PercentDifference" } ``` _Example: PercentOfTotal\_quickTableCalc_ visualization.fields.quickTableCalc — PercentOfTotal ``` { "type": "PercentOfTotal" } ``` _Example: Percentile\_quickTableCalc_ visualization.fields.quickTableCalc — Percentile ``` { "type": "Percentile", "order": "Ascending" } ``` _Example: Rank\_quickTableCalc_ visualization.fields.quickTableCalc — Rank ``` { "type": "Rank", "order": "Ascending" } ``` _Example: RankDense\_quickTableCalc_ visualization.fields.quickTableCalc — RankDense ``` { "type": "RankDense", "order": "Ascending" } ``` _Example: RankModified\_quickTableCalc_ visualization.fields.quickTableCalc — RankModified ``` { "type": "RankModified", "order": "Ascending" } ``` _Example: RankUnique\_quickTableCalc_ visualization.fields.quickTableCalc — RankUnique ``` { "type": "RankUnique", "order": "Ascending" } ``` _Example: RunningAvg\_quickTableCalc_ visualization.fields.quickTableCalc — RunningAvg ``` { "type": "RunningAvg" } ``` _Example: RunningMax\_quickTableCalc_ visualization.fields.quickTableCalc — RunningMax ``` { "type": "RunningMax" } ``` _Example: RunningMin\_quickTableCalc_ visualization.fields.quickTableCalc — RunningMin ``` { "type": "RunningMin" } ``` _Example: RunningSum\_quickTableCalc_ visualization.fields.quickTableCalc — RunningSum ``` { "type": "RunningSum" } ``` _Example: GreaterThan\_filterInfos_ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — GreaterThan ``` { "type": "GreaterThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: In\_filterInfos_ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — In ``` { "type": "In", "isCustom": true, "isExcludes": true, "useAll": true, "values": [] } ``` _Example: LessThan\_filterInfos_ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — LessThan ``` { "type": "LessThan", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: Nulls\_filterInfos_ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — Nulls ``` { "type": "Nulls", "nullType": "All" } ``` _Example: Range\_filterInfos_ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — Range ``` { "type": "Range", "includeNulls": true, "showOnlyRelevantValues": true } ``` _Example: RelativeDate\_filterInfos_ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — RelativeDate _Example: TopN\_filterInfos_ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — TopN ``` { "type": "TopN", "byField": "example_byField", "count": 100, "direction": "Bottom" } ``` _Example: WildCard\_filterInfos_ visualization.view.viewSpecification.advancedDimensionFilters.filterInfos — WildCard ``` { "type": "WildCard", "includeAllValuesWhenEmpty": true, "isExcludes": true, "operator": "Contains", "value": "example_value" } ``` _Example: Alphabetic\_fields_ visualization.view.viewSpecification.sortOrders.fields — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_fields_ visualization.view.viewSpecification.sortOrders.fields — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_fields_ visualization.view.viewSpecification.sortOrders.fields — nested ``` { "type": "nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: alphabetic\_fields_ visualization.view.viewSpecification.sortOrders.fields — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: field\_fields_ visualization.view.viewSpecification.sortOrders.fields — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: nested\_fields_ visualization.view.viewSpecification.sortOrders.fields — nested ``` { "type": "nested", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Alphabetic\_sorts_ visualization.view.viewSpecification.sorts — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: Field\_sorts_ visualization.view.viewSpecification.sorts — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: Nested\_sorts_ visualization.visualSpecification — \* _Example: alphabetic\_sorts_ visualization.view.viewSpecification.sorts — alphabetic ``` { "type": "alphabetic", "fieldKey": "example_fieldKey", "order": "Ascending" } ``` _Example: field\_sorts_ visualization.view.viewSpecification.sorts — field ``` { "type": "field", "fieldKey": "example_fieldKey", "order": "Ascending", "byField": "example_byField" } ``` _Example: nested\_sorts_ visualization.visualSpecification — \* _Example: Flow\_visualSpecification_ visualization.visualSpecification — Flow _Example: Map\_visualSpecification_ visualization.visualSpecification — Map _Example: Radial\_visualSpecification_ visualization.visualSpecification — Radial _Example: Table\_visualSpecification_ visualization.visualSpecification — Table _Example: Vizql\_visualSpecification_ visualization.visualSpecification — Vizql _Example: HoltWinters\_forecasts_ visualization.visualSpecification.forecasts — HoltWinters _Example: RidgeRegression\_forecasts_ visualization.visualSpecification.forecasts — RidgeRegression _Example: Band\_referenceLines_ visualization.visualSpecification.referenceLines — Band _Example: Line\_referenceLines_ visualization.visualSpecification.referenceLines — Line _Example: Computation\_endLine_ visualization.visualSpecification.referenceLines.endLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_endLine_ visualization.visualSpecification.referenceLines.endLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_label_ visualization.visualSpecification.referenceLines.endLine.label — Computation ``` { "type": "Computation" } ``` _Example: Custom\_label_ visualization.visualSpecification.referenceLines.endLine.label — Custom ``` { "type": "Custom", "labelText": "Text" } ``` _Example: None\_label_ visualization.visualSpecification.referenceLines.endLine.label — None ``` { "type": "None" } ``` _Example: Value\_label_ visualization.visualSpecification.referenceLines.endLine.label — Value ``` { "type": "Value" } ``` _Example: Computation\_startLine_ visualization.visualSpecification.referenceLines.startLine — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_startLine_ visualization.visualSpecification.referenceLines.startLine — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Computation\_line_ visualization.visualSpecification.referenceLines.line — Computation ``` { "valueType": "Computation", "label": { "type": "Computation", "labelText": "Text" }, "fieldKey": "example_fieldKey", "function": "Avg" } ``` _Example: Value\_line_ visualization.visualSpecification.referenceLines.line — Value ``` { "valueType": "Value", "label": { "type": "Computation", "labelText": "Text" } } ``` _Example: Auto\_range_ visualization.visualSpecification.style.axis.range — auto ``` { "type": "auto", "includeZero": true } ``` _Example: Custom\_range_ visualization.visualSpecification.style.axis.range — Custom ``` { "type": "Custom", "end": { "type": "Auto" }, "start": { "type": "Auto" } } ``` _Example: auto\_range_ visualization.visualSpecification.style.axis.range — auto ``` { "type": "auto", "includeZero": true } ``` _Example: Auto\_majorTicks_ visualization.visualSpecification.style.axis.ticks.majorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_majorTicks_ visualization.visualSpecification.style.axis.ticks.majorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_majorTicks_ visualization.visualSpecification.style.axis.ticks.majorTicks — None ``` { "type": "None" } ``` _Example: Auto\_minorTicks_ visualization.visualSpecification.style.axis.ticks.minorTicks — Auto ``` { "type": "Auto" } ``` _Example: Fixed\_minorTicks_ visualization.visualSpecification.style.axis.ticks.minorTicks — Fixed ``` { "type": "Fixed", "dateInfo": { "showOnlyDateBoundary": true, "unit": "Day" }, "interval": 100, "origin": "example_origin" } ``` _Example: None\_minorTicks_ visualization.visualSpecification.style.axis.ticks.minorTicks — None ``` { "type": "None" } ``` _Example: All\_marksToLabel_ visualization.visualSpecification.style.marks.label.marksToLabel — All ``` { "type": "All" } ``` _Example: LineEnds\_marksToLabel_ visualization.visualSpecification.style.marks.label.marksToLabel — LineEnds ``` { "type": "LineEnds", "labelEnd": true, "labelStart": true } ``` _Example: PropertyToken\_customText_ visualization.visualSpecification.style.marks.tooltip.customText — PropertyToken _Example: SdmFieldToken\_customText_ visualization.visualSpecification.style.marks.tooltip.customText — SdmFieldToken _Example: Text\_customText_ visualization.visualSpecification.style.marks.tooltip.customText — Text _Example: VisualizationFieldToken\_customText_ visualization.visualSpecification.style.marks.tooltip.customText — VisualizationFieldToken _Example: Continuous\_colors_ visualization.visualSpecification.style.panes.colors — Continuous _Example: Discrete\_colors_ visualization.visualSpecification.style.panes.colors — Discrete ``` { "type": "Discrete", "customColors": [ { "color": "example_color" } ], "palette": { "type": "Custom", "colors": [ "example_colors" ] } } ``` _Example: Custom\_palette_ visualization.visualSpecification.style.panes.colors.palette — Custom ``` { "type": "Custom", "colors": [ "example_colors" ] } ``` _Example: Blank\_background_ visualization.visualSpecification.style.background — Blank ``` { "type": "Blank" } ``` _Example: Grid\_background_ visualization.visualSpecification.style.background — Grid ``` { "type": "Grid", "domain": { "x": { "max": 100.5, "min": 100.5 }, "y": { "max": 100.5, "min": 100.5 } } } ``` _Example: Map\_background_ visualization.visualSpecification.style.background — Map _Example: Name\_style_ visualization.visualSpecification.style.background.style — Name ``` { "type": "Name", "value": "example_value" } ``` _Example: Url\_style_ visualization.visualSpecification.style.background.style — Url ``` { "type": "Url", "value": "example_value" } ``` ### GET List workspaces `GET /tableau/workspaces` Operation ID: `getWorkspaces`. Tags: Workspaces. Creates a new workspace. Get all available Tableau Next Workspaces. #### Parameters * `lastModifiedBy` (query, string (Id)) Pattern: ^(005)\\w\*. * `limit` (query, integer) * `offset` (query, integer) * `searchTerm` (query, string) * `sortBy` (query, sfdc.unified.analytics.connect.api.enums.AnalyticsAssetsQueryOrderByEnum) * `sortDirection` (query, sfdc.unified.analytics.connect.api.enums.AnalyticsAssetsQuerySortDirectionEnum) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "workspaces": [ { "description": "This is an example description", "id": "0FKAfSdXIaZolJJ", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKln02zKEFv6Nb", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKIuhnTB58lrPq", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "assetsCount": 100, "cacheableKey": "example_cacheableKey", "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "url": "https://example.com" } ] } ``` ### POST Create workspace `POST /tableau/workspaces` Operation ID: `postWorkspaceCollection`. Tags: Workspaces. Creates a new workspace. Creates a Tableau Next workspace. #### Parameters * `description` (query, string) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.workspace.WorkspaceInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "description": "This is an example description", "label": "Label", "name": "Example Name" } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FK6LEV5trnF788", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FK63vvt7KrXIIr", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKtaPkiwg6sO9B", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "assetsCount": 100, "cacheableKey": "example_cacheableKey", "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "url": "https://example.com" } ``` ### GET Get workspace `GET /tableau/workspaces/{workspaceIdOrApiName}` Operation ID: `getWorkspace`. Tags: Workspaces. Resource to access Tableau Next Workspace by ID. Get Tableau Next Workspace by ID or Name. #### Parameters * `workspaceIdOrApiName` (path, string, required) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FK1EF7EjAXQt0B", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKhdrHgWvOuIAn", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKBI33X6UbXIuh", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "assetsCount": 100, "cacheableKey": "example_cacheableKey", "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "url": "https://example.com" } ``` ### DELETE Delete workspace `DELETE /tableau/workspaces/{workspaceIdOrApiName}` Operation ID: `deleteWorkspace`. Tags: Workspaces. Resource to access Tableau Next Workspace by ID. Delete Tableau Next Workspace by ID or Name. #### Parameters * `workspaceIdOrApiName` (path, string, required) #### Responses * **200** Success. ### PATCH Update workspace `PATCH /tableau/workspaces/{workspaceIdOrApiName}` Operation ID: `patchWorkspace`. Tags: Workspaces. Resource to access Tableau Next Workspace by ID. Update Tableau Next Workspace Metadata by ID or Name. #### Parameters * `workspaceIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.workspace.WorkspaceInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "description": "This is an example description", "label": "Label", "name": "Example Name" } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FK8iiiVHCoXYws", "label": "Label", "name": "Example Name", "createdBy": { "description": "This is an example description", "id": "0FKEKWNdFETGLHW", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "lastModifiedBy": { "description": "This is an example description", "id": "0FKCvZLIkiLTbe7", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "lastModifiedDate": "2026-02-16 10:00:00+00:00", "assetsCount": 100, "cacheableKey": "example_cacheableKey", "permissions": { "delete": true, "edit": true, "share": true, "view": true }, "url": "https://example.com" } ``` ### GET Get workspace assets `GET /tableau/workspaces/{workspaceIdOrApiName}/assets` Operation ID: `getWorkspaceAssets`. Tags: Workspaces. Resource to access associated assets of a workspace. Get all available assets in a Tableau Next Workspace filterable by asset usage type. #### Parameters * `workspaceIdOrApiName` (path, string, required) * `assetUsageType` (query, string) * `limit` (query, integer) * `offset` (query, integer) #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "workspaceAssets": [ { "description": "This is an example description", "id": "0FKMWl8At4QsGGW", "label": "Label", "name": "Example Name", "assetId": "example_assetId", "assetType": "AnalyticsDashboard", "assetUsageType": "Created", "createdBy": { "description": "This is an example description", "id": "0FK5hPry44EBeVz", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "url": "https://example.com" } ] } ``` ### POST Create workspace asset `POST /tableau/workspaces/{workspaceIdOrApiName}/assets` Operation ID: `postWorkspaceAssetCollection`. Tags: Workspaces. Resource to access associated assets of a workspace. Add an asset to be associated with a workspace. #### Parameters * `workspaceIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.workspace.WorkspaceAssetInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "assetId": "example_assetId", "assetType": "AnalyticsDashboard", "assetUsageType": "Created" } ``` #### Responses * **200** Success. Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FK1mJdM7qpVPT9", "label": "Label", "name": "Example Name", "assetId": "example_assetId", "assetType": "AnalyticsDashboard", "assetUsageType": "Created", "createdBy": { "description": "This is an example description", "id": "0FKnlfGker0GzSu", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "url": "https://example.com" } ``` ### POST Batch create workspace assets `POST /tableau/workspaces/{workspaceIdOrApiName}/assets/batch` Operation ID: `batchCreateWorkspaceAsset`. Tags: Workspaces. Resource to create workspace assets in batch. Batch a batch of workspace assets. #### Parameters * `workspaceIdOrApiName` (path, string, required) * `isBulk` (query, boolean) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.workspace.WorkspaceAssetBatchInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "workspaceAssets": [ { "assetId": "example_assetId", "assetType": "AnalyticsDashboard", "assetUsageType": "Created" } ] } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `core.connect.api.output.common.BatchRepresentation`. ### GET Get workspace asset `GET /tableau/workspaces/{workspaceIdOrApiName}/assets/{assetId}` Operation ID: `getWorkspaceAsset`. Tags: Workspaces. Resource to delete associated assets of a workspace. Get all dependent assets of the given asset. #### Parameters * `assetId` (path, string, required) * `workspaceIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetCollectionRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "workspaceAssets": [ { "description": "This is an example description", "id": "0FKMKC1iHmfHVgh", "label": "Label", "name": "Example Name", "assetId": "example_assetId", "assetType": "AnalyticsDashboard", "assetUsageType": "Created", "createdBy": { "description": "This is an example description", "id": "0FKVTgAYIKRNIAd", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "url": "https://example.com" } ] } ``` ### POST Clone workspace asset `POST /tableau/workspaces/{workspaceIdOrApiName}/assets/{assetId}` Operation ID: `postWorkspaceAsset`. Tags: Workspaces. Resource to delete associated assets of a workspace. Clone an asset in the same workspace. #### Parameters * `assetId` (path, string, required) * `workspaceIdOrApiName` (path, string, required) #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FKyYlUK9E9wNLL", "label": "Label", "name": "Example Name", "assetId": "example_assetId", "assetType": "AnalyticsDashboard", "assetUsageType": "Created", "createdBy": { "description": "This is an example description", "id": "0FK5B9KLsh378uG", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "url": "https://example.com" } ``` ### DELETE Delete workspace asset `DELETE /tableau/workspaces/{workspaceIdOrApiName}/assets/{assetId}` Operation ID: `deleteWorkspaceAsset`. Tags: Workspaces. Resource to delete associated assets of a workspace. Delete an asset from a workspace. #### Parameters * `assetId` (path, string, required) * `workspaceIdOrApiName` (path, string, required) #### Responses * **200** Success. ### PATCH Update workspace asset `PATCH /tableau/workspaces/{workspaceIdOrApiName}/assets/{assetId}` Operation ID: `patchWorkspaceAsset`. Tags: Workspaces. Resource to delete associated assets of a workspace. Move workspace asset to another workspace. #### Parameters * `assetId` (path, string, required) * `workspaceIdOrApiName` (path, string, required) #### Request body Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.input.workspace.WorkspaceInputRepresentation`. _Example: fullExample_ Full operation example — complete request body ``` { "description": "This is an example description", "label": "Label", "name": "Example Name" } ``` #### Responses * **200** Success Media type: `application/json`. Schema: `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetRepresentation`. _Example: fullExample_ Full operation example — complete response body ``` { "description": "This is an example description", "id": "0FKQuhMnnE4svtK", "label": "Label", "name": "Example Name", "assetId": "example_assetId", "assetType": "AnalyticsDashboard", "assetUsageType": "Created", "createdBy": { "description": "This is an example description", "id": "0FKWirymQ1WTVyf", "label": "Label", "name": "Example Name", "alias": "example_alias", "isActive": true, "profilePhotoUrl": "https://example.com", "username": "Example user" }, "createdDate": "2026-02-16 10:00:00+00:00", "url": "https://example.com" } ``` ## Schemas ### sfdc.unified.analytics.clone.connect.api.input.AnalyticsAssetCloneInputRepresentation An input object specifying the asset to clone and clone options. * `includeDependencies` (_sfdc.unified.analytics.clone.connect.api.input.IncludeDependenciesRepresentation_) * `sourceAssetId` (_string_, required) Required. The ID of the asset to clone. * `sourceAssetType` (_string_, required) Required. The type of the asset to clone. * `targetWorkspaceId` (_string_) The ID of the workspace where the cloned asset will be created. ### sfdc.unified.analytics.clone.connect.api.output.AnalyticsAssetCloneResultRepresentation An output object containing the result of the clone operation. * `addedDependencies` (_array of sfdc.unified.analytics.clone.connect.api.output.DependencyResultRepresentation_) The list of dependent assets that were added as references (not cloned). * `clonedAssetDeveloperName` (_string_) The developer name of the cloned asset. * `clonedAssetId` (_string_) The ID of the newly cloned asset. * `clonedAssetLabel` (_string_) The label of the cloned asset. * `clonedAssetType` (_string_) The type of the cloned asset. * `clonedDependencies` (_array of sfdc.unified.analytics.clone.connect.api.output.DependencyResultRepresentation_) The list of dependent assets that were cloned. * `errors` (_array of sfdc.unified.analytics.clone.connect.api.output.CloneErrorRepresentation_) The any errors that occurred during the clone operation. * `status` (_string_) The status of the clone operation. * `targetWorkspaceDeveloperName` (_string_) The developer name of the target workspace, used for navigation. * `targetWorkspaceLabel` (_string_) The label of the target workspace. ### sfdc.unified.analytics.connect.api.input.assetsCompare.AnalyticsAssetsCompareInputRepresentation A comparison between two Tableau Next assets. * `assetType` (_sfdc.unified.analytics.connect.api.enums.assetsBrowse.AnalyticsAssetsBrowseAssetTypeEnum_) * `source` (_sfdc.unified.analytics.connect.api.input.assetsCompare.AssetCompareRefInputRepresentation_) * `target` (_sfdc.unified.analytics.connect.api.input.assetsCompare.AssetCompareRefInputRepresentation_) ### sfdc.unified.analytics.connect.api.output.assetsCompare.AnalyticsAssetsCompareOutputRepresentation An asset compare response payload. * `assetType` (_sfdc.unified.analytics.connect.api.enums.assetsBrowse.AnalyticsAssetsBrowseAssetTypeEnum_) * `source` (_sfdc.unified.analytics.connect.api.output.assetsCompare.AnalyticsAssetsCompareSideOutputRepresentation_) * `target` (_sfdc.unified.analytics.connect.api.output.assetsCompare.AnalyticsAssetsCompareSideOutputRepresentation_) ### sfdc.unified.analytics.dependents.connect.api.input.AssetDependentsQueryInputRepresentation An input object specifying the assets whose dependents should be listed. * `assets` (_array of sfdc.unified.analytics.dependents.connect.api.input.AssetReferenceInputRepresentation_, required) Required. The assets whose dependents should be listed. ### sfdc.unified.analytics.dependents.connect.api.output.AssetDependentCollectionRepresentation The collection of dependent-asset results, one per queried asset. * `results` (_array of sfdc.unified.analytics.dependents.connect.api.output.AssetDependentResultRepresentation_) The one result per queried asset that could be resolved. ### sfdc.unified.analytics.connect.api.output.workspace.TypedAssetReferenceCollectionRepresentation A collection of assets. * `assets` (_array of sfdc.unified.analytics.connect.api.output.workspace.TypedAssetReferenceRepresentation_) The list of assets being returned. ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardCollectionRepresentation A collection of Tableau Next dashboards. * `dashboards` (_array of sfdc.unified.analytics.connect.api.output.dashboard.DashboardRepresentation_) The list of dashboards being returned. ### sfdc.unified.analytics.connect.api.input.dashboard.DashboardInputRepresentation Dashboard A request to create or update a Tableau Next dashboard. * `backgroundSource` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `customConfig` (_sfdc.unified.analytics.connect.api.input.dashboard.DashboardCustomConfigInputRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date for the dashboard. * `layouts` (_array of sfdc.unified.analytics.connect.api.input.dashboard.DashboardLayoutInputRepresentation_) The list of layouts in the dashboard. * `style` (_sfdc.unified.analytics.connect.api.input.dashboard.DashboardStyleInputRepresentation_) * `templateSource` (_sfdc.unified.analytics.connect.api.input.AnalyticsTemplateSourceInputRepresentation_) * `widgets` (_object_) The map of widgets in the dashboard. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetInputRepresentation`. * `workspaceIdOrApiName` (_string_) The ID or API name of the workspace from which this dashboard originates. * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardRepresentation Dashboard A Tableau Next dashboard. * `backgroundSource` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `customConfig` (_sfdc.unified.analytics.connect.api.output.dashboard.DashboardCustomConfigRepresentation_) * `customViews` (_array of sfdc.unified.analytics.connect.api.output.DashboardCustomViewRepresentation_, nullable) The custom views for this dashboard. * `defaultView` (_sfdc.unified.analytics.connect.api.output.DashboardCustomViewRepresentation_) * `layouts` (_array of sfdc.unified.analytics.connect.api.output.dashboard.DashboardLayoutRepresentation_) The all grid layouts for this dashboard. * `permissions` (_sfdc.unified.analytics.connect.api.output.PermissionsRepresentation_) * `sourceVersion` (_sfdc.unified.analytics.connect.api.output.AnalyticsVersionRepresentation_) * `style` (_sfdc.unified.analytics.connect.api.output.dashboard.DashboardStyleRepresentation_) * `templateSource` (_sfdc.unified.analytics.connect.api.output.AnalyticsTemplateSourceRepresentation_) * `url` (_string (url)_) The URL to this dashboard. * `widgets` (_object_) The widgets in the dashboard. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetRepresentation`. * `workspaceIdOrApiName` (_string_) The ID of the workspace from which this dashboard originates. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. ### sfdc.unified.analytics.connect.api.output.DashboardBundleRepresentation A dashboard bundle response. * `bundledAssets` (_object_) The referenced assets as map object in bundle response. Additional properties: `sfdc.unified.analytics.connect.api.output.DashboardBundleAssetRepresentation`. * `cached` (_boolean_) Specifies whether the dashboard is loaded from cache (`true`) or not (`false`). * `dashboard` (_any_) The tODO-dashboard metadata as blob once we will migrate old APIs to IDL then we mark it as DashboardRepresentation. * `executionDelay` (_object_) The time taken to start the execution of asset retrieval thread. Additional properties: `number (int64)`. * `executionTime` (_object_) The time taken to finish the execution of each asset thread. Additional properties: `number (int64)`. ### sfdc.unified.analytics.connect.api.output.DashboardCustomViewCollectionRepresentation A dashboard saved views collection. * `customViews` (_array of sfdc.unified.analytics.connect.api.output.DashboardCustomViewRepresentation_) The list of saved views. ### sfdc.unified.analytics.connect.api.input.DashboardCustomViewInputRepresentation A dashboard saved view. * `defaultPage` (_string_) The dashboard page UUID which is default for the view. * `isDefault` (_boolean_) Specifies whether the view is the default view for the user (`true`) or not the default view (`false`). * `label` (_string_) The label of dashboard view. * `type` (_sfdc.unified.analytics.connect.api.enums.DashboardCustomViewType_) * `viewSpec` (_sfdc.unified.analytics.connect.api.input.DashboardCustomViewSpecInputRepresentation_) ### sfdc.unified.analytics.connect.api.output.DashboardCustomViewRepresentation A dashboard custom view. * `defaultPage` (_string_) The dashboard page UUID which is default for the view. * `id` (_string_) The custom view ID. * `isDefault` (_boolean_) Specifies whether this is the default view for the user (`true`) or not (`false`). * `label` (_string_) The label of dashboard view. * `owner` (_sfdc.unified.analytics.connect.api.output.AnalyticsAssetOwnerRepresentation_) * `type` (_sfdc.unified.analytics.connect.api.enums.DashboardCustomViewType_) * `viewSpec` (_sfdc.unified.analytics.connect.api.output.DashboardCustomViewSpecRepresentation_) ### sfdc.unified.analytics.connect.api.output.follow.UniqueFollowerCountRepresentation A unique count of followers. * `uniqueFollowerCount` (_integer_) The unique count of followers. ### sfdc.unified.analytics.connect.api.output.follow.FollowerCollectionRepresentation A collection of Followers. * `followers` (_array of sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) The list of followers being returned. ### sfdc.unified.analytics.connect.api.resource.follow.OrderBy Supported Order By Fields _Available April 2026 and later._ Type: `string`. Allowed values: `AssetLabel`, `CreatedDate`, `ShouldShowForecast`. ### sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowedAssetTypeEnum Followed asset type. Type: `string`. Allowed values: `SemanticMetricDefinition`, `SemanticSubMetric`. ### sfdc.unified.analytics.connect.api.resource.follow.SortOrder Supported sort _Available April 2026 and later._ Type: `string`. Allowed values: `Asc`, `Desc`. ### sfdc.unified.analytics.connect.api.output.follow.FollowedAssetRefCollectionRepresentation Collection of Followed Asset Refs _Available April 2026 and later._ * `followedAssetRefs` (_array of sfdc.unified.analytics.connect.api.output.follow.FollowedAssetRefRepresentation_) List of followed assets being returned ### sfdc.unified.analytics.connect.api.output.follow.FollowedAssetCollectionRepresentation A collection of Followed Assets. * `followedAssets` (_array of sfdc.unified.analytics.connect.api.output.follow.FollowedAssetRepresentation_) The list of followed assets being returned. ### sfdc.unified.analytics.connect.api.input.follow.FollowInputRepresentation A request to follow an analytics asset. * `assetId` (_string_) The asset ID. * `assetType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowedAssetTypeEnum_) * `followedTimeRange` (_sfdc.unified.analytics.connect.api.input.common.UnifiedFilterInputRepresentation_) * `followerType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowerTypeEnum_) * `shouldShowForecast` (_boolean_) Specifies whether to show a forecast for the followed asset (`true`) or not (`false`); a null value is treated as `false`. ### sfdc.unified.analytics.connect.api.output.follow.FollowerAssetRepresentation A represent follower and asset mapping. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date. * `followedAssetId` (_string_) The followed asset ID. * `followedAssetType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowedAssetTypeEnum_) * `followedTimeRange` (_sfdc.unified.analytics.connect.api.output.follow.UnifiedFilterRepresentation_) * `followerId` (_string_) The follower ID. * `followerType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowerTypeEnum_) ### sfdc.unified.analytics.connect.api.input.follow.UpdateFollowInputRepresentation A request to update the settings for a followed analytics asset. * `assetId` (_string_) The asset ID. * `followedTimeRange` (_sfdc.unified.analytics.connect.api.input.common.UnifiedFilterInputRepresentation_) * `shouldShowForecast` (_boolean_) Specifies whether to show a forecast for the followed asset (`true`) or not (`false`); a null value is treated as `false`. * `updateAllAssets` (_boolean_) Specifies whether to update all followed assets for the follower (`true`) or only the specified asset (`false`). ### sfdc.unified.analytics.connect.api.output.follow.FollowerAssetCollectionRepresentation A collection of Follower Assets. * `followerAssets` (_array of sfdc.unified.analytics.connect.api.output.follow.FollowerAssetRepresentation_) The list of follower assets being returned. * `followerId` (_string_) The follower ID. ### sfdc.unified.analytics.connect.api.input.follow.SubMetricInfoInputRepresentation A subMetric info representation in Tableau Next. * `filterLogic` (_string_) The filter Logic. * `filters` (_array of sfdc.semantic.authoring.connect.api.input.SemanticFilterInputRepresentation_) The filters. * `metricIdOrApiName` (_string_) The metric ID or Name. * `modelIdOrApiName` (_string_) The model ID or Name. * `subMetricId` (_string_) The subMetric ID. * `timeRange` (_sfdc.semantic.authoring.connect.api.input.SemanticGoalDateRangeInputRepresentation_) * `unifiedFilter` (_sfdc.semantic.authoring.connect.api.input.UnifiedFilterInputRepresentation_) ### sfdc.unified.analytics.connect.api.output.follow.SubMetricInfoOutputRepresentation A subMetric Info Representation. * `goal` (_sfdc.semantic.authoring.connect.api.output.SemanticGoalOutputRepresentation_) * `isFollowed` (_boolean_) Specifies whether the sub-metric is followed (`true`) or not (`false`). * `metric` (_sfdc.semantic.authoring.connect.api.output.metrics.SemanticMetricOutputRepresentation_) * `subMetric` (_sfdc.semantic.authoring.connect.api.output.SemanticSubMetricOutputRepresentation_) ### sfdc.unified.analytics.connect.api.output.marketplace.TableauMarketplaceListingInstallationProgressResponse A representation of Tableau marketplace's listing installation progress. * `errors` (_array of string_) The errors while installing the package. * `id` (_string_) The ID of the package installation request. * `status` (_string_) The latest Status of Package installation request. ### sfdc.analyticsdashboard.connect.api.enums.MarketplaceAssetTypeEnum The type of asset _Available April 2026 and later._ Type: `string`. Allowed values: `DominoTemplate`. ### sfdc.analyticsdashboard.connect.api.output.MarketplaceListingCollectionRepresentation List of assets in Marketplace listings _Available April 2026 and later._ * `marketplaceListings` (_array of sfdc.analyticsdashboard.connect.api.output.MarketplaceListingDetailRepresentation_) List of marketplace listings * `totalCount` (_integer_) The total amount of results ### sfdc.analyticsdashboard.connect.api.input.MarketplaceListingInputRepresentation Input representation to publish asset to Marketplace _Available April 2026 and later._ * `assetId` (_string_) The ID of asset * `assetType` (_sfdc.analyticsdashboard.connect.api.enums.MarketplaceAssetTypeEnum_) * `assetVersion` (_string_) The version of the asset ### sfdc.analyticsdashboard.connect.api.output.MarketplaceListingRepresentation The ID of marketplace listings _Available April 2026 and later._ * `id` (_string_) The ID of marketplace listings ### sfdc.unified.analytics.connect.api.output.marketplace.TableauMarketplaceListingInstallationResponse A representation of Tableau marketplace's listing installation response. * `packageInstallRequestID` (_string_) The ID of the package installation request. * `success` (_boolean_) Specifies whether the package installation request succeeded (`true`) or not (`false`). ### sfdc.analyticsdashboard.connect.api.output.PackageComponentCollectionRepresentation A collection of components installed as part of a package version. * `components` (_array of sfdc.analyticsdashboard.connect.api.output.PackageComponentRepresentation_) The list of components installed as part of the package version. * `packageGeneration` (_sfdc.analyticsdashboard.connect.api.enums.PackageGenerationEnum_) * `packageVersionId` (_string_) The ID of the package version. * `totalCount` (_integer_) The total number of components inside the package. ### sfdc.unified.analytics.connect.api.input.marketplaceTemplateBuilder.MarketplaceTemplateInputRepresentation A Marketplace template. * `assetIdOrApiName` (_string_) The source asset ID. * `assetType` (_sfdc.app.framework.connect.api.enums.TemplateSubtypeEnum_) * `description` (_string_) The template description. * `label` (_string_) The label of the template. * `name` (_string_) The template name. * `tags` (_object_) The tags associated with the template. Additional properties: `array of string`. ### sfdc.unified.analytics.connect.api.output.marketplaceTemplateBuilder.MarketplaceTemplateOutputRepresentation An ID of template created. * `id` (_string_) The ID of template. ### sfdc.unified.analytics.connect.api.input.personalOrg.AnalyticsPersonalOrgInfoSyncInputRepresentation A payload to create or update the mirrored AnalyticsPersonalOrgInfo record in a Personal Org. * `details` (_string_) The free-form description of the Personal Org (copied verbatim from the Prod record). * `developerName` (_string_) The developerName of the APOI record (copied verbatim from the Prod record). * `isAnalyticsReuseEditable` (_boolean_) Specifies whether Tableau Next Analytics Reuse is editable within this Personal Org (`true`) or not editable (`false`). * `isPersonalOrgDeleted` (_boolean_) Specifies whether the Personal Org is marked as deleted, copied from the production record so the Personal Org copy stays in sync (`true`) or not marked as deleted (`false`). * `masterLabel` (_string_) The masterLabel of the APOI record (copied verbatim from the Prod record). * `owners` (_string_) The comma-separated list of 18-char production-org owner user IDs. * `personalOrgCreatedBy` (_string_) 18-char production-org user ID of the Personal Org creator (copied verbatim from the Prod record). * `personalOrgCreatedDate` (_string (date-time)_) The creation timestamp of the Personal Org (copied verbatim from the Prod record). * `personalOrgIdentifier` (_string_) The org ID (00D) of the Personal Org this record belongs to; used as the idempotency key. * `personalOrgName` (_string_) The display name of the Personal Org. * `personalOrgOwnerUserName` (_string_) The production-org user name of the Personal Org owner. * `personalOrgStatus` (_string_) The provisioning status of the Personal Org (copied verbatim from the Prod record). * `systemAddedOwners` (_string_) The comma-separated list of 18-char production-org user IDs added as owners by an automated process. ### sfdc.unified.analytics.connect.api.output.personalOrg.AnalyticsPersonalOrgInfoSyncResultRepresentation A result of creating or updating the mirrored AnalyticsPersonalOrgInfo record in a Personal Org. * `id` (_string_) The PO-side AnalyticsPersonalOrgInfo record ID that was created or updated. * `success` (_boolean_) Specifies whether the record was successfully created or updated in the personal org (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.personalOrg.AnalyticsPersonalOrgInfoCollectionRepresentation A collection of Personal Orgs with their owners and system-added owners. * `personalOrgs` (_array of sfdc.unified.analytics.connect.api.output.personalOrg.AnalyticsPersonalOrgInfoRepresentation_) The list of Personal Orgs. ### sfdc.unified.analytics.connect.api.output.personalOrg.AnalyticsPersonalOrgInfoRepresentation Represents a Personal Org with its owners and system-added owners. * `createdBy` (_string_) The username of the user who created the Personal Org. * `createdDate` (_string (date-time)_) The timestamp the Personal Org was created. * `details` (_string_) The free-form description of the Personal Org. * `errorCode` (_string_) The provisioning error code stamped on the Personal Org by the provisioning pipeline; null when there is no error. * `id` (_string_) The AnalyticsPersonalOrgInfo record ID of the Personal Org; null while the org is still being provisioned (no AnalyticsPersonalOrgInfo record exists yet) -- address it by signupRecordId until then. * `isAnalyticsReuseEditable` (_boolean_) Specifies whether Tableau Next reuse is editable for the personal org (`true`) or not (`false`). * `name` (_string_) The display name of the Personal Org. * `owners` (_array of string_) The usernames of the explicit owners of the Personal Org. * `personalOrgIdentifier` (_string_) The org ID (00D) of the Personal Org; null until the org has been provisioned. * `signupRecordId` (_string_) The PersonalOrgInfo (signup) record ID of the Personal Org; always present. Accepted alongside ID on GET/PATCH. Retained during migration and to be retired once all consumers move to ID. * `status` (_string_) The provisioning status of the Personal Org. * `systemAddedOwners` (_array of string_) The usernames of the TabAdmin owners of the Personal Org (added by an automated process). ### sfdc.unified.analytics.connect.api.input.personalOrg.AnalyticsPersonalOrgInfoUpdateInputRepresentation An update to apply to a Personal Org. * `details` (_string_) The new free-form details for the Personal Org (not yet applied). * `name` (_string_) The new display name for the Personal Org (not yet applied). * `ownersToAdd` (_array of string_) The explicit owner usernames to add. * `ownersToRemove` (_array of string_) The explicit owner usernames to remove. * `systemAddedOwners` (_array of string_) The full desired list of TabAdmin owner usernames; automated-process (cron) context only. ### sfdc.unified.analytics.connect.api.enums.share.SetupObjectAccessTypeEnum Share access types for a record Type: `string`. Allowed values: `Commenter`, `Editor`, `Manager`, `Owner`, `Viewer`. ### sfdc.unified.analytics.connect.api.enums.share.SetupObjectRecipientTypeEnum The type of recipient for a record share. Type: `string`. Allowed values: `Group`, `User`. ### sfdc.unified.analytics.connect.api.output.share.SetupRecordAccessCollectionRepresentation A collection of record access mapping. * `filterByAccessType` (_array of sfdc.unified.analytics.connect.api.enums.share.SetupObjectAccessTypeEnum_) The access Type filter. * `filterByRecipientType` (_array of sfdc.unified.analytics.connect.api.enums.share.SetupObjectRecipientTypeEnum_) The recipient type filters applied. * `filterByUserOrGroupId` (_string_) The user or group ID filter. * `limit` (_integer_) The result limit. * `offset` (_integer_) The result offset. * `orderBy` (_sfdc.unified.analytics.connect.api.enums.share.SetupRecordShareOrderByEnum_) * `ownerCount` (_integer_) The total count of owners for the record. * `recordAccessMappings` (_array of sfdc.unified.analytics.connect.api.output.share.SetupRecordAccessRepresentation_) The list of shares being returned for a record. * `recordId` (_string_) The ID for record. * `sortOrder` (_string_) The sort order (ASC/DESC). ### sfdc.unified.analytics.connect.api.input.share.SetupRecordAccessInputRepresentation A request to grant record access to users or roles. * `accessRequestItems` (_array of sfdc.unified.analytics.connect.api.input.share.SetupRecordAccessItemInputRepresentation_) The list of records shares. * `sendNotificationToRecipients` (_boolean_) Specifies whether to send a notification to the recipients of the shared access (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.share.SetupRecordShareCollectionRepresentation A collection of shares for a record. * `failedRecordShares` (_array of sfdc.unified.analytics.connect.api.output.share.SetupRecordShareErrorRepresentation_) The list of Failed record shares. * `recordId` (_string_) The ID for record. * `setupObjectType` (_sfdc.unified.analytics.connect.api.enums.share.SetupObjectTypeEnum_) * `successfulRecordShares` (_array of sfdc.unified.analytics.connect.api.output.share.SetupRecordShareRepresentation_) The list of shares being returned for a record. ### sfdc.unified.analytics.connect.api.input.share.UpdateSetupRecordAccessInputRepresentation Update record share input representation * `updateSetupRecordAccessItems` (_array of sfdc.unified.analytics.connect.api.input.share.UpdateSetupRecordAccessItemInputRepresentation_) List of records shares ### sfdc.unified.analytics.connect.api.output.subscription.SubscriptionDigestConfigOutputRepresentation A digest configuration for a user's subscription. * `isEnabled` (_boolean_) Specifies whether the subscription digest is enabled (`true`) or not (`false`). * `scheduleType` (_sfdc.unified.analytics.connect.api.enums.ConnectSubscriptionScheduleTypeEnum_) * `userId` (_string_) The user ID. ### sfdc.unified.analytics.connect.api.input.subscription.SubscriptionDigestConfigInputRepresentation A digest configuration for a subscription. * `isEnabled` (_boolean_) Specifies whether the subscription digest is enabled (`true`) or not (`false`). * `scheduleType` (_sfdc.unified.analytics.connect.api.enums.ConnectSubscriptionScheduleTypeEnum_) ### sfdc.unified.analytics.connect.api.output.VisualizationCollectionRepresentation A collection of Tableau Next visualizations. * `visualizations` (_array of sfdc.unified.analytics.connect.api.output.VisualizationShallowRepresentation_) The list of shallow representation of returned visualizations. ### sfdc.unified.analytics.connect.api.input.VisualizationInputRepresentation Visualization A Tableau Next visualization. * `dataSource` (_sfdc.unified.analytics.connect.api.input.VisualizationDataSourceInputRepresentation_) * `fields` (_object_) The visualization fields. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationFieldInputRepresentation`. * `interactions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The interactions of the visualization. * `label` (_string_) The master label. * `templateSource` (_sfdc.unified.analytics.connect.api.input.AnalyticsTemplateSourceInputRepresentation_) * `view` (_sfdc.unified.analytics.connect.api.input.VisualizationViewInputRepresentation_) * `visualSpecification` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationVisualSpecInputRepresentation_) * `workspace` (_sfdc.unified.analytics.connect.api.input.AssetReferenceInputRepresentation_) * `description` (_string_) The description. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.output.VisualizationRepresentation VisualizationRepresentation A Tableau Next visualization. * `fields` (_object_) The fields for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationFieldRepresentation`. * `interactions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The visualization interactions. * `view` (_sfdc.unified.analytics.connect.api.output.VisualizationViewRepresentation_) * `visualSpecification` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationVisualSpecRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. * `dataSource` (_sfdc.unified.analytics.connect.api.output.VisualizationDataSourceRepresentation_) * `permissions` (_sfdc.unified.analytics.connect.api.output.PermissionsRepresentation_) * `sourceVersion` (_sfdc.unified.analytics.connect.api.output.AnalyticsVersionRepresentation_) * `targetVersion` (_sfdc.unified.analytics.connect.api.output.AnalyticsVersionRepresentation_) * `creationSource` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationCreationSource_) * `templateSource` (_sfdc.unified.analytics.connect.api.output.AnalyticsTemplateSourceRepresentation_) * `workspace` (_sfdc.unified.analytics.connect.api.output.AssetReferenceRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationBundleRepresentation A visualization bundle. * `dataSource` (_sfdc.unified.analytics.connect.api.output.VisualizationReferencedDataSourceRepresentation_) * `visualization` (_sfdc.unified.analytics.connect.api.output.VisualizationRepresentation_) ### sfdc.unified.analytics.connect.api.enums.AnalyticsAssetsQueryOrderByEnum The field to order results by in an assets query. Type: `string`. Allowed values: `AssetType`, `CreatedBy`, `CreatedDate`, `LastModifiedBy`, `LastModifiedDate`, `Name`. ### sfdc.unified.analytics.connect.api.enums.AnalyticsAssetsQuerySortDirectionEnum The sort direction for the results of an assets query. Type: `string`. Allowed values: `Ascending`, `Descending`. ### sfdc.unified.analytics.connect.api.output.workspace.WorkspaceCollectionRepresentation A collection of Tableau Next workspaces. * `workspaces` (_array of sfdc.unified.analytics.connect.api.output.workspace.WorkspaceRepresentation_) The list of workspaces being returned. ### sfdc.unified.analytics.connect.api.input.workspace.WorkspaceInputRepresentation Workspace A Tableau Next workspace. * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.output.workspace.WorkspaceRepresentation Workspace A Tableau Next workspace. * `assetsCount` (_integer_, nullable) The number of assets in this workspace. * `cacheableKey` (_string_) The key to use for caching the workspace output. * `permissions` (_sfdc.unified.analytics.connect.api.output.PermissionsRepresentation_) * `url` (_string (url)_) The URL to this workspace. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. ### sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetCollectionRepresentation A collection of assets in a workspace in Tableau Next. * `workspaceAssets` (_array of sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetRepresentation_) The list of workspace assets being returned. ### sfdc.unified.analytics.connect.api.input.workspace.WorkspaceAssetInputRepresentation An asset associated with a workspace. * `assetId` (_string_) The ID of the asset. * `assetType` (_sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetTypeEnum_) * `assetUsageType` (_sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetUsageTypeEnum_) ### sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetRepresentation WorkspaceAsset A Tableau Next workspace asset. * `assetId` (_string_) The asset in the workspace. * `assetType` (_sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetTypeEnum_) * `assetUsageType` (_sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetUsageTypeEnum_) * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the workspace association. * `url` (_string (url)_) The URL to this workspace asset. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.input.workspace.WorkspaceAssetBatchInputRepresentation A batch of assets for a workspace. * `workspaceAssets` (_array of sfdc.unified.analytics.connect.api.input.workspace.WorkspaceAssetInputRepresentation_) A list of workspace assets. ### core.connect.api.output.common.BatchRepresentation ### sfdc.unified.analytics.clone.connect.api.input.IncludeDependenciesRepresentation A specifies which types of dependent assets to clone. * `semanticModel` (_boolean_) Specifies whether to clone dependent semantic models (`true`) or not (`false`). * `visualization` (_boolean_) Specifies whether to clone dependent visualizations (`true`) or not (`false`). ### sfdc.unified.analytics.clone.connect.api.output.DependencyResultRepresentation Represents a dependent asset that was cloned or added as a reference. * `assetId` (_string_) The ID of the dependent asset. * `assetType` (_string_) The type of the dependent asset. * `developerName` (_string_) The developer name of the dependent asset. * `label` (_string_) The label of the dependent asset. ### sfdc.unified.analytics.clone.connect.api.output.CloneErrorRepresentation Represents an error that occurred during the clone operation. * `assetId` (_string_) The ID of the asset that caused the error, if applicable. * `errorCode` (_string_) The error code. * `errorMessage` (_string_) The error message. ### sfdc.unified.analytics.connect.api.enums.assetsBrowse.AnalyticsAssetsBrowseAssetTypeEnum The type of asset returned by an assets browse request. Type: `string`. Allowed values: `AnalyticsDashboard`, `AnalyticsVisualization`, `AnalyticsWorkspace`, `InternalDataConnector`, `MktCalculatedInsightObject`, `MktDataConnection`, `MktDataLakeObject`, `MktDataModelObject`, `MktDataTransformSetup`, `SemanticDefinition`, `SemanticModel`. ### sfdc.unified.analytics.connect.api.input.assetsCompare.AssetCompareRefInputRepresentation An asset compare endpoint source/target reference. * `assetIdOrApiName` (_string_) The asset ID or API name. ### sfdc.unified.analytics.connect.api.output.assetsCompare.AnalyticsAssetsCompareSideOutputRepresentation A per-side diff output for asset compare. * `assetApiName` (_string_) The asset api name for this side. * `diff` (_array of sfdc.unified.analytics.connect.api.output.assetsCompare.AnalyticsAssetsCompareChangeOutputRepresentation_) The structured list of block diffs. ### sfdc.unified.analytics.dependents.connect.api.input.AssetReferenceInputRepresentation A reference to an asset by its API name and type. * `assetApiName` (_string_, required) Required. The API (developer) name of the asset. * `assetType` (_string_, required) Required. The type of the queried asset. ### sfdc.unified.analytics.dependents.connect.api.output.AssetDependentResultRepresentation The dependents of a single queried asset, grouped by dependent type. * `asset` (_sfdc.unified.analytics.dependents.connect.api.output.AssetReferenceRepresentation_) * `dependentsByType` (_array of sfdc.unified.analytics.dependents.connect.api.output.AssetDependentGroupRepresentation_) The dependent assets grouped by their asset type. * `totalCount` (_integer_) The total number of dependent assets across all groups. ### sfdc.unified.analytics.connect.api.output.workspace.TypedAssetReferenceRepresentation TypedAssetReference A typed reference to an asset in a Tableau Next workspace. * `assetDevName` (_string_) The asset API developer name. * `assetId` (_string_) The asset in the workspace. * `assetLabel` (_string_) The asset label name. * `assetType` (_sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetTypeEnum_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. ### sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation A data source for a dashboard widget. * `id` (_string_) The database record ID of the asset. * `name` (_string_) The name of the data source that this filter widget is associated with. ### sfdc.unified.analytics.connect.api.input.dashboard.DashboardCustomConfigInputRepresentation A dashboard custom config (e.g. query cache enabled and staleness). * `queryCacheEnabled` (_boolean_) Specifies whether the dashboard uses Hyper query caching (`true`) or not (`false`). * `queryCacheStaleness` (_string_) The how much staleness allowed for query cache (e.g. 5min, 10min, 20min). ### sfdc.unified.analytics.connect.api.input.dashboard.DashboardLayoutInputRepresentation DashboardLayout A layout for a Tableau Next dashboard. * `columnCount` (_integer_) The number of Columns in the layout. * `maxWidth` (_integer_) The maximum width of the layout in pixels. * `pages` (_array of sfdc.unified.analytics.connect.api.input.dashboard.DashboardLayoutPageInputRepresentation_) The pages in the layout. * `rowHeight` (_integer_) The grid row height of the layout in pixels. * `style` (_sfdc.unified.analytics.connect.api.input.dashboard.DashboardLayoutStyleInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.input.dashboard.DashboardStyleInputRepresentation A visual style for a dashboard in Tableau Next. * `background` (_sfdc.unified.analytics.connect.api.input.common.BackgroundParametersInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.dashboard.DashboardStyleWidgetStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.AnalyticsTemplateSourceInputRepresentation The source asset for an analytics template. * `assetName` (_string_) The template source asset name. * `name` (_string_) The template source name. ### sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetInputRepresentation AnalyticsWidget A widget for a Tableau Next dashboard, including its actions and dynamic tokens. One of: `sfdc.unified.analytics.connect.api.input.widgets.button.AnalyticsButtonWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.container.AnalyticsContainerWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.filter.AnalyticsFilterWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.image.AnalyticsImageWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.lightning.AnlytLightningCompWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.metric.AnalyticsMetricWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.navigation.AnalyticsNavigationWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.AnalyticsParameterWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.summary.AnalyticsSummaryWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.text.AnalyticsTextWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.visualization.AnalyticsVisualizationWidgetInputRepresentation`. ### sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation WidgetDataSource A data source for a Tableau Next dashboard widget, including its type and URL. * `type` (_sfdc.unified.analytics.connect.api.enums.DashboardDataSourceTypeEnum_) * `url` (_string_) The URL of the widget data source. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardCustomConfigRepresentation A dashboard custom config (e.g. query cache enabled and staleness). * `queryCacheEnabled` (_boolean_, nullable) Specifies whether the dashboard uses Hyper query caching (`true`) or not (`false`). * `queryCacheStaleness` (_string_, nullable) The how much staleness allowed for query cache (e.g. 5min, 10min, 20min). ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardLayoutRepresentation DashboardLayout A layout for a Tableau Next dashboard. * `columnCount` (_integer_) The number of Columns in the layout. * `maxWidth` (_integer_) The maximum width of the layout in pixels. * `pages` (_array of sfdc.unified.analytics.connect.api.output.dashboard.DashboardLayoutPageRepresentation_) The list of pages in the layout. * `rowHeight` (_integer_) The grid row height of the layout in pixels. * `style` (_sfdc.unified.analytics.connect.api.output.dashboard.DashboardLayoutStyleRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.PermissionsRepresentation A permissions of the user on an asset. * `delete` (_boolean_) Specifies whether the user can delete the asset (`true`) or not (`false`). * `edit` (_boolean_) Specifies whether the user can edit the asset (`true`) or not (`false`). * `share` (_boolean_) Specifies whether the user can share the asset (`true`) or not (`false`). * `view` (_boolean_) Specifies whether the user can view the asset (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.AnalyticsVersionRepresentation A version number, expressed as major and minor components, for a Tableau Next asset. * `major` (_integer_) The major version of the asset. * `minor` (_integer_) The minor version of the asset. ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardStyleRepresentation Represents dashboard style representation in Tableau Next. * `background` (_sfdc.unified.analytics.connect.api.output.common.BackgroundParametersRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.dashboard.DashboardStyleWidgetStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.AnalyticsTemplateSourceRepresentation A template source. * `assetName` (_string_) The template source asset name. * `name` (_string_, nullable) The template source name. ### sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetRepresentation AnalyticsWidget A widget for a Tableau Next dashboard, including its actions, dynamic tokens, type, and response status. One of: `sfdc.unified.analytics.connect.api.output.widgets.button.AnalyticsButtonWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.container.AnalyticsContainerWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.filter.AnalyticsFilterWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.image.AnalyticsImageWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.lightning.AnlytLightningCompWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.metric.AnalyticsMetricWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.navigation.AnalyticsNavigationWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.AnalyticsParameterWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.summary.AnalyticsSummaryWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.text.AnalyticsTextWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.visualization.AnalyticsVisualizationWidgetRepresentation`. ### sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation AnalyticsUser A Tableau Next user. * `alias` (_string_, nullable) The user's alias. * `isActive` (_boolean_, nullable) Specifies whether the user is active (`true`) or not (`false`). * `profilePhotoUrl` (_string (url)_, nullable) The Chatter profile photo of the user. * `username` (_string_, nullable) The username of the user. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.DashboardBundleAssetRepresentation A dashboard bundle asset. * `asset` (_any_) The tODO-asset metadata as blob once we will migrate old APIs to IDL then we mark it as ConnectRepresentation. * `assetAppTemplate` (_string_) The asset created from template. * `status` (_string_) The bundle asset status. * `type` (_sfdc.unified.analytics.connect.api.enums.DashboardBundleAssetTypeEnum_) ### sfdc.unified.analytics.connect.api.enums.DashboardCustomViewType The type of the dashboard saved view. Type: `string`. Allowed values: `Private`, `Public`. ### sfdc.unified.analytics.connect.api.input.DashboardCustomViewSpecInputRepresentation A dashboard custom view specification. * `filters` (_array of sfdc.unified.analytics.connect.api.input.CustomViewFilterInputRepresentation_) The value is required. * `parameters` (_array of sfdc.unified.analytics.connect.api.input.CustomViewParameterInputRepresentation_) The value is required. * `selections` (_array of sfdc.unified.analytics.connect.api.input.CustomViewSelectionInputRepresentation_) The value is required. ### sfdc.unified.analytics.connect.api.output.AnalyticsAssetOwnerRepresentation A user. * `id` (_string_) The user ID. * `name` (_string_) The user's name. ### sfdc.unified.analytics.connect.api.output.DashboardCustomViewSpecRepresentation A specification for a dashboard custom view, including its filters, parameters, and selections. * `filters` (_array of sfdc.unified.analytics.connect.api.output.CustomViewFilterRepresentation_) The value is required. * `parameters` (_array of sfdc.unified.analytics.connect.api.output.CustomViewParameterRepresentation_) The value is required. * `selections` (_array of sfdc.unified.analytics.connect.api.output.CustomViewSelectionRepresentation_) The value is required. ### sfdc.unified.analytics.connect.api.output.follow.FollowedAssetRefRepresentation Followed Asset _Available April 2026 and later._ One of: `sfdc.unified.analytics.connect.api.output.follow.SemanticSubMetricAssetRefRepresentation`. ### sfdc.unified.analytics.connect.api.output.follow.FollowedAssetRepresentation FollowedAsset An asset that a user or group follows, including its type and the time range of interest. One of: `sfdc.unified.analytics.connect.api.output.follow.SemanticSubMetricAssetRepresentation`. ### sfdc.unified.analytics.connect.api.input.common.UnifiedFilterInputRepresentation A unified filter. * `fieldName` (_string_) The field name parameter value. * `operator` (_sfdc.semantic.authoring.connect.api.enums.SemanticFilterOperatorTypeEnum_) * `values` (_array of any_) The values parameter value. ### sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowerTypeEnum Follower type. Type: `string`. Allowed values: `Group`, `User`. ### sfdc.unified.analytics.connect.api.output.follow.UnifiedFilterRepresentation A filter defined by a field, an operator, and one or more values. * `fieldName` (_string_) The fieldName. * `operator` (_sfdc.semantic.authoring.connect.api.enums.SemanticFilterOperatorTypeEnum_) * `values` (_array of any_) The values. ### sfdc.semantic.authoring.connect.api.input.SemanticFilterInputRepresentation ### sfdc.semantic.authoring.connect.api.input.SemanticGoalDateRangeInputRepresentation ### sfdc.semantic.authoring.connect.api.input.UnifiedFilterInputRepresentation ### sfdc.semantic.authoring.connect.api.output.SemanticGoalOutputRepresentation ### sfdc.semantic.authoring.connect.api.output.metrics.SemanticMetricOutputRepresentation ### sfdc.semantic.authoring.connect.api.output.SemanticSubMetricOutputRepresentation ### sfdc.analyticsdashboard.connect.api.output.MarketplaceListingDetailRepresentation Details of a marketplace listing _Available April 2026 and later._ * `assetId` (_string_) The ID of asset * `assetType` (_sfdc.analyticsdashboard.connect.api.enums.MarketplaceAssetTypeEnum_) * `assetVersion` (_string_) The version of the asset * `id` (_string_) The ID of marketplace listings ### sfdc.analyticsdashboard.connect.api.output.PackageComponentRepresentation A single component installed as part of a package version. * `componentId` (_string_) The ID of the component. * `componentType` (_string_) The type of the component (e.g. DominoTemplate, DataKit). ### sfdc.analyticsdashboard.connect.api.enums.PackageGenerationEnum The generation of the package. Type: `string`. Allowed values: `FirstGeneration`, `SecondGeneration`. ### sfdc.app.framework.connect.api.enums.TemplateSubtypeEnum Type: `string`. ### sfdc.unified.analytics.connect.api.enums.share.SetupRecordShareOrderByEnum Order by enum for Setup Record Share APIs Type: `string`. Allowed values: `CreatedDate`, `UserDisplayName`. ### sfdc.unified.analytics.connect.api.output.share.SetupRecordAccessRepresentation A record Access mapping for specific UserOrGroup. * `accessType` (_sfdc.unified.analytics.connect.api.enums.share.SetupObjectAccessTypeEnum_) * `applicationDomain` (_sfdc.unified.analytics.connect.api.enums.share.ApplicationDomainEnum_) * `createdDate` (_string (date-time)_) The date share was created. * `targetRecord` (_sfdc.unified.analytics.connect.api.output.share.SetupRecordShareTargetRecordRepresentation_) * `userOrGroup` (_sfdc.unified.analytics.connect.api.output.share.SetupRecordShareUserOrGroupRepresentation_) * `userOrGroupId` (_string_) The user/Group ID. ### sfdc.unified.analytics.connect.api.input.share.SetupRecordAccessItemInputRepresentation An access grant for a record, specifying the user or group and access type. * `accessType` (_sfdc.unified.analytics.connect.api.enums.share.SetupObjectAccessTypeEnum_) * `applicationDomain` (_sfdc.unified.analytics.connect.api.enums.share.ApplicationDomainEnum_) * `setupObjectType` (_sfdc.unified.analytics.connect.api.enums.share.SetupObjectTypeEnum_) * `userOrGroupId` (_string_) The ID of the User/Group. ### sfdc.unified.analytics.connect.api.output.share.SetupRecordShareErrorRepresentation A setup Record Share Error. * `errorCode` (_string_) The setup record share error code. * `errorMessage` (_string_) The setup record share error message. * `userOrGroupId` (_string_) The setup record share userOrGroup ID. ### sfdc.unified.analytics.connect.api.enums.share.SetupObjectTypeEnum The type of asset being shared. Type: `string`. Allowed values: `AnalyticsDashboard`, `AnalyticsVisualization`, `AnalyticsWorkspace`, `SemanticModel`. ### sfdc.unified.analytics.connect.api.output.share.SetupRecordShareRepresentation A share of setup object access granted to a user or group, including who created and last modified it. * `accessType` (_sfdc.unified.analytics.connect.api.enums.share.SetupObjectAccessTypeEnum_) * `applicationDomain` (_sfdc.unified.analytics.connect.api.enums.share.ApplicationDomainEnum_) * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the share access for a record. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last Modified date of the share access for a record. * `userOrGroupId` (_string_) The user/Group ID. ### sfdc.unified.analytics.connect.api.input.share.UpdateSetupRecordAccessItemInputRepresentation Update record share input item representation * `accessType` (_sfdc.unified.analytics.connect.api.enums.share.SetupObjectAccessTypeEnum_) * `userOrGroupId` (_string_) Id of the User/Group ### sfdc.unified.analytics.connect.api.enums.ConnectSubscriptionScheduleTypeEnum Different subscription schedule types. Type: `string`. Allowed values: `Daily`, `Weekly`. ### sfdc.unified.analytics.connect.api.output.VisualizationShallowRepresentation Shallow A condensed visualization, used in collection responses. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. * `dataSource` (_sfdc.unified.analytics.connect.api.output.VisualizationDataSourceRepresentation_) * `permissions` (_sfdc.unified.analytics.connect.api.output.PermissionsRepresentation_) * `sourceVersion` (_sfdc.unified.analytics.connect.api.output.AnalyticsVersionRepresentation_) * `targetVersion` (_sfdc.unified.analytics.connect.api.output.AnalyticsVersionRepresentation_) * `creationSource` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationCreationSource_) * `templateSource` (_sfdc.unified.analytics.connect.api.output.AnalyticsTemplateSourceRepresentation_) * `workspace` (_sfdc.unified.analytics.connect.api.output.AssetReferenceRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationDataSourceInputRepresentation VisualizationDataSource A data source for a visualization. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationDataSourceType_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldInputRepresentation A field in a visualization. * `adHocCalc` (_sfdc.unified.analytics.connect.api.input.AdHocCalculationInputRepresentation_) * `computeUsing` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationFieldComputeUsingInputRepresentation_) * `displayCategory` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldDisplayCategoryType_) * `fieldName` (_string_) The name of the field. * `function` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldFunctionType_) * `hierarchyLevel` (_integer_) The hierarchy level of the field. * `hierarchyName` (_string_) The hierarchy name of the field. * `label` (_string_) The label of the field. * `latitudeOrY` (_string_) The fieldKey of the visualization field used as the latitude or Y coordinate. * `longitudeOrX` (_string_) The fieldKey of the visualization field used as the longitude or X coordinate. * `objectName` (_string_) The name of the object. * `positionName` (_string_) The position name of the field. * `positional` (_sfdc.unified.analytics.connect.api.input.BaseMapPositionalInputRepresentation_) * `quickTableCalc` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationFieldQuickTableCalcInputRepresentation_) * `role` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldRoleType_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldType_) ### sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation Interaction An interaction that triggers an action, such as a navigation or filter, in response to an event on a Tableau Next widget. * `actionType` (_sfdc.unified.analytics.connect.api.enums.ConnectInteractionTypeEnum_) * `eventType` (_sfdc.unified.analytics.connect.api.enums.ConnectInteractionEventTypeEnum_) * `parameters` (_sfdc.unified.analytics.connect.api.input.actions.BaseInteractionParametersInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.input.VisualizationViewInputRepresentation VisualizationView A view of a visualization. * `label` (_string_) The master label. * `viewSpecification` (_sfdc.unified.analytics.connect.api.input.VisualizationViewSpecInputRepresentation_) * `description` (_string_) The description. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationVisualSpecInputRepresentation A visual specification for a visualization. One of: `sfdc.unified.analytics.connect.api.input.VisualizationFlowLayoutVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationMapLayoutVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationRadialLayoutVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationTableLayoutVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationVizqlLayoutVisualSpecInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.AssetReferenceInputRepresentation AssetReference A reference to an asset. * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldRepresentation A visualization field. * `adHocCalc` (_sfdc.unified.analytics.connect.api.output.AdHocCalculationRepresentation_) * `computeUsing` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationFieldComputeUsingRepresentation_) * `displayCategory` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldDisplayCategoryType_) * `fieldName` (_string_) The semantic name of the field. * `function` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldFunctionType_) * `hierarchyLevel` (_integer_) The hierarchy level of the field. * `hierarchyName` (_string_) The hierarchy name of the field. * `id` (_string (Id)_) The ID of the visualization field. * `label` (_string_) The label of the field. * `latitudeOrY` (_string_) The fieldKey of the visualization field used as the latitude or Y coordinate. * `longitudeOrX` (_string_) The fieldKey of the visualization field used as the longitude or X coordinate. * `objectName` (_string_) The semantic name of the object. * `positionName` (_string_) The position name of the map position field. * `positional` (_sfdc.unified.analytics.connect.api.output.BaseMapPositionalRepresentation_) * `quickTableCalc` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationFieldQuickTableCalcRepresentation_) * `role` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldRoleType_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldType_) ### sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation Interaction An interaction that triggers an action, such as a navigation or filter, in response to an event on a Tableau Next widget. * `actionType` (_sfdc.unified.analytics.connect.api.enums.ConnectInteractionTypeEnum_) * `eventType` (_sfdc.unified.analytics.connect.api.enums.ConnectInteractionEventTypeEnum_) * `parameters` (_sfdc.unified.analytics.connect.api.output.actions.BaseInteractionParametersRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.VisualizationViewRepresentation VisualizationView A visualization view. * `isOriginal` (_boolean_) Specifies whether the view is the original visualization view (`true`) or not (`false`). * `viewSpecification` (_sfdc.unified.analytics.connect.api.output.VisualizationViewSpecRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationVisualSpecRepresentation A visual specification for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFlowLayoutVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationMapLayoutVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationRadialLayoutVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationTableLayoutVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationVizqlLayoutVisualSpecRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationDataSourceRepresentation VisualizationDataSource A data source for a visualization. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationDataSourceType_) * `url` (_string (url)_) The URL of the visualization data source. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationCreationSource The source a visualization was created from. Type: `string`. Allowed values: `Conversation`, `Mcp`, `Slack`, `TuaApp`. ### sfdc.unified.analytics.connect.api.output.AssetReferenceRepresentation AssetReference An asset reference. * `url` (_string (url)_) The URL of the asset. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.VisualizationReferencedDataSourceRepresentation A data source referenced by a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationSemanticModelDataSourceRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetTypeEnum The type of asset that can be added to a workspace. Type: `string`. Allowed values: `AnalyticsDashboard`, `AnalyticsVisualization`, `Flexipage`, `MktCalculatedInsightObject`, `MktDataConnection`, `MktDataLakeObject`, `MktDataModelObject`, `MktDataTransformSetup`, `SemanticModel`. ### sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetUsageTypeEnum Different usage types of assets in a workspace Type: `string`. Allowed values: `Created`, `Referenced`. ### sfdc.unified.analytics.connect.api.output.assetsCompare.AnalyticsAssetsCompareChangeOutputRepresentation A single change entry from asset compare. * `changeType` (_string_) The type of change for this block: added, deleted, or modified. * `delta` (_object_) The field-level changes for this block (the changed fields and their source/target values). Additional properties: `object`. * `id` (_string_) The block ID. * `nestedDiff` (_array of sfdc.unified.analytics.connect.api.output.assetsCompare.AnalyticsAssetsCompareChangeOutputRepresentation_) The optional nested block diff payload. * `type` (_string_) The block type. ### sfdc.unified.analytics.dependents.connect.api.output.AssetReferenceRepresentation A resolved reference to the queried asset. * `assetApiName` (_string_) The API (developer) name of the asset. * `assetId` (_string_) The record ID of the asset. * `assetLabel` (_string_) The display label of the asset. * `assetType` (_sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetTypeEnum_) ### sfdc.unified.analytics.dependents.connect.api.output.AssetDependentGroupRepresentation A group of dependent assets that share the same asset type. * `count` (_integer_) The number of dependent assets in this group. * `dependentAssetType` (_sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetTypeEnum_) * `dependents` (_array of sfdc.unified.analytics.dependents.connect.api.output.AssetDependentRepresentation_) The dependent assets of this type. ### sfdc.unified.analytics.connect.api.input.dashboard.DashboardLayoutPageInputRepresentation DashboardLayoutPage A page within a Tableau Next dashboard layout. * `navigationHidden` (_boolean_) Specifies whether navigation is hidden on the page (`true`) or shown (`false`). * `widgets` (_array of sfdc.unified.analytics.connect.api.input.dashboard.DashboardPageWidgetInputRepresentation_) The list of widgets in the page. * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.input.dashboard.DashboardLayoutStyleInputRepresentation A layout style for a dashboard in Tableau Next. * `backgroundColor` (_string_) The background color in RGB. * `cellSpacingX` (_integer_) The cell Spacing Horizontal. * `cellSpacingY` (_integer_) The cell Spacing Vertical. * `gutterColor` (_string_) The gutter Color in RGB. ### sfdc.unified.analytics.connect.api.input.common.BackgroundParametersInputRepresentation A set of background image settings for a dashboard in Tableau Next. * `alignmentX` (_string_) The horizontal alignment of the background image. * `alignmentY` (_string_) The vertical alignment of the background image. * `imageScale` (_sfdc.unified.analytics.connect.api.enums.ImageScaleTypeEnum_) * `opacity` (_integer_) The background image opacity (0-100). ### sfdc.unified.analytics.connect.api.input.dashboard.DashboardStyleWidgetStyleInputRepresentation A set of common style properties for a widget in a Tableau Next dashboard. * `backgroundColor` (_string_) The background color. * `borderColor` (_string_) The border color. * `borderEdges` (_array of string_) The border edges. * `borderRadius` (_integer_) The border radius. * `borderWidth` (_integer_) The border width. ### sfdc.unified.analytics.connect.api.input.widgets.button.AnalyticsButtonWidgetInputRepresentation AnalyticsButton A button widget for a Tableau Next dashboard. * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetParametersInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.container.AnalyticsContainerWidgetInputRepresentation AnalyticsContainer A container widget for a Tableau Next dashboard, with a background sourced from a data source. * `backgroundSource` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.container.ContainerWidgetParametersInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.filter.AnalyticsFilterWidgetInputRepresentation AnalyticsFilter A filter widget, with initial values, parameters, and a data source. * `initialValues` (_sfdc.unified.analytics.connect.api.input.widgets.filter.FilterInitialValuesInputRepresentation_) * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.filter.BaseFilterWidgetParametersInputRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.image.AnalyticsImageWidgetInputRepresentation AnalyticsImage An image widget for a Tableau Next dashboard, sourced from a data source. * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.image.ImageWidgetParametersInputRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.lightning.AnlytLightningCompWidgetInputRepresentation AnlytLightningComp A Lightning component widget for a Tableau Next dashboard, either a standard or custom component. * `componentType` (_string_) Type of Lightning Component (Standard or Custom). * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.lightning.AnlytLightningCompWidgetParametersInputRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.input.widgets.lightning.AnlytLightningComponentSourceInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.metric.AnalyticsMetricWidgetInputRepresentation AnalyticsMetric A metric widget for a Tableau Next dashboard, sourced from a data source. * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.metric.MetricWidgetParametersInputRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.navigation.AnalyticsNavigationWidgetInputRepresentation AnalyticsNavigation A navigation widget for a Tableau Next dashboard. * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationWidgetParametersInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.parameter.AnalyticsParameterWidgetInputRepresentation AnalyticsParameter A parameter widget for a Tableau Next dashboard, with initial values sourced from a data source. * `initialValues` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterInitialValuesInputRepresentation_) * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.BaseParameterWidgetParametersInputRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.summary.AnalyticsSummaryWidgetInputRepresentation AnalyticsSummary A summary widget for a Tableau Next dashboard. * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.summary.SummaryWidgetParametersInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.text.AnalyticsTextWidgetInputRepresentation AnalyticsText A text widget for a Tableau Next dashboard. * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetParametersInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.visualization.AnalyticsVisualizationWidgetInputRepresentation AnalyticsVisualization A visualization widget for a Tableau Next dashboard, sourced from a data source. * `parameters` (_sfdc.unified.analytics.connect.api.input.widgets.visualization.VisualizationWidgetParametersInputRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation_) The actions of the widget. * `dynamicTokens` (_object_) The map of dynamic tokens in the widget. Additional properties: `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.enums.DashboardDataSourceTypeEnum The type of the dashboard data source. Type: `string`. Allowed values: `Image`, `LightningWebComponent`, `SemanticModel`, `Visualization`. ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardLayoutPageRepresentation DashboardLayoutPage A page within a Tableau Next dashboard layout. * `navigationHidden` (_boolean_) Specifies whether navigation is hidden on the page (`true`) or shown (`false`). * `widgets` (_array of sfdc.unified.analytics.connect.api.output.dashboard.DashboardPageWidgetRepresentation_) The list of widgets on the page. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardLayoutStyleRepresentation Represents dashboard layout style representation in Tableau Next. * `backgroundColor` (_string_) The background color in RGB. * `cellSpacingX` (_integer_) The cell spacing Horizontal. * `cellSpacingY` (_integer_) The cell spacing Vertical. * `gutterColor` (_string_) The gutter color in RGB. ### sfdc.unified.analytics.connect.api.output.common.BackgroundParametersRepresentation A set of background image settings for a dashboard in Tableau Next. * `alignmentX` (_string_) The horizontal alignment of the background image. * `alignmentY` (_string_) The vertical alignment of the background image. * `imageScale` (_sfdc.unified.analytics.connect.api.enums.ImageScaleTypeEnum_) * `opacity` (_integer_) The background image opacity (0-100). ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardStyleWidgetStyleRepresentation Represents widget common styles representation in Tableau Next. * `backgroundColor` (_string_) The back ground color. * `borderColor` (_string_) The border color. * `borderEdges` (_array of string_) The border edges. * `borderRadius` (_integer_) The border radius. * `borderWidth` (_integer_) The border width. ### sfdc.unified.analytics.connect.api.output.widgets.button.AnalyticsButtonWidgetRepresentation AnalyticsButton A button widget for a Tableau Next dashboard. * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetParametersRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.container.AnalyticsContainerWidgetRepresentation AnalyticsContainer A container widget for a Tableau Next dashboard, with a background sourced from a data source. * `backgroundSource` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.container.ContainerWidgetParametersRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.filter.AnalyticsFilterWidgetRepresentation AnalyticsFilter A filter widget, with initial values, parameters, and a data source. * `initialValues` (_sfdc.unified.analytics.connect.api.output.widgets.filter.FilterInitialValuesRepresentation_) * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.filter.BaseFilterWidgetParametersRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.image.AnalyticsImageWidgetRepresentation AnalyticsImage An image widget for a Tableau Next dashboard, sourced from a data source. * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.image.ImageWidgetParametersRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.lightning.AnlytLightningCompWidgetRepresentation AnlytLightningComp A Lightning component widget for a Tableau Next dashboard, either a standard or custom component. * `componentType` (_string_) Type of Lightning Component (Standard or Custom) * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.lightning.AnlytLightningCompWidgetParametersRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.widgets.lightning.AnlytLightningComponentSourceRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.metric.AnalyticsMetricWidgetRepresentation AnalyticsMetric A metric widget for a Tableau Next dashboard, sourced from a data source. * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.metric.MetricWidgetParametersRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.navigation.AnalyticsNavigationWidgetRepresentation AnalyticsNavigation A navigation widget for a Tableau Next dashboard. * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationWidgetParametersRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.parameter.AnalyticsParameterWidgetRepresentation AnalyticsParameter A parameter widget for a Tableau Next dashboard, with initial values sourced from a data source. * `initialValues` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterInitialValuesRepresentation_) * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.BaseParameterWidgetParametersRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.summary.AnalyticsSummaryWidgetRepresentation AnalyticsSummary A summary widget for a Tableau Next dashboard. * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.summary.SummaryWidgetParametersRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.text.AnalyticsTextWidgetRepresentation AnalyticsText A text widget for a Tableau Next dashboard. * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetParametersRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.visualization.AnalyticsVisualizationWidgetRepresentation AnalyticsVisualization A visualization widget for a Tableau Next dashboard, sourced from a data source and linked to a semantic model. * `parameters` (_sfdc.unified.analytics.connect.api.output.widgets.visualization.VisualizationWidgetParametersRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation_) The widget actions. * `dynamicTokens` (_object_) The dynamic tokens for the widget. Additional properties: `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`. * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum_) ### sfdc.unified.analytics.connect.api.enums.DashboardBundleAssetTypeEnum The type of the dashboard bundle assets supported. Type: `string`. Allowed values: `Dashboard`, `DashboardView`, `SemanticModel`, `Visualization`. ### sfdc.unified.analytics.connect.api.input.CustomViewFilterInputRepresentation A dashboard custom view filter selection. * `details` (_sfdc.unified.analytics.connect.api.input.FilterDetailsInputRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.input.DataSourceInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.CustomViewParameterInputRepresentation A dashboard custom view parameter. * `details` (_any_) The tODO-details is as blob for which structure is not yet final. * `source` (_sfdc.unified.analytics.connect.api.input.DataSourceInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.CustomViewSelectionInputRepresentation A dashboard custom view mark selection. * `details` (_any_) The tODO-details is a blob for which structure is not final yet. * `source` (_sfdc.unified.analytics.connect.api.input.DataSourceInputRepresentation_) ### sfdc.unified.analytics.connect.api.output.CustomViewFilterRepresentation A dashboard custom view filter selection. * `details` (_sfdc.unified.analytics.connect.api.output.FilterDetailsRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.DataSourceRepresentation_) * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) ### sfdc.unified.analytics.connect.api.output.CustomViewParameterRepresentation A dashboard custom view parameter. * `details` (_sfdc.unified.analytics.connect.api.output.CustomViewParameterDetailsRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.DataSourceRepresentation_) * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) ### sfdc.unified.analytics.connect.api.output.CustomViewSelectionRepresentation A dashboard custom view selection. * `details` (_sfdc.unified.analytics.connect.api.output.CustomViewSelectionDetailsRepresentation_) * `source` (_sfdc.unified.analytics.connect.api.output.DataSourceRepresentation_) * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) ### sfdc.unified.analytics.connect.api.output.follow.SemanticSubMetricAssetRefRepresentation SemanticSubMetricAssetRefRepresentation A reference to a followed semantic sub-metric asset, identified by model ID. * `modelId` (_string (Id)_) Model ID * `assetId` (_string (Id)_) Asset Id * `assetType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowedAssetTypeEnum_) * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) Created date of the asset * `followedTimeRange` (_sfdc.unified.analytics.connect.api.output.follow.UnifiedFilterRepresentation_) * `followerType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowerTypeEnum_) * `id` (_string (Id)_) Database record id. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) Last modified date of the asset. * `shouldShowForecast` (_boolean_) Whether to show forecast for the followed asset. Null means false. ### sfdc.unified.analytics.connect.api.output.follow.SemanticSubMetricAssetRepresentation SemanticSubMetricAssetRepresentation A followed semantic sub-metric asset, including its filters, model, and time range. * `filterLogic` (_string_) Filter logic * `filters` (_array of sfdc.semantic.authoring.connect.api.output.SemanticFilterOutputRepresentation_) List of filters * `modelId` (_string_) Model ID * `semanticMetricId` (_string_) Semantic metric ID * `timeRange` (_sfdc.semantic.authoring.connect.api.output.SemanticTimeRangeOutputRepresentation_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. * `assetType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowedAssetTypeEnum_) * `followedTimeRange` (_sfdc.unified.analytics.connect.api.output.follow.UnifiedFilterRepresentation_) ### sfdc.semantic.authoring.connect.api.enums.SemanticFilterOperatorTypeEnum Type: `string`. ### sfdc.unified.analytics.connect.api.enums.share.ApplicationDomainEnum The type of application domain. Type: `string`. Allowed values: `DataCloud`, `Tableau`. ### sfdc.unified.analytics.connect.api.output.share.SetupRecordShareTargetRecordRepresentation A setup Record Share Target Record Representation. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The date the record was created. * `developerName` (_string_) The developer name of the record. * `label` (_string_) The master label of the record. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The date the record was last updated. * `recordId` (_string_) The ID of the record. ### sfdc.unified.analytics.connect.api.output.share.SetupRecordShareUserOrGroupRepresentation A userOrGroup who a share is assigned to. * `displayName` (_string_) The display Name. * `email` (_string_, nullable) The email. * `groupMemberCount` (_integer_, nullable) The number of user members in the group. * `id` (_string_) The ID of the User/Group. * `profilePhotoUrl` (_string (url)_, nullable) The Chatter profile photo of the user. * `username` (_string_, nullable) The username. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationDataSourceType The data source type of the visualization. Type: `string`. Allowed values: `SemanticModel`. ### sfdc.unified.analytics.connect.api.input.AdHocCalculationInputRepresentation An ad-hoc calculation for a visualization, computed from an expression with an aggregation type and display settings. * `aggregationType` (_sfdc.semantic.authoring.connect.api.enums.SemanticAggregationTypeEnum_) * `dataType` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldDataType_) * `decimalPlace` (_integer_) The decimal places for measurement calculations. * `description` (_string_) The ad-hoc calculation description. * `displayCategory` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldDisplayCategoryType_) * `expression` (_string_) The ad-hoc calculation expression. * `filters` (_array of sfdc.unified.analytics.connect.api.input.AdhocCalculationFilterInputRepresentation_) The filters applied to the calculation. * `label` (_string_) The ad-hoc calculation label. * `level` (_sfdc.semantic.authoring.connect.api.enums.SemanticCalculatedFieldLevelEnum_) * `sentiment` (_sfdc.semantic.authoring.connect.api.enums.SentimentTypeEnum_) * `shouldTreatNullsAsZeros` (_boolean_) Specifies whether nulls are treated as zeros for the calculation, if it's a measurement (`true`), or not (`false`). ### sfdc.unified.analytics.connect.api.input.BaseVisualizationFieldComputeUsingInputRepresentation How a visualization field's table calculation is computed, such as across a pane or down a table. One of: `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingCellInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingPaneAcrossInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingPaneAcrossThenDownInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingPaneDownInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingPaneDownThenAcrossInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingTableAcrossInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingTableAcrossThenDownInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingTableDownInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingTableDownThenAcrossInputRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldDisplayCategoryType The display category of a visualization field. Type: `string`. Allowed values: `Continuous`, `Discrete`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldFunctionType The function applied to a visualization field. Type: `string`. Allowed values: `Attr`, `Avg`, `Count`, `CountD`, `DatePartDay`, `DatePartHour`, `DatePartMinute`, `DatePartMonth`, `DatePartQuarter`, `DatePartSecond`, `DatePartWeek`, `DatePartWeekDay`, `DatePartYear`, `DateTruncDay`, `DateTruncHour`, `DateTruncMinute`, `DateTruncMonth`, `DateTruncQuarter`, `DateTruncSecond`, `DateTruncWeek`, `DateTruncYear`, `FiscalDatePartMonth`, `FiscalDatePartQuarter`, `FiscalDatePartWeek`, `FiscalDatePartYear`, `FiscalDateTruncMonth`, `FiscalDateTruncQuarter`, `FiscalDateTruncWeek`, `FiscalDateTruncYear`, `Max`, `Mdy`, `Median`, `Min`, `My`, `Stdev`, `Stdevp`, `Sum`, `UserAgg`, `Var`, `Varp`. ### sfdc.unified.analytics.connect.api.input.BaseMapPositionalInputRepresentation The position of a map element, either geocoded or by X/Y coordinates. One of: `sfdc.unified.analytics.connect.api.input.GeocodedMapPositionalInputRepresentation`, `sfdc.unified.analytics.connect.api.input.XYMapPositionalInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationFieldQuickTableCalcInputRepresentation A quick table calculation for a visualization field. One of: `sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingAverageInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingMaxInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingMinInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingSumInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcPercentileInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankDenseInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankModifiedInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankUniqueInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcDifferenceInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcPercentDifferenceInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcPercentOfTotalInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcRunningAvgInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcRunningMaxInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcRunningMinInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcRunningSumInputRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldRoleType The role type of a field in a visualization. Type: `string`. Allowed values: `Dimension`, `Measure`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldType The type of a field in a visualization. Type: `string`. Allowed values: `Field`, `MapPosition`, `MeasureNames`, `MeasureValues`. ### sfdc.unified.analytics.connect.api.enums.ConnectInteractionTypeEnum The type of interaction action. Type: `string`. Allowed values: `Filter`, `Flow`, `Navigate`, `Parameter`, `RecordAction`. ### sfdc.unified.analytics.connect.api.enums.ConnectInteractionEventTypeEnum The type of interaction event. Type: `string`. Allowed values: `Click`, `Select`. ### sfdc.unified.analytics.connect.api.input.actions.BaseInteractionParametersInputRepresentation A base set of parameters for an interaction action in Tableau Next. One of: `sfdc.unified.analytics.connect.api.input.actions.FilterActionParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.FlowActionParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.NavigateActionParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.ParameterActionParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.RecordActionParametersInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationViewSpecInputRepresentation The specification for a visualization view. * `advancedDimensionFilters` (_array of sfdc.unified.analytics.connect.api.input.VisualizationFilterInputRepresentation_) The advanced dimension filters (no filter logic supported). * `aggregateFilter` (_sfdc.unified.analytics.connect.api.input.VisualizationFilterGroupInputRepresentation_) * `contextFilter` (_sfdc.unified.analytics.connect.api.input.VisualizationFilterGroupInputRepresentation_) * `filter` (_sfdc.unified.analytics.connect.api.input.VisualizationFilterGroupInputRepresentation_) * `filters` (_array of sfdc.unified.analytics.connect.api.input.VisualizationFilterInputRepresentation_) The filter information for the visualization. * `grandTotals` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsInputRepresentation_) * `sortOrders` (_sfdc.unified.analytics.connect.api.input.VisualizationSortOrdersInputRepresentation_) * `sorts` (_array of sfdc.unified.analytics.connect.api.input.BaseVisualizationSortInputRepresentation_) The sort information for the visualization. * `style` (_sfdc.unified.analytics.connect.api.input.VisualizationViewSpecStyleInputRepresentation_) * `subtotals` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsInputRepresentation_) * `tableCalcFilter` (_sfdc.unified.analytics.connect.api.input.VisualizationFilterGroupInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationFlowLayoutVisualSpecInputRepresentation Flow The Flow layout visual specification for a visualization. * `levels` (_array of string_) The levels for the flow layout visualization. * `link` (_string_) The link for the flow layout visualization. * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationFlowMarksInputRepresentation_) * `style` (_sfdc.unified.analytics.connect.api.input.VisualizationFlowStyleInputRepresentation_) * `layout` (_string_, required) The shape of this object when `layout` is `Flow`. Allowed values: `Flow`. * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationLegendInputRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleSheetInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationMapLayoutVisualSpecInputRepresentation Map The Map layout visual specification for a visualization. * `locations` (_array of string_) The location fields for the map visualization. * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationMapMarksInputRepresentation_) * `style` (_sfdc.unified.analytics.connect.api.input.VisualizationMapStyleInputRepresentation_) * `layout` (_string_, required) The shape of this object when `layout` is `Map`. Allowed values: `Map`. * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationLegendInputRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleSheetInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationRadialLayoutVisualSpecInputRepresentation Radial The Radial layout visual specification for a visualization. * `ban` (_array of string_) The BAN (big number) fields for the radial visualization. * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationRadialMarksInputRepresentation_) * `measureValues` (_array of string_) The measure values for the visualization. * `rings` (_array of string_) The rings fields for the radial visualization. * `slices` (_array of string_) The slices fields for the radial visualization. * `style` (_sfdc.unified.analytics.connect.api.input.VisualizationRadialStyleInputRepresentation_) * `layout` (_string_, required) The shape of this object when `layout` is `Radial`. Allowed values: `Radial`. * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationLegendInputRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleSheetInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationTableLayoutVisualSpecInputRepresentation Table The Table layout visual specification for a visualization. * `groups` (_array of string_) The groups for the visualization. * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationMarksInputRepresentation_) * `rows` (_array of string_) The rows for the visualization. * `style` (_sfdc.unified.analytics.connect.api.input.VisualizationTableStyleInputRepresentation_) * `layout` (_string_, required) The shape of this object when `layout` is `Table`. Allowed values: `Table`. * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationLegendInputRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleSheetInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationVisualSpecInputRepresentation The legacy, pre-layout visual specification for a visualization. * `columns` (_array of string_) The columns for the visualization. * `forecasts` (_object_) The forecasts for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.BaseVisualizationForecastModelInputRepresentation`. * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationLegendInputRepresentation`. * `marks` (_object_) The marks for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation`. * `measureValues` (_array of string_) The measure values for the visualization. * `mode` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationModeType_) * `referenceLines` (_object_) The reference lines for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineInputRepresentation`. * `rows` (_array of string_) The rows for the visualization. * `style` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleInputRepresentation_) * `layout` (_string_, required) The shape of `visualSpecification` when `layout` is `*`. Allowed values: `*`. ### sfdc.unified.analytics.connect.api.input.VisualizationVizqlLayoutVisualSpecInputRepresentation Vizql The VizQL layout visual specification for a visualization. * `columns` (_array of string_) The columns for the visualization. * `forecasts` (_object_) The forecasts for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.BaseVisualizationForecastModelInputRepresentation`. * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationMarksInputRepresentation_) * `measureValues` (_array of string_) The measure values for the visualization. * `referenceLines` (_object_) The reference lines for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineInputRepresentation`. * `rows` (_array of string_) The rows for the visualization. * `style` (_sfdc.unified.analytics.connect.api.input.VisualizationVizqlStyleInputRepresentation_) * `layout` (_string_, required) The shape of this object when `layout` is `Vizql`. Allowed values: `Vizql`. * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationLegendInputRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleSheetInputRepresentation_) ### sfdc.unified.analytics.connect.api.output.AdHocCalculationRepresentation An ad-hoc calculation for a visualization field. * `aggregationType` (_sfdc.semantic.authoring.connect.api.enums.SemanticAggregationTypeEnum_) * `dataType` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldDataType_) * `decimalPlace` (_integer_) The decimal place (measure only). * `description` (_string_) The description. * `displayCategory` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldDisplayCategoryType_) * `expression` (_string_) The ad-hoc calculation expression. * `filters` (_array of sfdc.semantic.authoring.connect.api.output.SemanticFilterOutputRepresentation_) The filters applied to the calculation. * `label` (_string_) The label. * `level` (_sfdc.semantic.authoring.connect.api.enums.SemanticCalculatedFieldLevelEnum_) * `sentiment` (_sfdc.semantic.authoring.connect.api.enums.SentimentTypeEnum_) * `shouldTreatNullsAsZeros` (_boolean_) Specifies whether to treat null values as zero for the measure (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.BaseVisualizationFieldComputeUsingRepresentation A computation method for a visualization field. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingCellRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingPaneAcrossRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingPaneAcrossThenDownRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingPaneDownRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingPaneDownThenAcrossRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingTableAcrossRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingTableAcrossThenDownRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingTableDownRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingTableDownThenAcrossRepresentation`. ### sfdc.unified.analytics.connect.api.output.BaseMapPositionalRepresentation A map position for a visualization field. One of: `sfdc.unified.analytics.connect.api.output.GeocodedMapPositionalRepresentation`, `sfdc.unified.analytics.connect.api.output.XYMapPositionalRepresentation`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationFieldQuickTableCalcRepresentation A quick table calculation for a visualization field. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingAverageRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingMaxRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingMinRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingSumRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcPercentileRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankDenseRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankModifiedRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankUniqueRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcDifferenceRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcPercentDifferenceRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcPercentOfTotalRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningAvgRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningMaxRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningMinRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningSumRepresentation`. ### sfdc.unified.analytics.connect.api.output.actions.BaseInteractionParametersRepresentation Represents actions parameter representation in Tableau Next. One of: `sfdc.unified.analytics.connect.api.output.actions.FilterActionParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.FlowActionParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.NavigateActionParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.ParameterActionParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.RecordActionParametersRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationViewSpecRepresentation A view specification for a visualization, including its filters, sorts, totals, and style. * `advancedDimensionFilters` (_array of sfdc.unified.analytics.connect.api.output.VisualizationFilterRepresentation_) The advanced dimension filters (no filter logic supported). * `aggregateFilter` (_sfdc.unified.analytics.connect.api.output.VisualizationFilterGroupRepresentation_) * `contextFilter` (_sfdc.unified.analytics.connect.api.output.VisualizationFilterGroupRepresentation_) * `filter` (_sfdc.unified.analytics.connect.api.output.VisualizationFilterGroupRepresentation_) * `filters` (_array of sfdc.unified.analytics.connect.api.output.VisualizationFilterRepresentation_) The filter information for the visualization. * `grandTotals` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsRepresentation_) * `sortOrders` (_sfdc.unified.analytics.connect.api.output.VisualizationSortOrdersRepresentation_) * `sorts` (_array of sfdc.unified.analytics.connect.api.output.BaseVisualizationSortRepresentation_) The sort information for the visualization. * `style` (_sfdc.unified.analytics.connect.api.output.VisualizationViewSpecStyleRepresentation_) * `subtotals` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsRepresentation_) * `tableCalcFilter` (_sfdc.unified.analytics.connect.api.output.VisualizationFilterGroupRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationFlowLayoutVisualSpecRepresentation Flow A flow-layout visual specification for a visualization. * `levels` (_array of string_) The levels for the flow layout visualization. * `link` (_string_) The link for the flow layout visualization. * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationFlowMarksRepresentation_) * `style` (_sfdc.unified.analytics.connect.api.output.VisualizationFlowStyleRepresentation_) * `layout` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLayoutType_, required) * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationLegendRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleSheetRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationMapLayoutVisualSpecRepresentation Map A map-layout visual specification for a visualization. * `locations` (_array of string_) The location fields for the map visualization. * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationMapMarksRepresentation_) * `style` (_sfdc.unified.analytics.connect.api.output.VisualizationMapStyleRepresentation_) * `layout` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLayoutType_, required) * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationLegendRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleSheetRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationRadialLayoutVisualSpecRepresentation Radial A radial-layout visual specification for a visualization. * `ban` (_array of string_) The BAN (big number) fields for the radial visualization. * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationRadialMarksRepresentation_) * `measureValues` (_array of string_) The measure value fields for the radial visualization. * `rings` (_array of string_) The rings fields for the radial visualization. * `slices` (_array of string_) The slices fields for the radial visualization. * `style` (_sfdc.unified.analytics.connect.api.output.VisualizationRadialStyleRepresentation_) * `layout` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLayoutType_, required) * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationLegendRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleSheetRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationTableLayoutVisualSpecRepresentation Table A table-layout visual specification for a visualization. * `groups` (_array of string_) The groups for the visualization. * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationMarksRepresentation_) * `rows` (_array of string_) The rows for the visualization. * `style` (_sfdc.unified.analytics.connect.api.output.VisualizationTableStyleRepresentation_) * `layout` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLayoutType_, required) * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationLegendRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleSheetRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationVisualSpecRepresentation A legacy, pre-layout visual specification for a visualization, made up of columns, rows, marks, and style settings. * `columns` (_array of string_) The columns for the visualization. * `forecasts` (_object_) The forecasts for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.BaseVisualizationForecastModelRepresentation`. * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationLegendRepresentation`. * `marks` (_object_) The marks for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation`. * `measureValues` (_array of string_) The measure values for the visualization. * `mode` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationModeType_) * `referenceLines` (_object_) The reference lines for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineRepresentation`. * `rows` (_array of string_) The rows for the visualization. * `style` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleRepresentation_) * `layout` (_string_, required) The shape of `visualSpecification` when `layout` is `*`. Allowed values: `*`. ### sfdc.unified.analytics.connect.api.output.VisualizationVizqlLayoutVisualSpecRepresentation Vizql A visual specification for a VizQL visualization layout, defined by its columns, rows, marks, and style. * `columns` (_array of string_) The columns for the visualization. * `forecasts` (_object_) The forecasts for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.BaseVisualizationForecastModelRepresentation`. * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationMarksRepresentation_) * `measureValues` (_array of string_) The measure values for the visualization. * `referenceLines` (_object_) The reference lines for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineRepresentation`. * `rows` (_array of string_) The rows for the visualization. * `style` (_sfdc.unified.analytics.connect.api.output.VisualizationVizqlStyleRepresentation_) * `layout` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLayoutType_, required) * `legends` (_object_) The legends for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationLegendRepresentation`. * `stylesheet` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleSheetRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationSemanticModelDataSourceRepresentation SemanticModel A semantic-model data source referenced by a visualization. * `semanticModel` (_sfdc.semantic.authoring.connect.api.output.SemanticModelOutputRepresentation_) * `type` (_string_, required) The shape of `dataSource` when `type` is `SemanticModel`. Allowed values: `SemanticModel`. ### sfdc.unified.analytics.dependents.connect.api.output.AssetDependentRepresentation A single dependent asset resolved to navigable fields. * `assetApiName` (_string_) The API (developer) name of the dependent asset. * `assetId` (_string_) The navigable record ID of the dependent asset. * `assetLabel` (_string_) The display label of the dependent asset. * `assetType` (_sfdc.unified.analytics.connect.api.enums.ConnectWorkspaceAssetTypeEnum_) ### sfdc.unified.analytics.connect.api.input.dashboard.DashboardPageWidgetInputRepresentation DashboardPageWidget The grid placement of a widget instance on a Tableau Next dashboard page. * `colspan` (_integer_) The colspan. * `column` (_integer_) The column. * `row` (_integer_) The row. * `rowspan` (_integer_) The rowspan. * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.enums.ImageScaleTypeEnum The scale type for an image widget. Type: `string`. Allowed values: `Fill`, `FitToHeight`, `FitToWidth`, `Original`. ### sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetParametersInputRepresentation Button A set of configuration parameters for a button widget in a Tableau Next dashboard, including its text, alignment, and font size. * `alignmentX` (_string_) Button text alignmentX * `alignmentY` (_string_) Button text alignmentY * `fontSize` (_integer_) Button text font size * `hoverStyle` (_sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetStylesInputRepresentation_) * `symbol` (_sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetIconInputRepresentation_) * `text` (_string_) Button text value * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation AnalyticsWidgetDynamicToken A dynamic token for a Tableau Next dashboard widget, resolved from a data source. * `source` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `tokenSpec` (_object_) The specification of the dynamic token. Additional properties: `object`. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsDynamicTokenTypeEnum_) * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsWidgetTypeEnum The type of widget on a dashboard. Type: `string`. Allowed values: `Button`, `Container`, `Extension`, `Filter`, `Image`, `Metric`, `Navigation`, `Parameter`, `Summary`, `Text`, `Visualization`. ### sfdc.unified.analytics.connect.api.input.widgets.container.ContainerWidgetParametersInputRepresentation Container A set of configuration parameters for a container widget in a Tableau Next dashboard. * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.container.ContainerWidgetStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.filter.FilterInitialValuesInputRepresentation ### sfdc.unified.analytics.connect.api.input.widgets.filter.BaseFilterWidgetParametersInputRepresentation BaseFilter Parameters for a filter widget, including its view type. One of: `sfdc.unified.analytics.connect.api.input.widgets.filter.ListCardFilterWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.filter.ListFilterWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.filter.ToggleFilterWidgetParametersInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.widgets.image.ImageWidgetParametersInputRepresentation Image A set of configuration parameters for an image widget in a Tableau Next dashboard, including its alignment, alternative text, scaling, and opacity. * `alignmentX` (_string_) Horizontal alignment of the image * `alignmentY` (_string_) Vertical alignment of the image * `altText` (_string_) Alternative text for the image * `imageScale` (_sfdc.unified.analytics.connect.api.enums.ImageScaleTypeEnum_) * `opacity` (_integer_) Image opacity (0-100) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.image.ImageStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.lightning.AnlytLightningCompWidgetParametersInputRepresentation AnlytLightningComp A set of configuration parameters for a Lightning component widget in a Tableau Next dashboard, including its fully qualified component name and dynamic properties. * `fullyQualifiedName` (_string_) Fully qualified name (namespace\_\_componentName) for Lightning Components * `properties` (_object_) Dynamic properties for the Lightning Component widget (supports String and Boolean values) Additional properties: `object`. * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.container.ContainerWidgetStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.lightning.AnlytLightningComponentSourceInputRepresentation Lightning Component source input representation _Available April 2026 and later._ * `id` (_string_) Lightning Component Bundle ID * `label` (_string_) Lightning Component source label * `name` (_string_) Lightning Component source name * `namespace` (_string_) Lightning Component source namespace ### sfdc.unified.analytics.connect.api.input.widgets.metric.MetricWidgetParametersInputRepresentation Metric A set of configuration parameters for a metric widget in a Tableau Next dashboard, including its metric option and filter source. * `metricOption` (_sfdc.unified.analytics.connect.api.input.widgets.metric.MetricOptionInputRepresentation_) * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveFilterSourceInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.metric.MetricWidgetStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationWidgetParametersInputRepresentation Navigation A set of configuration parameters for a navigation widget in a Tableau Next dashboard, including its navigation items, view type, and label styles. * `defaultStyle` (_sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetStylesInputRepresentation_) * `labelStyle` (_sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationWidgetLabelStyleInputRepresentation_) * `navigationItems` (_array of sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationItemInputRepresentation_) Navigation items * `selectedStyle` (_sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetStylesInputRepresentation_) * `viewType` (_string_) View type * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterInitialValuesInputRepresentation ### sfdc.unified.analytics.connect.api.input.widgets.parameter.BaseParameterWidgetParametersInputRepresentation BaseParameter A set of configuration parameters for a parameter widget in a Tableau Next dashboard, including its parameter option and view type. One of: `sfdc.unified.analytics.connect.api.input.widgets.parameter.InputCardParameterWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.InputParameterWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.ListCardParameterWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.ListParameterWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.ToggleParameterWidgetParametersInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.widgets.summary.SummaryWidgetParametersInputRepresentation Summary A set of configuration parameters for a summary widget in a Tableau Next dashboard, including its generation specification and filter source. * `generationSpec` (_any_) Generation specification for the summary widget * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveFilterSourceInputRepresentation_) * `type` (_sfdc.unified.analytics.connect.api.enums.WidgetSummaryTypeEnum_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.summary.SummaryWidgetStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetParametersInputRepresentation Text A set of configuration parameters for a text widget in a Tableau Next dashboard, including its content, conditional formatting rules, and vertical alignment. * `conditionalFormattingRules` (_array of sfdc.unified.analytics.connect.api.input.widgets.text.ConditionalFormattingRuleInputRepresentation_) Measure and dimension conditional formatting rules for text widget * `content` (_array of sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetContentParameterInputRepresentation_) Text content of the text widget * `lineSpacing` (_number (double)_) Line spacing of the text widget content. Null means Normal (browser default). * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveFilterSourceInputRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `tooltip` (_string_) Tooltip of the text widget * `verticalAlignment` (_string_) Vertical alignment of the text widget content. Valid values: top, center, bottom * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.visualization.VisualizationWidgetParametersInputRepresentation Visualization A set of configuration parameters for a visualization widget in a Tableau Next dashboard, including its legend position and shared state. * `legendPosition` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLegendPositionType_) * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveFilterSourceInputRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `shareState` (_boolean_) ShareState Parameter value * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.visualization.VisualizationStylesInputRepresentation_) ### sfdc.unified.analytics.connect.api.output.dashboard.DashboardPageWidgetRepresentation DashboardPageWidget The grid placement of a widget instance on a Tableau Next dashboard page. * `colspan` (_integer_) The width of the widget. * `column` (_integer_) The column index of the widget. * `row` (_integer_) The row index of the widget. * `rowspan` (_integer_) The height of the widget. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetParametersRepresentation Button A set of configuration parameters for a button widget in a Tableau Next dashboard, including its text, alignment, and font size. * `alignmentX` (_string_) Button text alignmentX * `alignmentY` (_string_) Button text alignmentY * `fontSize` (_integer_) Button font size * `hoverStyle` (_sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetStylesRepresentation_) * `symbol` (_sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetIconRepresentation_) * `text` (_string_) Text value of button * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation AnalyticsWidgetDynamicToken A dynamic token for a Tableau Next dashboard widget, resolved from a data source, with its type and resolution status. * `source` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `status` (_sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum_) * `tokenSpec` (_any_) The specification of the dynamic token. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsDynamicTokenTypeEnum_) * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.enums.DashboardResponseStatusEnum The response status for a dashboard-related request, such as a widget or token request. Type: `string`. Allowed values: `DataAccessError`, `DataSourceError`, `Ok`. ### sfdc.unified.analytics.connect.api.output.widgets.container.ContainerWidgetParametersRepresentation Container A set of configuration parameters for a container widget in a Tableau Next dashboard. * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.container.ContainerWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.filter.FilterInitialValuesRepresentation Representation of a initialValues. * `details` (_sfdc.unified.analytics.connect.api.output.widgets.filter.FilterDetailsRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.filter.BaseFilterWidgetParametersRepresentation BaseFilter Parameters for a filter widget, including its view type. One of: `sfdc.unified.analytics.connect.api.output.widgets.filter.ListCardFilterWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.filter.ListFilterWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.filter.ToggleFilterWidgetParametersRepresentation`. ### sfdc.unified.analytics.connect.api.output.widgets.image.ImageWidgetParametersRepresentation Image A set of configuration parameters for an image widget in a Tableau Next dashboard, including its alignment, alternative text, scaling, and opacity. * `alignmentX` (_string_) Horizontal alignment of the image (left, center, right) * `alignmentY` (_string_) Vertical alignment of the image (top, center, bottom) * `altText` (_string_) Alternative text for the image * `imageScale` (_sfdc.unified.analytics.connect.api.enums.ImageScaleTypeEnum_) * `opacity` (_integer_) Image opacity in percentage * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.image.ImageWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.lightning.AnlytLightningCompWidgetParametersRepresentation AnlytLightningComp A set of configuration parameters for a Lightning component widget in a Tableau Next dashboard, including its fully qualified component name and dynamic properties. * `fullyQualifiedName` (_string_) Fully qualified name (namespace\_\_componentName) for Lightning Components * `properties` (_object_) Dynamic properties for the Lightning Component widget (supports String and Boolean values) Additional properties: `object`. * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.container.ContainerWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.lightning.AnlytLightningComponentSourceRepresentation Represents Lightning Component source representation in unified analytics _Available April 2026 and later._ * `id` (_string (Id)_) Lightning Component Bundle ID * `label` (_string_) Lightning Component source label * `name` (_string_) Lightning Component source name * `namespace` (_string_) Lightning Component source namespace * `type` (_sfdc.unified.analytics.connect.api.enums.DashboardDataSourceTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.metric.MetricWidgetParametersRepresentation Metric A set of configuration parameters for a metric widget in a Tableau Next dashboard, including its metric option and filter source. * `metricOption` (_sfdc.unified.analytics.connect.api.output.widgets.metric.MetricOptionRepresentation_) * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveFilterSourceRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.metric.MetricWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationWidgetParametersRepresentation Navigation A set of configuration parameters for a navigation widget in a Tableau Next dashboard, including its navigation items, view type, and label styles. * `defaultStyle` (_sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetStylesRepresentation_) * `labelStyle` (_sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationWidgetLabelStyleRepresentation_) * `navigationItems` (_array of sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationItemRepresentation_) Navigation items (overrides only) * `selectedStyle` (_sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetStylesRepresentation_) * `viewType` (_string_) View type of the navigation widget * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterInitialValuesRepresentation Representation of a parameter widget initialValues. * `details` (_any_) The parameter selection details ### sfdc.unified.analytics.connect.api.output.widgets.parameter.BaseParameterWidgetParametersRepresentation BaseParameter A set of configuration parameters for a parameter widget in a Tableau Next dashboard, including its parameter option and view type. One of: `sfdc.unified.analytics.connect.api.output.widgets.parameter.InputCardParameterWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.InputParameterWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.ListCardParameterWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.ListParameterWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.ToggleParameterWidgetParametersRepresentation`. ### sfdc.unified.analytics.connect.api.output.widgets.summary.SummaryWidgetParametersRepresentation Summary A set of configuration parameters for a summary widget in a Tableau Next dashboard, including its generation specification and filter source. * `generationSpec` (_any_) Generation specification for the summary widget * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveFilterSourceRepresentation_) * `type` (_sfdc.unified.analytics.connect.api.enums.WidgetSummaryTypeEnum_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.summary.SummaryWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetParametersRepresentation Text A set of configuration parameters for a text widget in a Tableau Next dashboard, including its content, conditional formatting rules, and vertical alignment. * `conditionalFormattingRules` (_array of sfdc.unified.analytics.connect.api.output.widgets.text.ConditionalFormattingRuleRepresentation_) Measure and dimension conditional formatting rules for text widget * `content` (_array of sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetContentParameterRepresentation_) Parameters content associated with text widget * `lineSpacing` (_number (double)_) Line spacing of the text widget content. Null means Normal (browser default). * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveFilterSourceRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `tooltip` (_string_) Tooltip associated with text widget * `verticalAlignment` (_string_) Vertical alignment of the text widget content. Valid values: top, center, bottom. * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.output.widgets.visualization.VisualizationWidgetParametersRepresentation Visualization A set of configuration parameters for a visualization widget in a Tableau Next dashboard, including its legend position and shared state. * `legendPosition` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLegendPositionType_) * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveFilterSourceRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `shareState` (_boolean_) ShareState in visualizationWidgetParameter * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.visualization.VisualizationWidgetStylesRepresentation_) ### sfdc.unified.analytics.connect.api.input.FilterDetailsInputRepresentation The details of a filter. * `fieldName` (_string_) The filter field name. * `operator` (_sfdc.unified.analytics.connect.api.enums.FilterOperatorType_) * `values` (_any_) The filter values. ### sfdc.unified.analytics.connect.api.input.DataSourceInputRepresentation A data source. * `id` (_string_) The ID of the data source. * `name` (_string_) The name of the data source. ### sfdc.unified.analytics.connect.api.output.FilterDetailsRepresentation A field, operator, and value definition for a filter. * `fieldName` (_string_) The filter field name. * `operator` (_sfdc.unified.analytics.connect.api.enums.FilterOperatorType_) * `values` (_any_) The filter values. ### sfdc.unified.analytics.connect.api.output.DataSourceRepresentation A generic data source. * `id` (_string_) The ID of the data source. * `label` (_string_) The label of the data source. * `name` (_string_) The name of the data source. ### sfdc.unified.analytics.connect.api.output.CustomViewParameterDetailsRepresentation A name-and-value pair for a custom view parameter. * `name` (_string_) The name of the parameter. * `value` (_string_) The value of the parameter. ### sfdc.unified.analytics.connect.api.output.CustomViewSelectionDetailsRepresentation A set of details for a custom view selection, including its axes, data source, headers, marks, and nodes. * `axes` (_array of any_) The axes information for the marks data. * `dataSource` (_string_) The name of the data source. * `headers` (_array of sfdc.unified.analytics.connect.api.output.MarkSelectionHeaderRepresentation_) The headers information for the marks data. * `marks` (_array of sfdc.unified.analytics.connect.api.output.MarkSelectionRepresentation_) The array of mark selections with field information and values. * `nodes` (_array of any_) The node information for the mark selection (cluster/tree style selections). ### sfdc.semantic.authoring.connect.api.output.SemanticFilterOutputRepresentation ### sfdc.semantic.authoring.connect.api.output.SemanticTimeRangeOutputRepresentation ### sfdc.semantic.authoring.connect.api.enums.SemanticAggregationTypeEnum Type: `string`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldDataType The data type of a visualization field. Type: `string`. Allowed values: `Boolean`, `Currency`, `Date`, `DateTime`, `Email`, `Number`, `Percentage`, `PhoneNumber`, `Text`, `Url`. ### sfdc.unified.analytics.connect.api.input.AdhocCalculationFilterInputRepresentation A filter applied to a field in an ad hoc calculation. * `fieldName` (_string_) The field name to filter on. * `operator` (_sfdc.semantic.authoring.connect.api.enums.SemanticFilterOperatorTypeEnum_) * `value` (_string_) The single value to filter against. * `values` (_array of string_) The multiple values to filter against. ### sfdc.semantic.authoring.connect.api.enums.SemanticCalculatedFieldLevelEnum Type: `string`. ### sfdc.semantic.authoring.connect.api.enums.SentimentTypeEnum Type: `string`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingCellInputRepresentation Cell The cell computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `Cell`. Allowed values: `Cell`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingPaneAcrossInputRepresentation PaneAcross The pane-across computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `PaneAcross`. Allowed values: `PaneAcross`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingPaneAcrossThenDownInputRepresentation PaneAcrossThenDown The pane-across-then-down computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `PaneAcrossThenDown`. Allowed values: `PaneAcrossThenDown`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingPaneDownInputRepresentation PaneDown The pane-down computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `PaneDown`. Allowed values: `PaneDown`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingPaneDownThenAcrossInputRepresentation PaneDownThenAcross The pane-down-then-across computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `PaneDownThenAcross`. Allowed values: `PaneDownThenAcross`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingTableAcrossInputRepresentation TableAcross The table-across computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `TableAcross`. Allowed values: `TableAcross`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingTableAcrossThenDownInputRepresentation TableAcrossThenDown The table-across-then-down computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `TableAcrossThenDown`. Allowed values: `TableAcrossThenDown`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingTableDownInputRepresentation TableDown The table-down computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `TableDown`. Allowed values: `TableDown`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFieldComputeUsingTableDownThenAcrossInputRepresentation TableDownThenAcross The table-down-then-across computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `TableDownThenAcross`. Allowed values: `TableDownThenAcross`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the order-by clause for extra (marks) fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.input.GeocodedMapPositionalInputRepresentation Geocoded A geocoded map position for a visualization. * `geocoded` (_sfdc.unified.analytics.connect.api.input.MapFieldReferenceInputRepresentation_) * `type` (_string_, required) The shape of `positional` when `type` is `Geocoded`. Allowed values: `Geocoded`. ### sfdc.unified.analytics.connect.api.input.XYMapPositionalInputRepresentation Xy An X/Y map position for a visualization. * `latitudeOrY` (_sfdc.unified.analytics.connect.api.input.MapFieldReferenceInputRepresentation_) * `longitudeOrX` (_sfdc.unified.analytics.connect.api.input.MapFieldReferenceInputRepresentation_) * `type` (_string_, required) The shape of `positional` when `type` is `Xy`. Allowed values: `Xy`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingAverageInputRepresentation MovingAverage A moving-average quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `MovingAverage`. Allowed values: `MovingAverage`. * `nextValues` (_integer_) Next values of field quick table calc. * `previousValues` (_integer_) Previous values of field quick table calc. * `useCurrentValue` (_boolean_) Use current value of field quick table calc. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingMaxInputRepresentation MovingMax A moving-max quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `MovingMax`. Allowed values: `MovingMax`. * `nextValues` (_integer_) Next values of field quick table calc. * `previousValues` (_integer_) Previous values of field quick table calc. * `useCurrentValue` (_boolean_) Use current value of field quick table calc. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingMinInputRepresentation MovingMin A moving-min quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `MovingMin`. Allowed values: `MovingMin`. * `nextValues` (_integer_) Next values of field quick table calc. * `previousValues` (_integer_) Previous values of field quick table calc. * `useCurrentValue` (_boolean_) Use current value of field quick table calc. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingSumInputRepresentation MovingSum A moving-sum quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `MovingSum`. Allowed values: `MovingSum`. * `nextValues` (_integer_) Next values of field quick table calc. * `previousValues` (_integer_) Previous values of field quick table calc. * `useCurrentValue` (_boolean_) Use current value of field quick table calc. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcPercentileInputRepresentation OrderedQuickTableCalcPercentile A percentile quick table calculation for a visualization field. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldQuickTableCalcType_, required) * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankDenseInputRepresentation OrderedQuickTableCalcRankDense A dense-rank quick table calculation for a visualization field. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldQuickTableCalcType_, required) * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankInputRepresentation OrderedQuickTableCalcRank A rank quick table calculation for a visualization field. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldQuickTableCalcType_, required) * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankModifiedInputRepresentation OrderedQuickTableCalcRankModified A modified-rank quick table calculation for a visualization field. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldQuickTableCalcType_, required) * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankUniqueInputRepresentation OrderedQuickTableCalcRankUnique A unique-rank quick table calculation for a visualization field. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldQuickTableCalcType_, required) * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcDifferenceInputRepresentation Difference A difference quick table calculation for a visualization field. * `type` (_string_, required) The shape of `quickTableCalc` when `type` is `Difference`. Allowed values: `Difference`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcPercentDifferenceInputRepresentation PercentDifference A percent-difference quick table calculation for a visualization field. * `type` (_string_, required) The shape of `quickTableCalc` when `type` is `PercentDifference`. Allowed values: `PercentDifference`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcPercentOfTotalInputRepresentation PercentOfTotal A percent-of-total quick table calculation for a visualization field. * `type` (_string_, required) The shape of `quickTableCalc` when `type` is `PercentOfTotal`. Allowed values: `PercentOfTotal`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcRunningAvgInputRepresentation RunningAvg A running-average quick table calculation for a visualization field. * `type` (_string_, required) The shape of `quickTableCalc` when `type` is `RunningAvg`. Allowed values: `RunningAvg`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcRunningMaxInputRepresentation RunningMax A running-max quick table calculation for a visualization field. * `type` (_string_, required) The shape of `quickTableCalc` when `type` is `RunningMax`. Allowed values: `RunningMax`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcRunningMinInputRepresentation RunningMin A running-min quick table calculation for a visualization field. * `type` (_string_, required) The shape of `quickTableCalc` when `type` is `RunningMin`. Allowed values: `RunningMin`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldSimpleQuickTableCalcRunningSumInputRepresentation RunningSum A running-sum quick table calculation for a visualization field. * `type` (_string_, required) The shape of `quickTableCalc` when `type` is `RunningSum`. Allowed values: `RunningSum`. ### sfdc.unified.analytics.connect.api.input.actions.FilterActionParametersInputRepresentation Filter The parameters for a filter action, including the filter to apply and its source field and object. * `filter` (_sfdc.unified.analytics.connect.api.input.actions.FilterActionFilterInputRepresentation_) * `sourceFieldAPIName` (_string_) Source field API name * `sourceObjectAPIName` (_string_) Source object API name ### sfdc.unified.analytics.connect.api.input.actions.FlowActionParametersInputRepresentation Flow The parameters for a flow action, including the flow to run, its input variables, and whether to show a dialog. * `attributes` (_object_) Map of flow action input variables. Additional properties: `sfdc.unified.analytics.connect.api.input.actions.FlowActionParameterAttributesInputRepresentation`. * `flowName` (_string_) Flow Name * `showDialog` (_boolean_) Show Dialog ### sfdc.unified.analytics.connect.api.input.actions.NavigateActionParametersInputRepresentation Navigate The parameters for a navigation action, including the destination, an optional field and label, and whether to carry over the current dashboard state. * `destination` (_sfdc.unified.analytics.connect.api.input.actions.BaseNavigateActionDestinationInputRepresentation_) * `field` (_string_) Field * `includeState` (_boolean_) Whether to include current dashboard state during navigation * `label` (_string_) Label ### sfdc.unified.analytics.connect.api.input.actions.ParameterActionParametersInputRepresentation Parameter The parameters for a parameter action, including the value to set and its source field and object. * `parameter` (_any_) Parameter value * `sourceFieldAPIName` (_string_) Source field API name * `sourceObjectAPIName` (_string_) Source object API name ### sfdc.unified.analytics.connect.api.input.actions.RecordActionParametersInputRepresentation Record The parameters for a record action, including the record ID, the field to act on, and the Salesforce actions to trigger. * `actions` (_array of sfdc.unified.analytics.connect.api.input.actions.RecordActionInfoInputRepresentation_) List of actions that are triggered. * `field` (_sfdc.unified.analytics.connect.api.input.actions.RecordActionFieldInputRepresentation_) * `recordId` (_sfdc.unified.analytics.connect.api.input.actions.RecordActionFieldInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationFilterInputRepresentation A filter for a visualization. * `fieldKey` (_string_) The field key for the filter. * `fieldKeys` (_array of string_) The list of field keys for the filter. * `filter` (_sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterInputRepresentation_) * `filterInfos` (_array of sfdc.unified.analytics.connect.api.input.BaseVisualizationFilterInfoInputRepresentation_) The filters information for the visualization. * `includeAllValues` (_boolean_) Specifies whether all values are included when the filter has no selections (`true`) or not included (`false`). * `isContext` (_boolean_) Specifies whether the filter is a context filter (`true`) or not a context filter (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationFilterGroupInputRepresentation A group of visualization filters with filter logic. * `filterLogic` (_string_) The filter logic expression (e.g. "1 AND 2" or "1 OR 2"). * `filters` (_array of sfdc.unified.analytics.connect.api.input.VisualizationFilterInputRepresentation_) The list of filters in this group. ### sfdc.unified.analytics.connect.api.input.VisualizationTotalsInputRepresentation The grand totals configuration for a visualization. * `columns` (_boolean_) Specifies whether grand totals are shown for columns (`true`) or not shown (`false`). * `rows` (_boolean_) Specifies whether grand totals are shown for rows (`true`) or not shown (`false`). ### sfdc.unified.analytics.connect.api.input.VisualizationSortOrdersInputRepresentation The sort order for columns, rows, and fields in a table visualization. * `columns` (_array of sfdc.unified.analytics.connect.api.input.VisualizationByFieldSortInputRepresentation_) The column sort information for the table. * `fields` (_object_) Indicates the field level sorts. Additional properties: `sfdc.unified.analytics.connect.api.input.BaseVisualizationSortInputRepresentation`. * `rows` (_array of sfdc.unified.analytics.connect.api.input.VisualizationByFieldSortInputRepresentation_) The row sort information for the table. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationSortInputRepresentation A sort for a visualization. One of: `sfdc.unified.analytics.connect.api.input.VisualizationAlphabeticSortInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldSortInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationNestedSortInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationViewSpecStyleInputRepresentation The style for a visualization view. * `headers` (_sfdc.unified.analytics.connect.api.input.VisualizationViewSpecHeadersStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationFlowMarksInputRepresentation Flow layout specific input representation for marks in visualization. * `fields` (_object_) The mark specifications per field. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation`. * `links` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation_) * `nodes` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationFlowStyleInputRepresentation Flow The style for a Flow-layout visualization. * `encodings` (_sfdc.unified.analytics.connect.api.input.VisualizationEncodingStylesInputRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationFlowFieldLabelsStyleInputRepresentation_) * `fonts` (_sfdc.unified.analytics.connect.api.input.VisualizationFontStyleInputRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.input.VisualizationLineStyleInputRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationFlowMarkStylesInputRepresentation_) * `shading` (_sfdc.unified.analytics.connect.api.input.VisualizationShadingStyleInputRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.input.VisualizationTitleStyleInputRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.input.VisualizationTooltipStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationLegendInputRepresentation Input representation for legends in visualization. * `isVisible` (_boolean_) Whether the legend is visible. * `position` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLegendPositionType_) * `title` (_sfdc.unified.analytics.connect.api.input.VisualizationLegendTitleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationStyleSheetInputRepresentation Input representation for a visualization stylesheet. * `rules` (_array of sfdc.unified.analytics.connect.api.input.VisualizationStyleRuleInputRepresentation_) Ordered list of style rules. ### sfdc.unified.analytics.connect.api.input.VisualizationMapMarksInputRepresentation Map layout specific input representation for marks in visualization. * `fields` (_object_) The mark fields. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation`. * `panes` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationMapStyleInputRepresentation Map The style for a map-layout visualization. * `background` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationBackgroundInputRepresentation_) * `encodings` (_sfdc.unified.analytics.connect.api.input.VisualizationEncodingStylesInputRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsStyleInputRepresentation_) * `fonts` (_sfdc.unified.analytics.connect.api.input.VisualizationFontStyleInputRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.input.VisualizationLineStyleInputRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationMapMarkStylesInputRepresentation_) * `shading` (_sfdc.unified.analytics.connect.api.input.VisualizationShadingStyleInputRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.input.VisualizationTitleStyleInputRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.input.VisualizationTooltipStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationRadialMarksInputRepresentation Radial layout specific input representation for marks in visualization. * `panes` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationRadialStyleInputRepresentation Radial The style for a Radial-layout visualization. * `axis` (_sfdc.unified.analytics.connect.api.input.VisualizationAxisStylesInputRepresentation_) * `ban` (_sfdc.unified.analytics.connect.api.input.VisualizationBanStyleInputRepresentation_) * `encodings` (_sfdc.unified.analytics.connect.api.input.VisualizationEncodingStylesInputRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationRadialFieldLabelsStyleInputRepresentation_) * `fonts` (_sfdc.unified.analytics.connect.api.input.VisualizationFontStyleInputRepresentation_) * `headers` (_sfdc.unified.analytics.connect.api.input.VisualizationRadialHeadersStyleInputRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.input.VisualizationLineStyleInputRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationRadialMarkStylesInputRepresentation_) * `shading` (_sfdc.unified.analytics.connect.api.input.VisualizationShadingStyleInputRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.input.VisualizationTitleStyleInputRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.input.VisualizationTooltipStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationMarksInputRepresentation Vizql layout specific input representation for marks in visualization. * `fields` (_object_) The mark specifications per field. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation`. * `headers` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderMarkInputRepresentation_) * `panes` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationTableStyleInputRepresentation Table The style for a Table-layout visualization. * `encodings` (_sfdc.unified.analytics.connect.api.input.VisualizationEncodingStylesInputRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationTableFieldLabelsStyleInputRepresentation_) * `fit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTableStyleFitType_) * `fonts` (_sfdc.unified.analytics.connect.api.input.VisualizationFontStyleInputRepresentation_) * `grandTotals` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsStyleInputRepresentation_) * `headers` (_sfdc.unified.analytics.connect.api.input.VisualizationTableHeaderStyleInputRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.input.VisualizationLineStyleInputRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStylesInputRepresentation_) * `shading` (_sfdc.unified.analytics.connect.api.input.VisualizationShadingStyleInputRepresentation_) * `subtotals` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsStyleInputRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.input.VisualizationTitleStyleInputRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.input.VisualizationTooltipStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.BaseVisualizationForecastModelInputRepresentation A forecast for a visualization, computed using a Holt-Winters or ridge regression model. One of: `sfdc.unified.analytics.connect.api.input.VisualizationHoltWintersForecastInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationRidgeRegressionForecastInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationMarkInputRepresentation Input representation for marks in visualization. * `encodings` (_array of sfdc.unified.analytics.connect.api.input.VisualizationMarkEncodingInputRepresentation_) The encoding properties of the mark. * `isAutomatic` (_boolean_) Whether the mark stack should be applied by default. * `stack` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStackInputRepresentation_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkType_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationModeType The mode of the visualization's visual specification. Type: `string`. Allowed values: `Table`, `Visualization`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineInputRepresentation A reference line for a visualization. One of: `sfdc.unified.analytics.connect.api.input.VisualizationReferenceBandInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationStyleInputRepresentation Input representation for visual specification style in visualization. * `allHeaders` (_sfdc.unified.analytics.connect.api.input.VisualizationAllHeadersStyleInputRepresentation_) * `axis` (_object_) The axis style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationAxisStyleInputRepresentation`. * `fieldLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsStyleInputRepresentation_) * `fit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleFitType_) * `fonts` (_sfdc.unified.analytics.connect.api.input.VisualizationFontStyleInputRepresentation_) * `grandTotals` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsStyleInputRepresentation_) * `headers` (_object_) The header style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationHeaderStyleInputRepresentation`. * `lines` (_sfdc.unified.analytics.connect.api.input.VisualizationLineStyleInputRepresentation_) * `marks` (_object_) The mark style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation`. * `panes` (_object_) The pane style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationPaneStyleInputRepresentation`. * `referenceLines` (_object_) The reference line style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineStyleInputRepresentation`. * `shading` (_sfdc.unified.analytics.connect.api.input.VisualizationShadingStyleInputRepresentation_) * `showDataPlaceholder` (_boolean_) If the data placeholder column or cell should be visible. * `title` (_sfdc.unified.analytics.connect.api.input.VisualizationTitleStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationVizqlStyleInputRepresentation Vizql The style for a VizQL-layout visualization. * `axis` (_sfdc.unified.analytics.connect.api.input.VisualizationAxisStylesInputRepresentation_) * `encodings` (_sfdc.unified.analytics.connect.api.input.VisualizationEncodingStylesInputRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsStyleInputRepresentation_) * `fit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationVizqlStyleFitType_) * `fonts` (_sfdc.unified.analytics.connect.api.input.VisualizationFontStyleInputRepresentation_) * `grandTotals` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsStyleInputRepresentation_) * `headers` (_sfdc.unified.analytics.connect.api.input.VisualizationAllHeadersStyleInputRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.input.VisualizationLineStyleInputRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStylesInputRepresentation_) * `referenceLines` (_object_) The reference line styles for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineStyleInputRepresentation`. * `shading` (_sfdc.unified.analytics.connect.api.input.VisualizationShadingStyleInputRepresentation_) * `showDataPlaceholder` (_boolean_) Whether to show data placeholder. * `subtotals` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsStyleInputRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.input.VisualizationTitleStyleInputRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.input.VisualizationTooltipStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingCellRepresentation Cell The cell computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `Cell`. Allowed values: `Cell`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingPaneAcrossRepresentation PaneAcross The pane-across computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `PaneAcross`. Allowed values: `PaneAcross`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingPaneAcrossThenDownRepresentation PaneAcrossThenDown The pane-across-then-down computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `PaneAcrossThenDown`. Allowed values: `PaneAcrossThenDown`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingPaneDownRepresentation PaneDown The pane-down computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `PaneDown`. Allowed values: `PaneDown`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingPaneDownThenAcrossRepresentation PaneDownThenAcross The pane-down-then-across computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `PaneDownThenAcross`. Allowed values: `PaneDownThenAcross`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingTableAcrossRepresentation TableAcross The table-across computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `TableAcross`. Allowed values: `TableAcross`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingTableAcrossThenDownRepresentation TableAcrossThenDown The table-across-then-down computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `TableAcrossThenDown`. Allowed values: `TableAcrossThenDown`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingTableDownRepresentation TableDown The table-down computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `TableDown`. Allowed values: `TableDown`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFieldComputeUsingTableDownThenAcrossRepresentation TableDownThenAcross The table-down-then-across computation method for a visualization field. * `type` (_string_, required) The shape of `computeUsing` when `type` is `TableDownThenAcross`. Allowed values: `TableDownThenAcross`. * `useOrderByForExtraFields` (_boolean_) Specifies whether to use the ORDER BY clause for extra mark fields (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.GeocodedMapPositionalRepresentation Geocoded A geocoded map position for a visualization field. * `geocoded` (_sfdc.unified.analytics.connect.api.output.MapFieldReferenceRepresentation_) * `type` (_string_, required) The shape of `positional` when `type` is `Geocoded`. Allowed values: `Geocoded`. ### sfdc.unified.analytics.connect.api.output.XYMapPositionalRepresentation Xy An XY-coordinate map position for a visualization, defined by latitude/Y and longitude/X field references. * `latitudeOrY` (_sfdc.unified.analytics.connect.api.output.MapFieldReferenceRepresentation_) * `longitudeOrX` (_sfdc.unified.analytics.connect.api.output.MapFieldReferenceRepresentation_) * `type` (_string_, required) The shape of `positional` when `type` is `Xy`. Allowed values: `Xy`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingAverageRepresentation MovingAverage A moving-average quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `MovingAverage`. Allowed values: `MovingAverage`. * `nextValues` (_integer_) Next values of field quick table calc. * `previousValues` (_integer_) Previous values of field quick table calc. * `useCurrentValue` (_boolean_) Use current value of field quick table calc. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingMaxRepresentation MovingMax A moving-max quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `MovingMax`. Allowed values: `MovingMax`. * `nextValues` (_integer_) Next values of field quick table calc. * `previousValues` (_integer_) Previous values of field quick table calc. * `useCurrentValue` (_boolean_) Use current value of field quick table calc. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingMinRepresentation MovingMin A moving-min quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `MovingMin`. Allowed values: `MovingMin`. * `nextValues` (_integer_) Next values of field quick table calc. * `previousValues` (_integer_) Previous values of field quick table calc. * `useCurrentValue` (_boolean_) Use current value of field quick table calc. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingSumRepresentation MovingSum A moving-sum quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `MovingSum`. Allowed values: `MovingSum`. * `nextValues` (_integer_) Next values of field quick table calc. * `previousValues` (_integer_) Previous values of field quick table calc. * `useCurrentValue` (_boolean_) Use current value of field quick table calc. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcPercentileRepresentation Percentile A percentile quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `Percentile`. Allowed values: `Percentile`. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankDenseRepresentation RankDense A dense-rank quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `RankDense`. Allowed values: `RankDense`. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankModifiedRepresentation RankModified A modified-rank quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `RankModified`. Allowed values: `RankModified`. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankRepresentation Rank A rank quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `Rank`. Allowed values: `Rank`. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankUniqueRepresentation RankUnique A unique-rank quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `RankUnique`. Allowed values: `RankUnique`. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcDifferenceRepresentation Difference A difference quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `Difference`. Allowed values: `Difference`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcPercentDifferenceRepresentation PercentDifference A percent-difference quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `PercentDifference`. Allowed values: `PercentDifference`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcPercentOfTotalRepresentation PercentOfTotal A percent-of-total quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `PercentOfTotal`. Allowed values: `PercentOfTotal`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningAvgRepresentation RunningAvg A running-average quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `RunningAvg`. Allowed values: `RunningAvg`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningMaxRepresentation RunningMax A running-max quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `RunningMax`. Allowed values: `RunningMax`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningMinRepresentation RunningMin A running-min quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `RunningMin`. Allowed values: `RunningMin`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningSumRepresentation RunningSum A running-sum quick table calculation for a visualization field. * `type` (_string_, required) The shape of this object when `type` is `RunningSum`. Allowed values: `RunningSum`. ### sfdc.unified.analytics.connect.api.output.actions.FilterActionParametersRepresentation Filter The parameters for a filter action, including the filter to apply and its source field and object. * `filter` (_sfdc.unified.analytics.connect.api.output.actions.FilterActionFilterRepresentation_) * `sourceFieldAPIName` (_string_) Source field API name * `sourceObjectAPIName` (_string_) Source object API name ### sfdc.unified.analytics.connect.api.output.actions.FlowActionParametersRepresentation Flow The parameters for a flow action, including the flow to run, its attributes, and whether to show a dialog. * `attributes` (_object_) Attributes of flow action parameters. Additional properties: `sfdc.unified.analytics.connect.api.output.actions.FlowActionParameterAttributesRepresentation`. * `flowName` (_string_) Flow name. * `showDialog` (_boolean_) Show dialog. ### sfdc.unified.analytics.connect.api.output.actions.NavigateActionParametersRepresentation Navigate The parameters for a navigation action, including the destination, an optional field and label, and whether to carry over the current dashboard filters and parameters. * `destination` (_sfdc.unified.analytics.connect.api.output.actions.BaseNavigateActionDestinationRepresentation_) * `field` (_string_) Field * `includeState` (_boolean_) Whether to include current dashboard state (filters and parameters) during navigation * `label` (_string_) Label ### sfdc.unified.analytics.connect.api.output.actions.ParameterActionParametersRepresentation Parameter The parameters for a parameter action, including the value to set and its source field and object. * `parameter` (_any_) Parameter value * `sourceFieldAPIName` (_string_) Source field API name * `sourceObjectAPIName` (_string_) Source object API name ### sfdc.unified.analytics.connect.api.output.actions.RecordActionParametersRepresentation Record The parameters for a record action, including the record ID, the field to act on, and the Salesforce actions to trigger. * `actions` (_array of sfdc.unified.analytics.connect.api.output.actions.RecordActionInfoRepresentation_) List of salesforce actions. * `field` (_sfdc.unified.analytics.connect.api.output.actions.RecordActionFieldRepresentation_) * `recordId` (_sfdc.unified.analytics.connect.api.output.actions.RecordActionFieldRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationFilterRepresentation A visualization filter. * `fieldKey` (_string_) The field key for the filter. * `fieldKeys` (_array of string_) The list of field keys for the filter. * `filter` (_sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterRepresentation_) * `filterInfos` (_array of sfdc.unified.analytics.connect.api.output.BaseVisualizationFilterInfoRepresentation_) The filters information for the visualization. * `includeAllValues` (_boolean_) Specifies whether to include all values when the filter has no selections (`true`) or not (`false`). * `isContext` (_boolean_) Specifies whether the filter is a context filter (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationFilterGroupRepresentation A group of visualization filters combined with filter logic. * `filterLogic` (_string_) The filter logic expression (e.g. "1 AND 2" or "1 OR 2"). * `filters` (_array of sfdc.unified.analytics.connect.api.output.VisualizationFilterRepresentation_) The list of filters in this group. ### sfdc.unified.analytics.connect.api.output.VisualizationTotalsRepresentation A grand-totals configuration for a visualization table. * `columns` (_boolean_) Specifies whether to show grand totals for columns (`true`) or not (`false`). * `rows` (_boolean_) Specifies whether to show grand totals for rows (`true`) or not (`false`). ### sfdc.unified.analytics.connect.api.output.VisualizationSortOrdersRepresentation A sort-order configuration for a visualization. * `columns` (_array of sfdc.unified.analytics.connect.api.output.VisualizationByFieldSortRepresentation_) The column sort information for the table. * `fields` (_object_) Indicates the field level sorts. Additional properties: `sfdc.unified.analytics.connect.api.output.BaseVisualizationSortRepresentation`. * `rows` (_array of sfdc.unified.analytics.connect.api.output.VisualizationByFieldSortRepresentation_) The row sort information for the table. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationSortRepresentation A sort for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationAlphabeticSortRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSortRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationNestedSortRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationViewSpecStyleRepresentation A style configuration for headers in a visualization view. * `headers` (_sfdc.unified.analytics.connect.api.output.VisualizationViewSpecHeadersStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationFlowMarksRepresentation Flow layout specific output representation for marks in visualization. * `fields` (_object_) The mark specifications per field. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation`. * `links` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation_) * `nodes` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationFlowStyleRepresentation Flow A style for a flow-layout visualization. * `encodings` (_sfdc.unified.analytics.connect.api.output.VisualizationEncodingStylesRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationFlowFieldLabelsStyleRepresentation_) * `fonts` (_sfdc.unified.analytics.connect.api.output.VisualizationFontStyleRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.output.VisualizationLineStyleRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationFlowMarkStylesRepresentation_) * `shading` (_sfdc.unified.analytics.connect.api.output.VisualizationShadingStyleRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.output.VisualizationTitleStyleRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.output.VisualizationTooltipStyleRepresentation_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLayoutType The type of layout in a visualization's visual specification. Type: `string`. Allowed values: `Flow`, `Map`, `Radial`, `Table`, `Vizql`. ### sfdc.unified.analytics.connect.api.output.VisualizationLegendRepresentation Representation for legends in visualization. * `isVisible` (_boolean_) Whether the legend is visible. * `position` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLegendPositionType_) * `title` (_sfdc.unified.analytics.connect.api.output.VisualizationLegendTitleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationStyleSheetRepresentation Output representation for a visualization stylesheet. * `rules` (_array of sfdc.unified.analytics.connect.api.output.VisualizationStyleRuleRepresentation_) Ordered list of style rules. ### sfdc.unified.analytics.connect.api.output.VisualizationMapMarksRepresentation Map layout specific output representation for marks in visualization. * `fields` (_object_) The mark specifications per field. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation`. * `panes` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationMapStyleRepresentation Map A style for a map-layout visualization. * `background` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationBackgroundRepresentation_) * `encodings` (_sfdc.unified.analytics.connect.api.output.VisualizationEncodingStylesRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsStyleRepresentation_) * `fonts` (_sfdc.unified.analytics.connect.api.output.VisualizationFontStyleRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.output.VisualizationLineStyleRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationMapMarkStylesRepresentation_) * `shading` (_sfdc.unified.analytics.connect.api.output.VisualizationShadingStyleRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.output.VisualizationTitleStyleRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.output.VisualizationTooltipStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationRadialMarksRepresentation Radial layout specific output representation for marks in visualization. * `panes` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationRadialStyleRepresentation Radial A style for a radial-layout visualization. * `axis` (_sfdc.unified.analytics.connect.api.output.VisualizationAxisStylesRepresentation_) * `ban` (_sfdc.unified.analytics.connect.api.output.VisualizationBanStyleRepresentation_) * `encodings` (_sfdc.unified.analytics.connect.api.output.VisualizationEncodingStylesRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationRadialFieldLabelsStyleRepresentation_) * `fonts` (_sfdc.unified.analytics.connect.api.output.VisualizationFontStyleRepresentation_) * `headers` (_sfdc.unified.analytics.connect.api.output.VisualizationRadialHeadersStyleRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.output.VisualizationLineStyleRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationRadialMarkStylesRepresentation_) * `shading` (_sfdc.unified.analytics.connect.api.output.VisualizationShadingStyleRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.output.VisualizationTitleStyleRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.output.VisualizationTooltipStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationMarksRepresentation Output representation for marks in visualization. * `fields` (_object_) The mark specifications per field. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation`. * `headers` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderMarkSpecificationRepresentation_) * `panes` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationTableStyleRepresentation Table A style for a table-layout visualization. * `encodings` (_sfdc.unified.analytics.connect.api.output.VisualizationEncodingStylesRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationTableFieldLabelsStyleRepresentation_) * `fit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTableStyleFitType_) * `fonts` (_sfdc.unified.analytics.connect.api.output.VisualizationFontStyleRepresentation_) * `grandTotals` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsStyleRepresentation_) * `headers` (_sfdc.unified.analytics.connect.api.output.VisualizationTableHeaderStyleRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.output.VisualizationLineStyleRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStylesRepresentation_) * `shading` (_sfdc.unified.analytics.connect.api.output.VisualizationShadingStyleRepresentation_) * `subtotals` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsStyleRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.output.VisualizationTitleStyleRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.output.VisualizationTooltipStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationForecastModelRepresentation A forecast model for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationHoltWintersForecastRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationRidgeRegressionForecastRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationMarkRepresentation Representation for marks in visualization. * `encodings` (_array of sfdc.unified.analytics.connect.api.output.VisualizationMarkEncodingRepresentation_) The encoding properties of the mark. * `isAutomatic` (_boolean_) Whether the mark stack should be applied by default. * `stack` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStackRepresentation_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkType_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineRepresentation A reference line for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationReferenceBandRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationStyleRepresentation Output representation for legacy visual spec style in a visualization. * `allHeaders` (_sfdc.unified.analytics.connect.api.output.VisualizationAllHeadersStyleRepresentation_) * `axis` (_object_) The axis style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationAxisStyleRepresentation`. * `fieldLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsStyleRepresentation_) * `fit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleFitType_) * `fonts` (_sfdc.unified.analytics.connect.api.output.VisualizationFontStyleRepresentation_) * `grandTotals` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsStyleRepresentation_) * `headers` (_object_) The header style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationHeaderStyleRepresentation`. * `lines` (_sfdc.unified.analytics.connect.api.output.VisualizationLineStyleRepresentation_) * `marks` (_object_) The mark style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation`. * `panes` (_object_) The pane style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationPaneStyleRepresentation`. * `referenceLines` (_object_) The reference line style for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineStyleRepresentation`. * `shading` (_sfdc.unified.analytics.connect.api.output.VisualizationShadingStyleRepresentation_) * `showDataPlaceholder` (_boolean_) If the data placeholder column or cell should be visible. * `title` (_sfdc.unified.analytics.connect.api.output.VisualizationTitleStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationVizqlStyleRepresentation Vizql A set of style settings for a VizQL visualization, covering its axis, fonts, headers, shading, and titles. * `axis` (_sfdc.unified.analytics.connect.api.output.VisualizationAxisStylesRepresentation_) * `encodings` (_sfdc.unified.analytics.connect.api.output.VisualizationEncodingStylesRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsStyleRepresentation_) * `fit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationVizqlStyleFitType_) * `fonts` (_sfdc.unified.analytics.connect.api.output.VisualizationFontStyleRepresentation_) * `grandTotals` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsStyleRepresentation_) * `headers` (_sfdc.unified.analytics.connect.api.output.VisualizationAllHeadersStyleRepresentation_) * `lines` (_sfdc.unified.analytics.connect.api.output.VisualizationLineStyleRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStylesRepresentation_) * `referenceLines` (_object_) The reference line styles for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineStyleRepresentation`. * `shading` (_sfdc.unified.analytics.connect.api.output.VisualizationShadingStyleRepresentation_) * `showDataPlaceholder` (_boolean_) Whether to show data placeholder. * `subtotals` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsStyleRepresentation_) * `title` (_sfdc.unified.analytics.connect.api.output.VisualizationTitleStyleRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.output.VisualizationTooltipStyleRepresentation_) ### sfdc.semantic.authoring.connect.api.output.SemanticModelOutputRepresentation ### sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetStylesInputRepresentation ButtonWidget A set of style settings for a button widget in a Tableau Next dashboard, including its font color and text style. * `fontColor` (_string_) Button text color value * `textStyle` (_array of string_) Button text style value * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetIconInputRepresentation Button widget icon symbol input representation in unified analytics * `name` (_string_) Button icon name * `position` (_string_) Button icon position ### sfdc.unified.analytics.connect.api.enums.ConnectAnalyticsDynamicTokenTypeEnum The type of dynamic token. Type: `string`. Allowed values: `Insights`, `Metric`, `Query`, `Reference`. ### sfdc.unified.analytics.connect.api.input.widgets.container.ContainerWidgetStylesInputRepresentation ContainerWidget A set of style settings for a container widget in a Tableau Next dashboard, including its background. * `background` (_sfdc.unified.analytics.connect.api.input.common.BackgroundParametersInputRepresentation_) * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.input.widgets.filter.ListCardFilterWidgetParametersInputRepresentation ListCard Parameters for a filter widget displayed as a list card, including its filter option, label visibility, and title, value, and widget styles. * `filterOption` (_sfdc.unified.analytics.connect.api.input.widgets.filter.FilterOptionInputRepresentation_) * `isLabelHidden` (_boolean_) Show or hide filter widget label. * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveFilterSourceInputRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.input.widgets.filter.ListFilterWidgetTextStyleInputRepresentation_) * `valueStyle` (_sfdc.unified.analytics.connect.api.input.widgets.filter.ListFilterWidgetTextStyleInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.filter.FilterWidgetStylesInputRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.filter.ListFilterWidgetParametersInputRepresentation List Parameters for a filter widget displayed as a list, including its filter option, label visibility, and title, value, and widget styles. * `filterOption` (_sfdc.unified.analytics.connect.api.input.widgets.filter.FilterOptionInputRepresentation_) * `isLabelHidden` (_boolean_) Show or hide filter widget label. * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveFilterSourceInputRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.input.widgets.filter.ListFilterWidgetTextStyleInputRepresentation_) * `valueStyle` (_sfdc.unified.analytics.connect.api.input.widgets.filter.ListFilterWidgetTextStyleInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.filter.FilterWidgetStylesInputRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.filter.ToggleFilterWidgetParametersInputRepresentation Toggle Parameters for a filter widget displayed as a toggle, including its filter option, default style, selected style, text style, and widget style. * `defaultStyle` (_sfdc.unified.analytics.connect.api.input.widgets.ToggleDefaultStyleInputRepresentation_) * `filterOption` (_sfdc.unified.analytics.connect.api.input.widgets.filter.FilterOptionInputRepresentation_) * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveFilterSourceInputRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `selectedStyle` (_sfdc.unified.analytics.connect.api.input.widgets.ToggleSelectedStyleInputRepresentation_) * `textStyle` (_sfdc.unified.analytics.connect.api.input.widgets.ToggleTextStyleInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.filter.FilterWidgetStylesInputRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.image.ImageStylesInputRepresentation Image A set of style settings for an image widget in a Tableau Next dashboard. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.input.widgets.metric.MetricOptionInputRepresentation Metric option details inside metric widget parameters input representation * `layout` (_object_) Metric layout option Additional properties: `object`. * `metricCardVersion` (_integer_) Metric-card experience version captured for this widget (0 = legacy card, >= 1 = redesigned card). Snapshotted when the widget adopts the latest experience. * `sdmApiName` (_string_) SDM API name * `sdmId` (_string_) SDM Id * `showForecast` (_boolean_) Whether to show forecast on the metric widget ### sfdc.unified.analytics.connect.api.input.ReceiveFilterSourceInputRepresentation Receive Filter Source Input Representation in unified analytics * `filterMode` (_sfdc.unified.analytics.connect.api.enums.ConnectReceiveFilterModeEnum_) * `publishers` (_array of sfdc.unified.analytics.connect.api.input.FilterPublisherInputRepresentation_) The list of publishers for this subscriber * `widgetIds` (_array of string_) Widgets Parameter value ### sfdc.unified.analytics.connect.api.input.widgets.metric.MetricWidgetStylesInputRepresentation MetricWidget A set of style settings for a metric widget in a Tableau Next dashboard, including its text color. * `textColor` (_string_) Text color of all metric widget elements * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationWidgetLabelStyleInputRepresentation NavigationWidgetLabelStyle A label style for a navigation widget, including its alignment and font size. * `alignmentX` (_string_) Horizontal alignment * `alignmentY` (_string_) Vertical alignment * `fontSize` (_integer_) Font size * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationItemInputRepresentation NavigationItem A navigation item for a navigation widget, including its visibility, order, and target. * `hidden` (_boolean_) Whether the item is hidden * `order` (_integer_) Explicit position in navigation order * `target` (_string_) Target identifier * `type` (_string_) Type of navigation item * `description` (_string_) The description. * `label` (_string_) The master label. * `name` (_string_) The unique developer name. ### sfdc.unified.analytics.connect.api.input.widgets.parameter.InputCardParameterWidgetParametersInputRepresentation InputCard A set of configuration parameters for an input-card parameter widget in a Tableau Next dashboard, including its parameter name, value source, and label visibility. * `isLabelHidden` (_boolean_) Show or hide parameter widget label. * `parameterName` (_string_) Parameter Name * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.InputParameterWidgetTextStyleInputRepresentation_) * `valueSource` (_any_) Source for values used in input, it can be used for eg: autocomplete * `valueStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.InputParameterWidgetTextStyleInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterWidgetStylesInputRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterOptionInputRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.parameter.InputParameterWidgetParametersInputRepresentation Input A set of configuration parameters for an input parameter widget in a Tableau Next dashboard, including its parameter name, value source, and label visibility. * `isLabelHidden` (_boolean_) Show or hide parameter widget label. * `parameterName` (_string_) Parameter Name * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.InputParameterWidgetTextStyleInputRepresentation_) * `valueSource` (_any_) Source for values used in input, it can be used for eg: autocomplete * `valueStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.InputParameterWidgetTextStyleInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterWidgetStylesInputRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterOptionInputRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.parameter.ListCardParameterWidgetParametersInputRepresentation ListCard A set of configuration parameters for a list-card parameter widget in a Tableau Next dashboard, used when the view type is list card. * `isLabelHidden` (_boolean_) Show or hide parameter widget label. * `parameterName` (_string_) Parameter Name * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ListParameterWidgetTextStyleInputRepresentation_) * `valueStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ListParameterWidgetTextStyleInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterWidgetStylesInputRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterOptionInputRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.parameter.ListParameterWidgetParametersInputRepresentation List A set of configuration parameters for a list parameter widget in a Tableau Next dashboard, including its parameter name and label visibility. * `isLabelHidden` (_boolean_) Show or hide parameter widget label. * `parameterName` (_string_) Parameter Name * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ListParameterWidgetTextStyleInputRepresentation_) * `valueStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ListParameterWidgetTextStyleInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterWidgetStylesInputRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterOptionInputRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.parameter.ToggleParameterWidgetParametersInputRepresentation Toggle A set of configuration parameters for a toggle parameter widget in a Tableau Next dashboard, used when the view type is toggle. * `defaultStyle` (_sfdc.unified.analytics.connect.api.input.widgets.ToggleDefaultStyleInputRepresentation_) * `parameterName` (_string_) Parameter Name * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation_) * `selectedStyle` (_sfdc.unified.analytics.connect.api.input.widgets.ToggleSelectedStyleInputRepresentation_) * `textStyle` (_sfdc.unified.analytics.connect.api.input.widgets.ToggleTextStyleInputRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterWidgetStylesInputRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterOptionInputRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.enums.WidgetSummaryTypeEnum Different summary types of a Summary Widget. _Available April 2026 and later._ Type: `string`. Allowed values: `InsightSummary`. ### sfdc.unified.analytics.connect.api.input.widgets.summary.SummaryWidgetStylesInputRepresentation SummaryWidget A set of style settings for a summary widget in a Tableau Next dashboard. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.input.widgets.text.ConditionalFormattingRuleInputRepresentation Measure and dimension conditional formatting rule input representation for text widgets _Available April 2026 and later._ * `buckets` (_array of sfdc.unified.analytics.connect.api.input.widgets.text.ConditionalFormattingBucketInputRepresentation_) Array of buckets defining conditions and their corresponding styles * `formatBasedOn` (_string_) Token ID representing the value that content will be formatted based on * `formattingType` (_sfdc.unified.analytics.connect.api.enums.FormattingTypeEnum_) * `name` (_string_) Unique conditional formatting rule name that doesn't conflict with any other rules in the widget ### sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetContentParameterInputRepresentation Text widget parameters definition input representation in unified analytics _Updated April 2026: added `rules`._ * `attributes` (_sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetContentAttributeInputRepresentation_) * `insert` (_any_) Inserted text or token object in text widget * `rules` (_array of string_) List of CF rule names set for this content block _Available April 2026 and later._ ### sfdc.unified.analytics.connect.api.input.ReceiveParameterSourceInputRepresentation Receive Parameter Source Input Representation in unified analytics * `parameterMode` (_sfdc.unified.analytics.connect.api.enums.ConnectReceiveFilterModeEnum_) * `publishers` (_array of sfdc.unified.analytics.connect.api.input.ParameterPublisherInputRepresentation_) The list of parameter publishers for this subscriber ### sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetStylesInputRepresentation TextWidget A set of style settings for a text widget in a Tableau Next dashboard. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationLegendPositionType The position type of the legend. Type: `string`. Allowed values: `Bottom`, `Left`, `Right`, `Top`. ### sfdc.unified.analytics.connect.api.input.widgets.visualization.VisualizationStylesInputRepresentation Visualization A set of style settings for a visualization widget in a Tableau Next dashboard, including its header background color, axis line color, and text color. * `headerBackgroundColor` (_string_) Header background color of visualization widget field labels * `lineColor` (_string_) Line color of visualization widget axis lines * `textColor` (_string_) Text color of all visualization widget elements * `textSize` (_integer_) Text size of visualization widget * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetStylesRepresentation Button A set of style settings for a button widget in a Tableau Next dashboard, including its font color and text style. * `fontColor` (_string_) Font color of button * `textStyle` (_array of string_) Text style of button * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetIconRepresentation Representation of a buttonWidgetIcon. * `name` (_string_) Icon name of button * `position` (_string_) Icon position of button ### sfdc.unified.analytics.connect.api.output.widgets.container.ContainerWidgetStylesRepresentation Container A set of style settings for a container widget in a Tableau Next dashboard, including its background. * `background` (_sfdc.unified.analytics.connect.api.output.common.BackgroundParametersRepresentation_) * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.filter.FilterDetailsRepresentation Filter details output representation. _Available April 2026 and later._ * `fieldName` (_string_) Filter field name. * `operator` (_sfdc.unified.analytics.connect.api.enums.FilterOperatorType_) * `values` (_any_) Filter values. ### sfdc.unified.analytics.connect.api.output.widgets.filter.ListCardFilterWidgetParametersRepresentation ListCard Parameters for a filter widget displayed as a list card, including its filter option, label visibility, and title, value, and widget styles. * `filterOption` (_sfdc.unified.analytics.connect.api.output.widgets.filter.FilterOptionRepresentation_) * `isLabelHidden` (_boolean_) property that shows or hides the label on a filter widget * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveFilterSourceRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.output.widgets.filter.ListFilterWidgetTextStyleRepresentation_) * `valueStyle` (_sfdc.unified.analytics.connect.api.output.widgets.filter.ListFilterWidgetTextStyleRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.filter.FilterWidgetStylesRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.filter.ListFilterWidgetParametersRepresentation List Parameters for a filter widget displayed as a list, including its filter option, label visibility, and title, value, and widget styles. * `filterOption` (_sfdc.unified.analytics.connect.api.output.widgets.filter.FilterOptionRepresentation_) * `isLabelHidden` (_boolean_) property that shows or hides the label on a filter widget * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveFilterSourceRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.output.widgets.filter.ListFilterWidgetTextStyleRepresentation_) * `valueStyle` (_sfdc.unified.analytics.connect.api.output.widgets.filter.ListFilterWidgetTextStyleRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.filter.FilterWidgetStylesRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.filter.ToggleFilterWidgetParametersRepresentation Toggle Parameters for a filter widget displayed as a toggle, including its filter option, default style, selected style, text style, and widget style. * `defaultStyle` (_sfdc.unified.analytics.connect.api.output.widgets.ToggleDefaultStyleRepresentation_) * `filterOption` (_sfdc.unified.analytics.connect.api.output.widgets.filter.FilterOptionRepresentation_) * `receiveFilterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveFilterSourceRepresentation_) * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `selectedStyle` (_sfdc.unified.analytics.connect.api.output.widgets.ToggleSelectedStyleRepresentation_) * `textStyle` (_sfdc.unified.analytics.connect.api.output.widgets.ToggleTextStyleRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.filter.FilterWidgetStylesRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.image.ImageWidgetStylesRepresentation Image A set of style settings for an image widget in a Tableau Next dashboard. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.metric.MetricOptionRepresentation Representation of a metricOption. * `layout` (_object_) Layout Additional properties: `object`. * `metricCardVersion` (_integer_) Metric-card experience version captured for this widget (0 = legacy card, >= 1 = redesigned card). * `sdmApiName` (_string_) SDM API name * `sdmId` (_string_) SDM Id * `showForecast` (_boolean_) Whether to show forecast on the metric widget ### sfdc.unified.analytics.connect.api.output.ReceiveFilterSourceRepresentation Representation for the Receive Filter Source * `filterMode` (_sfdc.unified.analytics.connect.api.enums.ConnectReceiveFilterModeEnum_) * `publishers` (_array of sfdc.unified.analytics.connect.api.output.FilterPublisherRepresentation_) The list of filter publishers for the receive filter source * `widgetIds` (_array of string_) The list of widgets to be filtered (or ignored) based on the filterMode. If the filterMode is 'Exclude' ### sfdc.unified.analytics.connect.api.output.widgets.metric.MetricWidgetStylesRepresentation Metric A set of style settings for a metric widget in a Tableau Next dashboard, including its text color. * `textColor` (_string_) Text color of all metric widget elements * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationWidgetLabelStyleRepresentation NavigationWidgetLabelStyle A label style for a navigation widget, including its alignment and font size. * `alignmentX` (_string_) Horizontal alignment * `alignmentY` (_string_) Vertical alignment * `fontSize` (_integer_) Font size * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationItemRepresentation NavigationItem A navigation item for a navigation widget, including its visibility, order, and target. * `hidden` (_boolean_) Whether the item is hidden from navigation * `order` (_integer_) Explicit position in navigation order * `target` (_string_) Target identifier * `type` (_string_) Type of navigation item * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.widgets.parameter.InputCardParameterWidgetParametersRepresentation InputCard A set of configuration parameters for an input-card parameter widget in a Tableau Next dashboard, including its parameter name, value source, and label visibility. * `isLabelHidden` (_boolean_) property that shows or hides the label on a parameter widget * `parameterName` (_string_) parameter name parameter value for the parameter widget * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.InputParameterWidgetTextStyleRepresentation_) * `valueSource` (_any_) Source for values used in input, it can be used for eg: autocomplete * `valueStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.InputParameterWidgetTextStyleRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterWidgetStylesRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterOptionRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.parameter.InputParameterWidgetParametersRepresentation Input A set of configuration parameters for an input parameter widget in a Tableau Next dashboard, including its parameter name, value source, and label visibility. * `isLabelHidden` (_boolean_) property that shows or hides the label on a parameter widget * `parameterName` (_string_) parameter name parameter value for the parameter widget * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.InputParameterWidgetTextStyleRepresentation_) * `valueSource` (_any_) Source for values used in input, it can be used for eg: autocomplete * `valueStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.InputParameterWidgetTextStyleRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterWidgetStylesRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterOptionRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.parameter.ListCardParameterWidgetParametersRepresentation ListCard A set of configuration parameters for a list-card parameter widget in a Tableau Next dashboard, including its parameter name and label visibility. * `isLabelHidden` (_boolean_) property that shows or hides the label on a parameter widget * `parameterName` (_string_) parameter name parameter value for the parameter widget * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ListParameterWidgetTextStyleRepresentation_) * `valueStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ListParameterWidgetTextStyleRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterWidgetStylesRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterOptionRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.parameter.ListParameterWidgetParametersRepresentation List A set of configuration parameters for a list parameter widget in a Tableau Next dashboard, including its parameter name and label visibility. * `isLabelHidden` (_boolean_) property that shows or hides the label on a parameter widget * `parameterName` (_string_) parameter name parameter value for the parameter widget * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `titleStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ListParameterWidgetTextStyleRepresentation_) * `valueStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ListParameterWidgetTextStyleRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterWidgetStylesRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterOptionRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.parameter.ToggleParameterWidgetParametersRepresentation Toggle A set of configuration parameters for a toggle parameter widget in a Tableau Next dashboard, used when the view type is toggle. * `defaultStyle` (_sfdc.unified.analytics.connect.api.output.widgets.ToggleDefaultStyleRepresentation_) * `parameterName` (_string_) Parameter name * `receiveParameterSource` (_sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation_) * `selectedStyle` (_sfdc.unified.analytics.connect.api.output.widgets.ToggleSelectedStyleRepresentation_) * `textStyle` (_sfdc.unified.analytics.connect.api.output.widgets.ToggleTextStyleRepresentation_) * `widgetStyle` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterWidgetStylesRepresentation_) * `parameterOption` (_sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterOptionRepresentation_) * `viewType` (_sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.summary.SummaryWidgetStylesRepresentation Summary A set of style settings for a summary widget in a Tableau Next dashboard. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.text.ConditionalFormattingRuleRepresentation Represents a measure and dimension conditional formatting rule for text widgets _Available April 2026 and later._ * `buckets` (_array of sfdc.unified.analytics.connect.api.output.widgets.text.ConditionalFormattingBucketRepresentation_) Array of buckets defining conditions and their corresponding styles * `formatBasedOn` (_string_) Token ID representing the value that content will be formatted based on * `formattingType` (_sfdc.unified.analytics.connect.api.enums.FormattingTypeEnum_) * `name` (_string_) Unique conditional formatting rule name that doesn't conflict with any other rules in the widget ### sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetContentParameterRepresentation Represents text widget parameter content representation in unified analytics _Updated April 2026: added `rules`._ * `attributes` (_sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetContentAttributeRepresentation_) * `insert` (_any_) Inserted text or token object in text widget * `rules` (_array of string_) List of CF rule names set for this content block _Available April 2026 and later._ ### sfdc.unified.analytics.connect.api.output.ReceiveParameterSourceRepresentation Representation for the Receive Parameter Source * `parameterMode` (_sfdc.unified.analytics.connect.api.enums.ConnectReceiveFilterModeEnum_) * `publishers` (_array of sfdc.unified.analytics.connect.api.output.ParameterPublisherRepresentation_) The list of parameter publishers for this subscriber ### sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetStylesRepresentation Text A set of style settings for a text widget in a Tableau Next dashboard. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.visualization.VisualizationWidgetStylesRepresentation Visualization A set of style settings for a visualization widget in a Tableau Next dashboard, including its header background color, axis line color, and text color. * `headerBackgroundColor` (_string_) Header background color of visualization widget field labels * `lineColor` (_string_) Line color of visualization widget axis lines * `textColor` (_string_) Text color of all visualization widget elements * `textSize` (_integer_) Text size of visualization widget * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.enums.FilterOperatorType The kind of operator applied on filters in the view. Type: `string`. Allowed values: `Between`, `Contains`, `ContainsIgnoreCase`, `CurrentFiscalQuarter`, `CurrentFiscalQuarterToDate`, `CurrentFiscalYear`, `CurrentFiscalYearToDate`, `CurrentMonth`, `CurrentMonthToDate`, `CurrentQuarter`, `CurrentQuarterToDate`, `CurrentWeek`, `CurrentYear`, `CurrentYearToDate`, `DoesNotEndWith`, `DoesNotEndWithIgnoreCase`, `DoesNotEquals`, `DoesNotEqualsIgnoreCase`, `DoesNotStartWith`, `DoesNotStartWithIgnoreCase`, `EndsWidth`, `EndsWithIgnoreCase`, `Equals`, `EqualsIgnoreCase`, `GreaterThan`, `GreaterThanOrEqualTo`, `In`, `IsEmpty`, `IsNotEmpty`, `IsNotNull`, `IsNull`, `LastNDays`, `LastNHours`, `LessThan`, `LessThanOrEqualTo`, `NextFiscalQuarter`, `NextFiscalYear`, `NextMonth`, `NextNDays`, `NextQuarter`, `NextWeek`, `NextYear`, `NotContains`, `NotContainsIgnoreCase`, `NotIn`, `NotInValues`, `PreviousFiscalQuarter`, `PreviousFiscalQuarterToDate`, `PreviousFiscalYear`, `PreviousFiscalYearToDate`, `PreviousMonth`, `PreviousMonthToDate`, `PreviousQuarter`, `PreviousQuarterToDate`, `PreviousWeek`, `PreviousYear`, `PreviousYearToDate`, `StartsWith`, `StartsWithIgnoreCase`, `Tomorrow`, `Values`, `Yesterday`. ### sfdc.unified.analytics.connect.api.output.MarkSelectionHeaderRepresentation A header entry for a custom view mark selection — captures a single selected dimension/measure value plus any partitioning context. * `fieldId` (_sfdc.unified.analytics.connect.api.output.MarkSelectionFieldRepresentation_) * `partitionFieldIds` (_array of sfdc.unified.analytics.connect.api.output.MarkSelectionFieldRepresentation_) The field IDs that partition this header's selection scope. * `partitionValues` (_array of any_) The values of the partitioning fields aligned by index with partitionFieldIds. * `value` (_any_) The selected value for the field (string, number, or boolean). ### sfdc.unified.analytics.connect.api.output.MarkSelectionRepresentation An individual mark representation with field information and values. * `fieldIds` (_array of sfdc.unified.analytics.connect.api.output.MarkSelectionFieldRepresentation_) The array of field IDs with metadata. * `values` (_array of any_) The array of values corresponding to the field selections. ### sfdc.unified.analytics.connect.api.input.MapFieldReferenceInputRepresentation Map field reference input representation. * `fieldName` (_string_) The field name. * `objectName` (_string_) The object name. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldQuickTableCalcType The type of quick table calculation for a visualization field. Type: `string`. Allowed values: `Difference`, `MovingAverage`, `MovingMax`, `MovingMin`, `MovingSum`, `PercentDifference`, `PercentOfTotal`, `Percentile`, `Rank`, `RankDense`, `RankModified`, `RankUnique`, `RunningAvg`, `RunningMax`, `RunningMin`, `RunningSum`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType The sort order in a visualization's view specification. Type: `string`. Allowed values: `Ascending`, `Descending`. ### sfdc.unified.analytics.connect.api.input.actions.FilterActionFilterInputRepresentation Filter value input representation for filter actions in unified analytics * `tokenName` (_string_) Token name for the filter ### sfdc.unified.analytics.connect.api.input.actions.FlowActionParameterAttributesInputRepresentation Flow action parameters attribute input representation in unified analytics * `inputData` (_sfdc.unified.analytics.connect.api.input.actions.BaseFlowActionAttributeDataInputRepresentation_) * `inputDataType` (_string_) Data type of the flow input attribute. ### sfdc.unified.analytics.connect.api.input.actions.BaseNavigateActionDestinationInputRepresentation Navigate action destination representation in unified analytics One of: `sfdc.unified.analytics.connect.api.input.actions.DashboardNavigateActionDestinationInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.MetricDetailsNavigateActionDestinationInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.PageNavigateActionDestinationInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.UrlNavigateActionDestinationInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.actions.RecordActionInfoInputRepresentation Representation of types of action to run on a record. * `apiName` (_string_) Name of the action. ### sfdc.unified.analytics.connect.api.input.actions.RecordActionFieldInputRepresentation Representation of a field for an action. * `fieldKey` (_string_) Fieldkey of the field. ### sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterInputRepresentation A unified filter. * `fields` (_array of sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterFieldInputRepresentation_) The list of fields for the unified filter. * `includeNulls` (_boolean_) Specifies whether null values are included in the filter results: for the In operator, `true` includes null values and `false` leaves the behavior undefined; for the NotIn operator, `false` includes null values and `true` leaves the behavior undefined. * `measureCriteria` (_sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterMeasureCriteriaInputRepresentation_) * `operator` (_sfdc.semantic.authoring.connect.api.enums.SemanticFilterOperatorTypeEnum_) * `topBottomCriteria` (_sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterTopBottomCriteriaInputRepresentation_) * `values` (_array of any_) The values for the unified filter. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationFilterInfoInputRepresentation A filter applied to a visualization, such as a range, relative date, or wildcard filter. One of: `sfdc.unified.analytics.connect.api.input.VisualizationGreaterThanFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationInFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationLessThanFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationNullsFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationRangeFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationRelativeDateFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationTopNFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationWildCardFilterInfoInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationByFieldSortInputRepresentation A sort by field in a table. * `byField` (_string_) The field to apply the sort by. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.input.VisualizationAlphabeticSortInputRepresentation Alphabetic An alphabetic sort for a visualization. * `fieldKey` (_string_) The field key for the sort. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) * `type` (_string_, required) The shape of `fields` when `type` is `Alphabetic`. Allowed values: `Alphabetic`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldSortInputRepresentation Field A sort by field for a visualization. * `fieldKey` (_string_) The field key for the sort. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortType_, required) * `byField` (_string_) The field to apply the sort by. ### sfdc.unified.analytics.connect.api.input.VisualizationNestedSortInputRepresentation Nested A nested sort for a visualization. * `fieldKey` (_string_) The field key for the sort. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortType_, required) * `byField` (_string_) The field to apply the sort by. ### sfdc.unified.analytics.connect.api.input.VisualizationViewSpecHeadersStyleInputRepresentation The style for view headers in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.input.VisualizationViewSpecHeaderColumnsDirectionStyleInputRepresentation_) * `groups` (_sfdc.unified.analytics.connect.api.input.VisualizationViewSpecHeaderGroupsDirectionStyleInputRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.input.VisualizationViewSpecHeaderRowsDirectionStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationEncodingStylesInputRepresentation Input representation for encoding styles in a visualization. * `fields` (_object_) The encoding styles per field. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationPaneStyleInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationFlowFieldLabelsStyleInputRepresentation Input representation for flow field labels style in a visualization. * `levels` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationFontStyleInputRepresentation Input representation for font style in a visualization. * `actionableHeaders` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `axisTickLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `ban` (_sfdc.unified.analytics.connect.api.input.VisualizationFontBanStyleInputRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `grandTotalLabel` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `grandTotalValues` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `headers` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `legendLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `markLabels` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `subtotalLabel` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) * `subtotalValues` (_sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationLineStyleInputRepresentation Input representation for line style in a visualization. * `axisLine` (_sfdc.unified.analytics.connect.api.input.VisualizationLineCommonStyleInputRepresentation_) * `fieldLabelDividerLine` (_sfdc.unified.analytics.connect.api.input.VisualizationLineCommonStyleInputRepresentation_) * `separatorLine` (_sfdc.unified.analytics.connect.api.input.VisualizationLineCommonStyleInputRepresentation_) * `zeroLine` (_sfdc.unified.analytics.connect.api.input.VisualizationLineCommonStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationFlowMarkStylesInputRepresentation Input representation for flow mark styles in a visualization. * `fields` (_object_) The mark styles per field. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation`. * `links` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation_) * `nodes` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationShadingStyleInputRepresentation Input representation for shading style in a visualization. * `backgroundColor` (_string_) The background color for the shading. * `banding` (_sfdc.unified.analytics.connect.api.input.VisualizationBandingStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationTitleStyleInputRepresentation Input representation for title style in a visualization. * `isVisible` (_boolean_) Whether the title of the visualization should be visible. * `titleText` (_string_) The title of the visualization. ### sfdc.unified.analytics.connect.api.input.VisualizationTooltipStyleInputRepresentation Input representation for tooltip styles shared across all tooltip types in a visualization. * `container` (_sfdc.unified.analytics.connect.api.input.VisualizationTooltipContainerStyleInputRepresentation_) * `isVisible` (_boolean_) Whether the tooltip is visible. ### sfdc.unified.analytics.connect.api.input.VisualizationLegendTitleInputRepresentation Input representation for legend title in visualization. * `isVisible` (_boolean_) Whether the legend title is visible. * `titleText` (_string_) The title text for the legend. ### sfdc.unified.analytics.connect.api.input.VisualizationStyleRuleInputRepresentation Input representation for a single stylesheet rule. * `scope` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleScopeInputRepresentation_) * `selector` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStylableElementType_) * `style` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.BaseVisualizationBackgroundInputRepresentation The background of a visualization, either blank, a grid, or a map. One of: `sfdc.unified.analytics.connect.api.input.VisualizationBlankBackgroundInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationGridBackgroundInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationMapBackgroundInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsStyleInputRepresentation Input representation for field labels style in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationMapMarkStylesInputRepresentation Input representation for map mark styles in a visualization. * `fields` (_object_) The mark styles per field. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation`. * `panes` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationAxisStylesInputRepresentation Input representation for axis styles in a visualization. * `fields` (_object_) The axis styles per field. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationAxisStyleInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationBanStyleInputRepresentation Input representation for BAN (big number) style in a visualization. * `fields` (_object_) The BAN style per field, keyed by field key. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationFieldBanStyleInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationRadialFieldLabelsStyleInputRepresentation Input representation for radial field labels style in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) * `rings` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) * `slices` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationRadialHeadersStyleInputRepresentation Input representation for radial headers style in a visualization. * `fields` (_object_) The field header styles for the radial visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationHeaderStyleInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationRadialMarkStylesInputRepresentation Radial layout specific input representation for mark styles in a visualization. * `panes` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderMarkInputRepresentation Input representation for header mark specification in visualization. * `encodings` (_array of sfdc.unified.analytics.connect.api.input.VisualizationHeaderMarkEncodingInputRepresentation_) The encoding properties of the header mark. * `isAutomatic` (_boolean_) Whether this header mark spec was automatically generated. * `stack` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStackInputRepresentation_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationHeaderMarkType_) ### sfdc.unified.analytics.connect.api.input.VisualizationTableFieldLabelsStyleInputRepresentation Input representation for field label style for table layout in visualization. * `columns` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) * `groups` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTableStyleFitType The style fit type of the visualization's table visual specification. Type: `string`. Allowed values: `RowHeadersWidth`, `Standard`. ### sfdc.unified.analytics.connect.api.input.VisualizationTotalsStyleInputRepresentation Input representation for totals style in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsCommonStyleInputRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.input.VisualizationTotalsCommonStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationTableHeaderStyleInputRepresentation Input representation for header styles in table visualization. * `columns` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderColumnsDirectionStyleInputRepresentation_) * `fields` (_object_) The field header styles for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationHeaderStyleInputRepresentation`. * `groups` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderGroupsDirectionStyleInputRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderRowsDirectionStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationMarkStylesInputRepresentation Input representation for mark styles collection in a visualization. * `fields` (_object_) The mark styles per field. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation`. * `headers` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderMarkStyleInputRepresentation_) * `panes` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationHoltWintersForecastInputRepresentation HoltWinters A Holt-Winters forecast model for a visualization. * `confidenceLevel` (_integer_) Specifies the confidence level when bounds are requested. Defaults to 95, and can be customized to 90 or 99. * `dimensionFields` (_array of sfdc.unified.analytics.connect.api.input.VisualizationForecastDimensionFieldInputRepresentation_) The forecast dimension fields. * `fillNullsWithZero` (_boolean_) Replace null values in actual data with zeroes. * `forecastModel` (_string_, required) The shape of `forecasts` when `forecastModel` is `HoltWinters`. Allowed values: `HoltWinters`. * `from` (_sfdc.unified.analytics.connect.api.input.VisualizationForecastFromInputRepresentation_) * `ignoreLastPeriods` (_integer_) Number of periods at the end of the data to ignore. * `includeBounds` (_boolean_) Whether to include bounds (blue shade area) for forecast. * `measureFieldKey` (_string_) The measure field key. * `to` (_sfdc.unified.analytics.connect.api.input.VisualizationForecastToInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationRidgeRegressionForecastInputRepresentation RidgeRegression A ridge-regression forecast model for a visualization. * `confidenceLevel` (_integer_) Specifies the confidence level when bounds are requested. Defaults to 95, and can be customized to 90 or 99. * `dimensionFields` (_array of sfdc.unified.analytics.connect.api.input.VisualizationForecastDimensionFieldInputRepresentation_) The forecast dimension fields. * `fillNullsWithZero` (_boolean_) Replace null values in actual data with zeroes. * `forecastModel` (_string_, required) The shape of `forecasts` when `forecastModel` is `RidgeRegression`. Allowed values: `RidgeRegression`. * `from` (_sfdc.unified.analytics.connect.api.input.VisualizationForecastFromInputRepresentation_) * `ignoreLastPeriods` (_integer_) Number of periods at the end of the data to ignore. * `includeBounds` (_boolean_) Whether to include bounds (blue shade area) for forecast. * `measureFieldKey` (_string_) The measure field key. * `to` (_sfdc.unified.analytics.connect.api.input.VisualizationForecastToInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationMarkEncodingInputRepresentation Input representation for mark encoding in visualization. * `fieldKey` (_string_) The reference to the field to which the mark is applied. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkEncodingType_) ### sfdc.unified.analytics.connect.api.input.VisualizationMarkStackInputRepresentation Input representation for mark stack in visualization. * `isAutomatic` (_boolean_) Whether the mark stack should be applied by default. * `isStacked` (_boolean_) Whether the mark stack should be stacked. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkType The mark type of the visualization's visual specification. Type: `string`. Allowed values: `Area`, `Bar`, `Circle`, `Donut`, `Line`, `Spatial`, `Square`, `Text`. ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceBandInputRepresentation Band A reference band for a visualization. * `endLine` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineInfoInputRepresentation_) * `startLine` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineInfoInputRepresentation_) * `fieldKey` (_string_) The field key of the reference line in the visualization. * `scope` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineScopeType_) * `type` (_string_, required) The shape of `referenceLines` when `type` is `Band`. Allowed values: `Band`. ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineInputRepresentation Line A line-type reference line for a visualization. * `line` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineInfoInputRepresentation_) * `fieldKey` (_string_) The field key of the reference line in the visualization. * `scope` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineScopeType_) * `type` (_string_, required) The shape of `referenceLines` when `type` is `Line`. Allowed values: `Line`. ### sfdc.unified.analytics.connect.api.input.VisualizationAllHeadersStyleInputRepresentation Input representation for all headers style in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderColumnsDirectionStyleInputRepresentation_) * `fields` (_object_) The field header styles for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.input.VisualizationHeaderStyleInputRepresentation`. * `rows` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderRowsDirectionStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationAxisStyleInputRepresentation Input representation for axis style in a visualization. * `dualAxis` (_sfdc.unified.analytics.connect.api.input.VisualizationDualAxisStyleInputRepresentation_) * `isVisible` (_boolean_) Whether the axis is visible. * `isZeroLineVisible` (_boolean_) Whether the zero line is visible. * `range` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationAxisRangeStyleInputRepresentation_) * `scale` (_sfdc.unified.analytics.connect.api.input.VisualizationCommonStyleInputRepresentation_) * `ticks` (_sfdc.unified.analytics.connect.api.input.VisualizationAxisTicksStyleInputRepresentation_) * `titleText` (_string_) The title text for the axis. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleFitType The style fit type of the visualization's visual specification. Type: `string`. Allowed values: `Entire`, `RowHeadersWidth`, `Standard`. ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderStyleInputRepresentation Input representation for header style in a visualization. * `defaults` (_sfdc.unified.analytics.connect.api.input.VisualizationCommonStyleInputRepresentation_) * `hiddenValues` (_array of string_) The hidden values for the header. * `isVisible` (_boolean_) Whether the header is visible. * `showMissingValues` (_boolean_) Whether to show missing values. * `textDirection` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTextDirectionType_) ### sfdc.unified.analytics.connect.api.input.VisualizationMarkStyleInputRepresentation Input representation for mark style in a visualization. * `color` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkColorStyleInputRepresentation_) * `connector` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkConnectorStyleInputRepresentation_) * `isAutomaticOpacity` (_boolean_) Whether the mark opacity is managed automatically by the system. * `isAutomaticSize` (_boolean_) Whether the size style is automatic. * `isStackingAxisCentered` (_boolean_) Whether the marks are centered along their stacking axis. * `label` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkLabelStyleInputRepresentation_) * `opacity` (_integer_) The opacity of the mark, as a percentage value from 0 (transparent) to 100 (opaque). * `range` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkRangeStyleInputRepresentation_) * `size` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkSizeStyleInputRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.input.VisualizationTooltipMarkStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationPaneStyleInputRepresentation Input representation for pane style in a visualization. * `colors` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationColorAssignmentInputRepresentation_) * `defaults` (_sfdc.unified.analytics.connect.api.input.VisualizationCommonStyleInputRepresentation_) * `isAutomaticSize` (_boolean_) Whether the size range is automatic. * `size` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkSizeRangeInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineStyleInputRepresentation Input representation for reference line style in a visualization. * `fillAboveColor` (_string_) Color to fill above the line when the reference line is of type line. * `fillBelowColor` (_string_) Color to fill below the line when the reference line is of type line. * `fillColor` (_string_) Color to fill between the lines when the reference line is of type band. * `isVisible` (_boolean_) The visibility of the reference line in the visualization. * `labelAlignment` (_sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineLabelAlignmentInputRepresentation_) * `lineFormat` (_sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineFormatInputRepresentation_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationVizqlStyleFitType The style fit type of the visualization's vizql visual specification. Type: `string`. Allowed values: `Entire`, `Standard`. ### sfdc.unified.analytics.connect.api.output.MapFieldReferenceRepresentation Map field reference output representation. * `fieldName` (_string_) The field name. * `objectName` (_string_) The object name. ### sfdc.unified.analytics.connect.api.output.actions.FilterActionFilterRepresentation Represents a filter value for filter actions in unified analytics. * `tokenName` (_string_) Token name for the filter ### sfdc.unified.analytics.connect.api.output.actions.FlowActionParameterAttributesRepresentation Represents flow action parameter's attribute representation in unified analytics. * `inputData` (_sfdc.unified.analytics.connect.api.output.actions.BaseFlowActionAttributeDataRepresentation_) * `inputDataType` (_string_) Data type of the flow input variable. ### sfdc.unified.analytics.connect.api.output.actions.BaseNavigateActionDestinationRepresentation Represents navigate action destination representation in unified analytics. One of: `sfdc.unified.analytics.connect.api.output.actions.DashboardNavigateActionDestinationRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.MetricDetailsNavigateActionDestinationRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.PageNavigateActionDestinationRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.UrlNavigateActionDestinationRepresentation`. ### sfdc.unified.analytics.connect.api.output.actions.RecordActionInfoRepresentation Salesforce action data. * `apiName` (_string_) Name of the action. ### sfdc.unified.analytics.connect.api.output.actions.RecordActionFieldRepresentation Represents parameters of a record action. * `fieldKey` (_string_) Represents visualization field key ### sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterRepresentation A unified filter. * `fields` (_array of sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterFieldRepresentation_) The list of fields for the unified filter. * `includeNulls` (_boolean_) Specifies whether to include null values in the filter results (`true`) or not (`false`). * `measureCriteria` (_sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterMeasureCriteriaRepresentation_) * `operator` (_sfdc.semantic.authoring.connect.api.enums.SemanticFilterOperatorTypeEnum_) * `topBottomCriteria` (_sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterTopBottomCriteriaRepresentation_) * `values` (_array of any_) The values for the unified filter. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationFilterInfoRepresentation A filter for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationGreaterThanFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationInFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationLessThanFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationNullsFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationRangeFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationRelativeDateFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationTopNFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationWildCardFilterInfoRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationByFieldSortRepresentation A sort by a specific field, used in a table visualization. * `byField` (_string_) The field to apply the sort by. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) ### sfdc.unified.analytics.connect.api.output.VisualizationAlphabeticSortRepresentation alphabetic An alphabetic sort for a visualization. * `fieldKey` (_string_) The field key for the sort. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) * `type` (_string_, required) The shape of `sorts` when `type` is `alphabetic`. Allowed values: `alphabetic`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldSortRepresentation Field A sort by a specific field for a visualization. * `fieldKey` (_string_) The field key for the sort. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortType_, required) * `byField` (_string_) The field to apply the sort by. ### sfdc.unified.analytics.connect.api.output.VisualizationNestedSortRepresentation Nested A nested sort by field for a visualization. * `fieldKey` (_string_) The field key for the sort. * `order` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortOrderType_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortType_, required) * `byField` (_string_) The field to apply the sort by. ### sfdc.unified.analytics.connect.api.output.VisualizationViewSpecHeadersStyleRepresentation A style configuration for column, group, and row headers in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.output.VisualizationViewSpecHeaderColumnsDirectionStyleRepresentation_) * `groups` (_sfdc.unified.analytics.connect.api.output.VisualizationViewSpecHeaderGroupsDirectionStyleRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.output.VisualizationViewSpecHeaderRowsDirectionStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationEncodingStylesRepresentation Output representation for encoding styles in a visualization. * `fields` (_object_) The encoding styles per field. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationPaneStyleRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationFlowFieldLabelsStyleRepresentation Output representation for flow field labels style in a visualization. * `levels` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationFontStyleRepresentation Output representation for font style in a visualization. * `actionableHeaders` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `axisTickLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `ban` (_sfdc.unified.analytics.connect.api.output.VisualizationFontBanStyleRepresentation_) * `fieldLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `grandTotalLabel` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `grandTotalValues` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `headers` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `legendLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `markLabels` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `marks` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `subtotalLabel` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) * `subtotalValues` (_sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationLineStyleRepresentation Output representation for line style in a visualization. * `axisLine` (_sfdc.unified.analytics.connect.api.output.VisualizationLineCommonStyleRepresentation_) * `fieldLabelDividerLine` (_sfdc.unified.analytics.connect.api.output.VisualizationLineCommonStyleRepresentation_) * `separatorLine` (_sfdc.unified.analytics.connect.api.output.VisualizationLineCommonStyleRepresentation_) * `zeroLine` (_sfdc.unified.analytics.connect.api.output.VisualizationLineCommonStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationFlowMarkStylesRepresentation Output representation for flow mark styles in a visualization. * `fields` (_object_) The mark styles per field. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation`. * `links` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation_) * `nodes` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationShadingStyleRepresentation Output representation for shading style in a visualization. * `backgroundColor` (_string_) The background color for the shading. * `banding` (_sfdc.unified.analytics.connect.api.output.VisualizationBandingStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationTitleStyleRepresentation Output representation for title style in a visualization. * `isVisible` (_boolean_) Whether the title of the visualization should be visible. * `titleText` (_string_) The title of the visualization. ### sfdc.unified.analytics.connect.api.output.VisualizationTooltipStyleRepresentation Output representation for tooltip styles shared across all tooltip types in a visualization. * `container` (_sfdc.unified.analytics.connect.api.output.VisualizationTooltipContainerStyleRepresentation_) * `isVisible` (_boolean_) Whether the tooltip is visible. ### sfdc.unified.analytics.connect.api.output.VisualizationLegendTitleRepresentation Representation for legend title in visualization. * `isVisible` (_boolean_) Whether the legend title is visible. * `titleText` (_string_) The title text for the legend. ### sfdc.unified.analytics.connect.api.output.VisualizationStyleRuleRepresentation Output representation for a single stylesheet rule. * `scope` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleScopeRepresentation_) * `selector` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStylableElementType_) * `style` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockRepresentation_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationBackgroundRepresentation A background for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationBlankBackgroundRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationGridBackgroundRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationMapBackgroundRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsStyleRepresentation Output representation for field labels style in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationMapMarkStylesRepresentation Output representation for map mark styles in a visualization. * `fields` (_object_) The mark styles per field. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation`. * `panes` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationAxisStylesRepresentation Output representation for axis styles in a visualization. * `fields` (_object_) The axis styles per field. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationAxisStyleRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationBanStyleRepresentation Output representation for BAN (big number) style in a visualization. * `fields` (_object_) The BAN style per field, keyed by field key. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationFieldBanStyleRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationRadialFieldLabelsStyleRepresentation Output representation for radial field labels style in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) * `rings` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) * `slices` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationRadialHeadersStyleRepresentation Output representation for radial headers style in a visualization. * `fields` (_object_) The field header styles for the radial visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationHeaderStyleRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationRadialMarkStylesRepresentation Radial layout specific output representation for mark styles in a visualization. * `panes` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderMarkSpecificationRepresentation Representation for header mark specification in visualization. * `encodings` (_array of sfdc.unified.analytics.connect.api.output.VisualizationHeaderMarkEncodingRepresentation_) The encoding properties of the header mark. * `isAutomatic` (_boolean_) Whether this header mark spec was automatically generated. * `stack` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStackRepresentation_) * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationHeaderMarkType_) ### sfdc.unified.analytics.connect.api.output.VisualizationTableFieldLabelsStyleRepresentation Representation for field label style for table layout in visualization. * `columns` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) * `groups` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationTotalsStyleRepresentation Output representation for totals style in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsCommonStyleRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.output.VisualizationTotalsCommonStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationTableHeaderStyleRepresentation Representation for table header styles in visualization with groups support. * `columns` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderColumnsDirectionStyleRepresentation_) * `fields` (_object_) The field header styles for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationHeaderStyleRepresentation`. * `groups` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderGroupsDirectionStyleRepresentation_) * `rows` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderRowsDirectionStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationMarkStylesRepresentation Output representation for mark styles collection in a visualization. * `fields` (_object_) The mark styles per field. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation`. * `headers` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderMarkStyleRepresentation_) * `panes` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationHoltWintersForecastRepresentation HoltWinters A Holt-Winters forecast model for a visualization. * `confidenceLevel` (_integer_) Specifies the confidence level when bounds are requested. Defaults to 95, and can be customized to 90 or 99. * `dimensionFields` (_array of sfdc.unified.analytics.connect.api.output.VisualizationForecastDimensionFieldRepresentation_) The attribute dimension field. * `fillNullsWithZero` (_boolean_) Replace null values in actual data with zeroes. * `forecastModel` (_string_, required) The shape of `forecasts` when `forecastModel` is `HoltWinters`. Allowed values: `HoltWinters`. * `from` (_sfdc.unified.analytics.connect.api.output.VisualizationForecastFromRepresentation_) * `ignoreLastPeriods` (_integer_) Number of periods at the end of the data to ignore. * `includeBounds` (_boolean_) Whether to include bounds (blue shade area) for forecast. * `measureFieldKey` (_string_) The attribute measure Field Key. * `to` (_sfdc.unified.analytics.connect.api.output.VisualizationForecastToRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationRidgeRegressionForecastRepresentation RidgeRegression A ridge-regression forecast model for a visualization. * `confidenceLevel` (_integer_) Specifies the confidence level when bounds are requested. Defaults to 95, and can be customized to 90 or 99. * `dimensionFields` (_array of sfdc.unified.analytics.connect.api.output.VisualizationForecastDimensionFieldRepresentation_) The attribute dimension field. * `fillNullsWithZero` (_boolean_) Replace null values in actual data with zeroes. * `forecastModel` (_string_, required) The shape of `forecasts` when `forecastModel` is `RidgeRegression`. Allowed values: `RidgeRegression`. * `from` (_sfdc.unified.analytics.connect.api.output.VisualizationForecastFromRepresentation_) * `ignoreLastPeriods` (_integer_) Number of periods at the end of the data to ignore. * `includeBounds` (_boolean_) Whether to include bounds (blue shade area) for forecast. * `measureFieldKey` (_string_) The attribute measure Field Key. * `to` (_sfdc.unified.analytics.connect.api.output.VisualizationForecastToRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationMarkEncodingRepresentation Representation for mark encoding in visualization. * `fieldKey` (_string_) The reference to the field to which the mark is applied. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkEncodingType_) ### sfdc.unified.analytics.connect.api.output.VisualizationMarkStackRepresentation Representation for mark stack in visualization. * `isAutomatic` (_boolean_) Whether the mark stack should be applied by default. * `isStacked` (_boolean_) Whether the mark stack should be stacked. ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceBandRepresentation Band A band, defined by a start and end reference line, for a visualization. * `endLine` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineInfoRepresentation_) * `startLine` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineInfoRepresentation_) * `fieldKey` (_string_) The field key of the reference line in the visualization. * `scope` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineScopeType_) * `type` (_string_, required) The shape of `referenceLines` when `type` is `Band`. Allowed values: `Band`. ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineRepresentation Line A single reference line for a visualization. * `line` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineInfoRepresentation_) * `fieldKey` (_string_) The field key of the reference line in the visualization. * `scope` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineScopeType_) * `type` (_string_, required) The shape of `referenceLines` when `type` is `Line`. Allowed values: `Line`. ### sfdc.unified.analytics.connect.api.output.VisualizationAllHeadersStyleRepresentation Output representation for all headers style in a visualization. * `columns` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderColumnsDirectionStyleRepresentation_) * `fields` (_object_) The field header styles for the visualization. Additional properties: `sfdc.unified.analytics.connect.api.output.VisualizationHeaderStyleRepresentation`. * `rows` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderRowsDirectionStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationAxisStyleRepresentation Output representation for axis style in a visualization. * `dualAxis` (_sfdc.unified.analytics.connect.api.output.VisualizationDualAxisStyleRepresentation_) * `isVisible` (_boolean_) Whether the axis is visible. * `isZeroLineVisible` (_boolean_) Whether the zero line is visible. * `range` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationAxisRangeStyleRepresentation_) * `scale` (_sfdc.unified.analytics.connect.api.output.VisualizationCommonStyleRepresentation_) * `ticks` (_sfdc.unified.analytics.connect.api.output.VisualizationAxisTicksStyleRepresentation_) * `titleText` (_string_) The title text for the axis. ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderStyleRepresentation Output representation for header style in a visualization. * `defaults` (_sfdc.unified.analytics.connect.api.output.VisualizationCommonStyleRepresentation_) * `hiddenValues` (_array of string_) The hidden values for the header. * `isVisible` (_boolean_) Whether the header is visible. * `showMissingValues` (_boolean_) Whether to show missing values. * `textDirection` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTextDirectionType_) ### sfdc.unified.analytics.connect.api.output.VisualizationMarkStyleRepresentation Output representation for mark style in a visualization. * `color` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkColorStyleRepresentation_) * `connector` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkConnectorStyleRepresentation_) * `isAutomaticOpacity` (_boolean_) Whether the mark opacity is managed automatically by the system. * `isAutomaticSize` (_boolean_) Whether the size style is automatic. * `isStackingAxisCentered` (_boolean_) Whether the marks are centered along their stacking axis. * `label` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkLabelStyleRepresentation_) * `opacity` (_integer_) The opacity of the mark, as a percentage value from 0 (transparent) to 100 (opaque). * `range` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkRangeStyleRepresentation_) * `size` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkSizeStyleRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.output.VisualizationTooltipMarkStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationPaneStyleRepresentation Output representation for pane style in a visualization. * `colors` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationColorAssignmentRepresentation_) * `defaults` (_sfdc.unified.analytics.connect.api.output.VisualizationCommonStyleRepresentation_) * `isAutomaticSize` (_boolean_) Whether the size range is automatic. * `size` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkSizeRangeRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineStyleRepresentation Output representation for reference line style in a visualization. * `fillAboveColor` (_string_) Color to fill above the line when the reference line is of type line. * `fillBelowColor` (_string_) Color to fill below the line when the reference line is of type line. * `fillColor` (_string_) Color to fill between the lines when the reference line is of type band. * `isVisible` (_boolean_) The visibility of the reference line in the visualization. * `labelAlignment` (_sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineLabelAlignmentRepresentation_) * `lineFormat` (_sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineFormatRepresentation_) ### sfdc.unified.analytics.connect.api.input.widgets.filter.FilterOptionInputRepresentation Filter option input representation in unified analytics * `dataType` (_string_) Data type of the field name being filtered * `fieldName` (_string_) The specific field within the data object that this filter widget will filter on * `objectName` (_string_) The name of the table or view that this filter widget is associated with * `selectionType` (_sfdc.unified.analytics.connect.api.enums.FilterSelectionTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.filter.ListFilterWidgetTextStyleInputRepresentation ListFilter A text style for a list filter widget's label or value. * `fontColor` (_string_) Font color as a hex string. * `fontSize` (_integer_) Font size in pixels. * `textStyle` (_array of string_) Text style options (bold, italic, underline, removeFormatting). ### sfdc.unified.analytics.connect.api.input.widgets.filter.FilterWidgetStylesInputRepresentation FilterWidget Styles for a filter widget. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.enums.AnalyticsWidgetViewTypeEnum The view type of a widget _Available April 2026 and later._ Type: `string`. Allowed values: `Input`, `InputCard`, `List`, `ListCard`, `Toggle`. ### sfdc.unified.analytics.connect.api.input.widgets.ToggleDefaultStyleInputRepresentation Default style in a rendered toggle widget _Available April 2026 and later._ * `fontColor` (_string_) Font color value on toggle widget * `textStyle` (_array of string_) Text style on toggle widget ### sfdc.unified.analytics.connect.api.input.widgets.ToggleSelectedStyleInputRepresentation Selected style in a rendered toggle widget _Available April 2026 and later._ * `backgroundColor` (_string_) Background color on a selected button on a toggle widget. * `fontColor` (_string_) Text color value on a selected button on a toggle widget * `textStyle` (_array of string_) Text style on a selected button on a toggle widget ### sfdc.unified.analytics.connect.api.input.widgets.ToggleTextStyleInputRepresentation Text style in a rendered toggle widget _Available April 2026 and later._ * `alignmentX` (_string_) AlignmentX on a toggle widget * `alignmentY` (_string_) AlignmentY on a toggle widget * `fontSize` (_integer_) Font size on a toggle widget ### sfdc.unified.analytics.connect.api.enums.ConnectReceiveFilterModeEnum Type: `string`. ### sfdc.unified.analytics.connect.api.input.FilterPublisherInputRepresentation Filter Publisher Input Representation in unified analytics * `fieldName` (_string_) Field name that the widget is publishing a message for. Can be optional when widgetId above is provided, which means that all actions on that widget will be passed and no specific data source information is needed. * `objectName` (_string_) Object name that the widget is publishing a message for. Can be optional when widgetId above is provided, which means that all actions on that widget will be passed and no specific data source information is needed. * `source` (_sfdc.unified.analytics.connect.api.input.widgets.WidgetDataSourceInputRepresentation_) * `widgetId` (_string_) The widget ID of the publisher ### sfdc.unified.analytics.connect.api.input.widgets.parameter.InputParameterWidgetTextStyleInputRepresentation InputParameter A text style for an input parameter widget's label or value. * `fontColor` (_string_) Font color as a hex string. * `fontSize` (_integer_) Font size in pixels. * `textStyle` (_array of string_) Text style options (bold, italic, underline, removeFormatting). ### sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterWidgetStylesInputRepresentation ParameterWidget A set of style settings for a parameter widget in a Tableau Next dashboard. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterOptionInputRepresentation Parameter option input representation in unified analytics * `dataType` (_sfdc.unified.analytics.connect.api.enums.ConnectInputParameterDataTypeEnum_) ### sfdc.unified.analytics.connect.api.input.widgets.parameter.ListParameterWidgetTextStyleInputRepresentation ListParameter A text style for a list parameter widget's label or value. * `fontColor` (_string_) Font color as a hex string. * `fontSize` (_integer_) Font size in pixels. * `textStyle` (_array of string_) Text style options (bold, italic, underline, removeFormatting). ### sfdc.unified.analytics.connect.api.input.widgets.text.ConditionalFormattingBucketInputRepresentation Measure and dimension conditional formatting bucket input representation for text widgets _Available April 2026 and later._ * `attributes` (_sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetContentAttributeInputRepresentation_) * `operator` (_sfdc.unified.analytics.connect.api.enums.ConditionalFormattingOperatorEnum_) * `value` (_array of any_) The value(s) to compare against ### sfdc.unified.analytics.connect.api.enums.FormattingTypeEnum Enum for measure conditional formatting types. _Available April 2026 and later._ Type: `string`. Allowed values: `SingleColor`. ### sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetContentAttributeInputRepresentation Text widget parameters definition input representation in unified analytics * `align` (_string_) Align attribute of text widget * `background` (_string_) Background attribute of text widget * `bold` (_boolean_) Bold of the text widget * `color` (_string_) Color of the text widget * `italic` (_boolean_) Italic attribute of text widget * `link` (_string_) Link attribute of text widget * `list` (_string_) List type attribute of text widget (e.g. bullet, ordered) * `size` (_string_) Size of the text widget * `strike` (_boolean_) Strike attribute of text widget * `underline` (_boolean_) Underline attribute of text widget ### sfdc.unified.analytics.connect.api.input.ParameterPublisherInputRepresentation Parameter Publisher Input Representation in unified analytics * `parameterName` (_string_) The parameter name published by this widget * `widgetId` (_string_) The widget ID of the parameter publisher ### sfdc.unified.analytics.connect.api.output.widgets.filter.FilterOptionRepresentation Representation of a filterOption. * `dataType` (_string_) Data type of the field name being filtered * `fieldName` (_string_) The specific field within the data object that this filter widget will filter on * `objectName` (_string_) The name of the table or view that this filter widget is associated with * `selectionType` (_sfdc.unified.analytics.connect.api.enums.FilterSelectionTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.filter.ListFilterWidgetTextStyleRepresentation ListFilter A text style for a list filter widget's label or value. * `fontColor` (_string_) Font color as a hex string * `fontSize` (_integer_) Font size in pixels * `textStyle` (_array of string_) Text style options (bold, italic, underline, removeFormatting) ### sfdc.unified.analytics.connect.api.output.widgets.filter.FilterWidgetStylesRepresentation Filter Styles for a filter widget. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.ToggleDefaultStyleRepresentation Toggle widget default style representation _Available April 2026 and later._ * `fontColor` (_string_) Font color value on toggle widget * `textStyle` (_array of string_) Text style on toggle widget ### sfdc.unified.analytics.connect.api.output.widgets.ToggleSelectedStyleRepresentation Toggle widget selected style representation _Available April 2026 and later._ * `backgroundColor` (_string_) Background color * `fontColor` (_string_) Font color * `textStyle` (_array of string_) Text style ### sfdc.unified.analytics.connect.api.output.widgets.ToggleTextStyleRepresentation Toggle widget text style representation _Available April 2026 and later._ * `alignmentX` (_string_) Horizontal alignment * `alignmentY` (_string_) Vertical alignment * `fontSize` (_integer_) Font size ### sfdc.unified.analytics.connect.api.output.FilterPublisherRepresentation Representation for a filter publisher * `fieldName` (_string_) Field name that the widget is publishing a message for. Can be optional when widgetId above is provided, which means that all actions on that widget will be passed and no specific data source information is needed. * `objectName` (_string_) Object name that the widget is publishing a message for. Can be optional when widgetId above is provided, which means that all actions on that widget will be passed and no specific data source information is needed. * `source` (_sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation_) * `widgetId` (_string_) The widget ID of the publisher ### sfdc.unified.analytics.connect.api.output.widgets.parameter.InputParameterWidgetTextStyleRepresentation InputParameter A text style for an input parameter widget's label or value. * `fontColor` (_string_) Font color as a hex string * `fontSize` (_integer_) Font size in pixels * `textStyle` (_array of string_) Text style options (bold, italic, underline, removeFormatting) ### sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterWidgetStylesRepresentation Parameter A set of style settings for a parameter widget in a Tableau Next dashboard. * `backgroundColor` (_string_) Back ground color. * `borderColor` (_string_) Border color. * `borderEdges` (_array of string_) Border edges. * `borderRadius` (_integer_) Border radius. * `borderWidth` (_integer_) Border width. ### sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterOptionRepresentation Representation of a parameterOption. * `dataType` (_sfdc.unified.analytics.connect.api.enums.ConnectInputParameterDataTypeEnum_) ### sfdc.unified.analytics.connect.api.output.widgets.parameter.ListParameterWidgetTextStyleRepresentation ListParameter A text style for a list parameter widget's label or value. * `fontColor` (_string_) Font color as a hex string * `fontSize` (_integer_) Font size in pixels * `textStyle` (_array of string_) Text style options (bold, italic, underline, removeFormatting) ### sfdc.unified.analytics.connect.api.output.widgets.text.ConditionalFormattingBucketRepresentation Represents a measure and dimension conditional formatting bucket for text widgets _Available April 2026 and later._ * `attributes` (_sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetContentAttributeRepresentation_) * `operator` (_sfdc.unified.analytics.connect.api.enums.ConditionalFormattingOperatorEnum_) * `value` (_array of any_) The value(s) to compare against ### sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetContentAttributeRepresentation Represents text widget parameter content attribute representation in unified analytics * `align` (_string_) Align attribute of text widget * `background` (_string_) Background attribute of text widget * `bold` (_boolean_) Bold attribute of text widget * `color` (_string_) Color attribute of text widget * `italic` (_boolean_) Italic attribute of text widget * `link` (_string_) Link attribute of text widget * `list` (_string_) List type attribute of text widget (e.g. bullet, ordered) * `size` (_string_) Size attribute of text widget * `strike` (_boolean_) Strike attribute of text widget * `underline` (_boolean_) Underline attribute of text widget ### sfdc.unified.analytics.connect.api.output.ParameterPublisherRepresentation Representation for a parameter publisher * `parameterName` (_string_) The parameter name published by this widget * `widgetId` (_string_) The widget ID of the parameter publisher ### sfdc.unified.analytics.connect.api.output.MarkSelectionFieldRepresentation A field ID representation with metadata. * `disambiguationIndex` (_integer_) The index for disambiguating field references. * `displayCategory` (_string_) The display category of the field (e.g., Continuous, Discrete). * `fieldName` (_string_) The name of the field. * `function` (_string_) The aggregation function applied to the field (e.g., Sum, Count). * `objectName` (_string_) The name of the object containing the field. * `role` (_string_) The role of the field (e.g., Measure, Dimension). * `type` (_string_) The type of the field. ### sfdc.unified.analytics.connect.api.input.actions.BaseFlowActionAttributeDataInputRepresentation Flow Actions variable input representation in unified analytics One of: `sfdc.unified.analytics.connect.api.input.actions.DynamicFlowActionAttributeDataInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.StaticFlowActionAttributeDataInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.actions.DashboardNavigateActionDestinationInputRepresentation Dashboard A navigation destination that targets a specific dashboard page in Tableau Next. * `pageName` (_string_) Destination pageName * `target` (_string_) Destination target * `type` (_string_) The shape of `destination` when `type` is `Dashboard`. Allowed values: `Dashboard`. ### sfdc.unified.analytics.connect.api.input.actions.MetricDetailsNavigateActionDestinationInputRepresentation MetricDetails A navigation destination that opens the details page for a metric in Tableau Next. * `target` (_sfdc.unified.analytics.connect.api.input.actions.MetricDetailsNavigateActionTargetInput_) * `type` (_string_) The shape of `destination` when `type` is `MetricDetails`. Allowed values: `MetricDetails`. ### sfdc.unified.analytics.connect.api.input.actions.PageNavigateActionDestinationInputRepresentation Page A navigation destination that targets a specific page within the current dashboard. * `target` (_string_) Destination target * `type` (_string_) The shape of `destination` when `type` is `Page`. Allowed values: `Page`. ### sfdc.unified.analytics.connect.api.input.actions.UrlNavigateActionDestinationInputRepresentation Url A navigation destination that opens an external URL. * `target` (_string_) Destination target * `type` (_string_) The shape of `destination` when `type` is `Url`. Allowed values: `Url`. ### sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterFieldInputRepresentation A field reference for a unified filter. * `expression` (_string_) The expression. * `model` (_string_) The model field reference. ### sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterMeasureCriteriaInputRepresentation The measure criteria for a unified filter. * `unifiedFilter` (_sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.UnifiedSemanticFilterTopBottomCriteriaInputRepresentation The top/bottom criteria for a unified filter. * `expression` (_string_) The expression to order by for top/bottom determination. * `isTop` (_boolean_) Specifies whether this is a top filter (`true`) or a bottom filter (`false`). * `nullValuesPosition` (_sfdc.unified.analytics.connect.api.enums.ConnectUnifiedSemanticFilterNullValuesPositionType_) * `topBottomLimit` (_integer_) The limit for top/bottom filtering. ### sfdc.unified.analytics.connect.api.input.VisualizationGreaterThanFilterInfoInputRepresentation GreaterThan A greater-than filter for a visualization. * `beginValue` (_any_) The begin value of the range category filter. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFilterType_, required) * `includeNulls` (_boolean_) Whether to include nulls in the range category filter. * `showOnlyRelevantValues` (_boolean_) Whether to show only relevant values in the range category filter. ### sfdc.unified.analytics.connect.api.input.VisualizationInFilterInfoInputRepresentation In An inclusion filter for a visualization. * `isCustom` (_boolean_) Whether the filter is a custom filter. * `isExcludes` (_boolean_) Whether the filter should exclude the values. * `useAll` (_boolean_) Whether the use all the values in the filter. * `values` (_array of any_) The values for the filter. * `type` (_string_, required) The shape of `filterInfos` when `type` is `In`. Allowed values: `In`. ### sfdc.unified.analytics.connect.api.input.VisualizationLessThanFilterInfoInputRepresentation LessThan A less-than filter for a visualization. * `endValue` (_any_) The end value of the range category filter. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFilterType_, required) * `includeNulls` (_boolean_) Whether to include nulls in the range category filter. * `showOnlyRelevantValues` (_boolean_) Whether to show only relevant values in the range category filter. ### sfdc.unified.analytics.connect.api.input.VisualizationNullsFilterInfoInputRepresentation Nulls A null-value filter for a visualization. * `nullType` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNullsFilterType_) * `type` (_string_, required) The shape of `filterInfos` when `type` is `Nulls`. Allowed values: `Nulls`. ### sfdc.unified.analytics.connect.api.input.VisualizationRangeFilterInfoInputRepresentation Range A range filter for a visualization. * `beginValue` (_any_) The begin value of the range category filter. * `endValue` (_any_) The end value of the range category filter. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFilterType_, required) * `includeNulls` (_boolean_) Whether to include nulls in the range category filter. * `showOnlyRelevantValues` (_boolean_) Whether to show only relevant values in the range category filter. ### sfdc.unified.analytics.connect.api.input.VisualizationRelativeDateFilterInfoInputRepresentation RelativeDate A relative-date filter for a visualization. * `anchorRelativeDate` (_string_) The anchor filter value to a relative date. * `beginPeriod` (_sfdc.unified.analytics.connect.api.input.VisualizationRelativeDateFilterPeriodInputRepresentation_) * `endPeriod` (_sfdc.unified.analytics.connect.api.input.VisualizationRelativeDateFilterPeriodInputRepresentation_) * `includeNulls` (_boolean_) Whether to include null values. * `isFiscal` (_boolean_) Whether the value uses the standard fiscal calendar. * `type` (_string_, required) The shape of `filterInfos` when `type` is `RelativeDate`. Allowed values: `RelativeDate`. ### sfdc.unified.analytics.connect.api.input.VisualizationTopNFilterInfoInputRepresentation TopN A top-N filter for a visualization. * `byField` (_string_) The field to apply the top n filter on. * `count` (_integer_) The count of the top n filter. * `direction` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTopNFilterInfoDirectionType_) * `type` (_string_, required) The shape of `filterInfos` when `type` is `TopN`. Allowed values: `TopN`. ### sfdc.unified.analytics.connect.api.input.VisualizationWildCardFilterInfoInputRepresentation WildCard A wildcard filter for a visualization. * `includeAllValuesWhenEmpty` (_boolean_) Whether to include all values when the wild card filter is empty. * `isExcludes` (_boolean_) Whether the wild card filter is an exclude filter. * `operator` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationWildCardFilterOperatorType_) * `value` (_string_) The value of the wild card filter. * `type` (_string_, required) The shape of `filterInfos` when `type` is `WildCard`. Allowed values: `WildCard`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSortType The type of sort in a visualization's view specification. Type: `string`. Allowed values: `Alphabetic`, `Field`, `Nested`. ### sfdc.unified.analytics.connect.api.input.VisualizationViewSpecHeaderColumnsDirectionStyleInputRepresentation The style for the column direction of view headers in a visualization. * `sizing` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderColumnsSizingStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationViewSpecHeaderGroupsDirectionStyleInputRepresentation The style for the group direction of view headers in a visualization. * `sizing` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderRowsSizingStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationViewSpecHeaderRowsDirectionStyleInputRepresentation The style for the row direction of view headers in a visualization. * `sizing` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderRowsSizingStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation Input representation for common field labels style in a visualization. * `backgroundColor` (_string_) The background color for the field labels. * `showDividerLine` (_boolean_) Whether the divider line should be shown. * `showLabels` (_boolean_) Whether the field labels should be displayed. ### sfdc.unified.analytics.connect.api.input.VisualizationFontCommonStyleInputRepresentation Input representation for common font style in a visualization. * `color` (_string_) The color for the font. * `size` (_integer_) The size for the font. ### sfdc.unified.analytics.connect.api.input.VisualizationFontBanStyleInputRepresentation Input representation for BAN (big number) font style in a visualization. * `color` (_string_) The color for the BAN font. ### sfdc.unified.analytics.connect.api.input.VisualizationLineCommonStyleInputRepresentation Input representation for common line style in a visualization. * `color` (_string_) The color for the line. ### sfdc.unified.analytics.connect.api.input.VisualizationBandingStyleInputRepresentation Input representation for banding style in a visualization. * `rows` (_sfdc.unified.analytics.connect.api.input.VisualizationBandingCommonStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationTooltipContainerStyleInputRepresentation Input representation for tooltip container style. * `color` (_string_) The background color of the tooltip container. * `transparency` (_integer_) The transparency of the tooltip container (0-100). ### sfdc.unified.analytics.connect.api.input.VisualizationStyleScopeInputRepresentation Input representation for a style rule scope. * `markType` (_string_) Mark type to scope this rule to. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStylableElementType The viz element whose style can be targeted by a stylesheet rule's selector. Type: `string`. Allowed values: `ActionableHeaderLabel`, `Axis`, `AxisLine`, `AxisTick`, `AxisTickLabel`, `AxisTitle`, `BanLabel`, `BanValue`, `BodyText`, `ColumnFieldLabel`, `ConfidenceBand`, `FieldLabel`, `FieldLabelBackground`, `FieldLabelDividerLine`, `FlowLink`, `FlowNode`, `Global`, `GrandTotalLabel`, `GrandTotalValue`, `GridLine`, `HeaderBackground`, `HeaderCell`, `HeaderLabel`, `Headings`, `Legend`, `LegendLabel`, `LegendTitle`, `LevelFieldLabel`, `LevelNodeLabel`, `LevelNodeValue`, `Mark`, `MarkLabel`, `Pane`, `ReferenceLine`, `ReferenceLineLabelBox`, `RowFieldLabel`, `Scene`, `SceneMargin`, `SeparatorLine`, `SubtotalLabel`, `SubtotalValue`, `TrendLine`, `VizLines`, `ZeroLine`. ### sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockInputRepresentation Input representation for a style block. * `backgroundColor` (_string_) Background color (hex). * `border` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockBorderInputRepresentation_) * `color` (_string_) The foreground color in hex format, used for text, lines, and borders, and as the fallback mark color when no other paint is specified. * `font` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockFontInputRepresentation_) * `line` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockLineInputRepresentation_) * `opacity` (_number (double)_) Opacity value from 0 to 1. * `padding` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockPaddingInputRepresentation_) * `text` (_sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockTextInputRepresentation_) * `visibility` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleVisibilityType_) ### sfdc.unified.analytics.connect.api.input.VisualizationBlankBackgroundInputRepresentation Blank A blank background for a visualization. * `type` (_string_, required) The shape of `background` when `type` is `Blank`. Allowed values: `Blank`. ### sfdc.unified.analytics.connect.api.input.VisualizationGridBackgroundInputRepresentation Grid A grid background for a visualization. * `domain` (_sfdc.unified.analytics.connect.api.input.VisualizationGridBackgroundDomainInputRepresentation_) * `type` (_string_, required) The shape of `background` when `type` is `Grid`. Allowed values: `Grid`. ### sfdc.unified.analytics.connect.api.input.VisualizationMapBackgroundInputRepresentation Map A map background for a visualization. * `domain` (_sfdc.unified.analytics.connect.api.input.VisualizationMapBackgroundDomainInputRepresentation_) * `style` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationMapBackgroundStyleInputRepresentation_) * `styleName` (_string_) The map background style name. * `styleUrl` (_string_) The map background style url. * `type` (_string_, required) The shape of `background` when `type` is `Map`. Allowed values: `Map`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldBanStyleInputRepresentation Input representation for a single field's BAN (big number) style in a visualization. * `fieldLabel` (_sfdc.unified.analytics.connect.api.input.VisualizationFieldLabelsCommonStyleInputRepresentation_) * `format` (_sfdc.unified.analytics.connect.api.input.VisualizationDataFormatInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderMarkEncodingInputRepresentation Input representation for header mark encoding in visualization. * `fieldKey` (_string_) The reference to the field to which the header mark encoding is applied. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationHeaderMarkEncodingType_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationHeaderMarkType The mark type of the visualization header. Type: `string`. Allowed values: `Bar`, `Text`. ### sfdc.unified.analytics.connect.api.input.VisualizationTotalsCommonStyleInputRepresentation Input representation for common totals style in a visualization. * `label` (_string_) Custom label for grand total rows. * `position` (_sfdc.unified.analytics.connect.api.enums.visualization.visualSpec.ConnectVisualizationPositionType_) ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderColumnsDirectionStyleInputRepresentation Input representation for header columns direction style in a visualization. * `mergeRepeatedCells` (_boolean_) Whether repeated cells should be merged for the visualization. * `showIndex` (_boolean_) Whether the index should be shown for the visualization. * `sizing` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderColumnsSizingStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderGroupsDirectionStyleInputRepresentation Input representation for header groups direction style in table visualization. * `mergeRepeatedCells` (_boolean_) Whether repeated cells should be merged for group headers in the visualization. * `sizing` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderRowsSizingStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderRowsDirectionStyleInputRepresentation Input representation for header rows direction style in a visualization. * `mergeRepeatedCells` (_boolean_) Whether repeated cells should be merged for the visualization. * `showIndex` (_boolean_) Whether the index should be shown for the visualization. * `sizing` (_sfdc.unified.analytics.connect.api.input.VisualizationHeaderRowsSizingStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderMarkStyleInputRepresentation Input representation for header mark style in a visualization. * `color` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkColorStyleInputRepresentation_) * `connector` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkConnectorStyleInputRepresentation_) * `isAutomaticOpacity` (_boolean_) Whether the mark opacity is managed automatically by the system. * `isAutomaticSize` (_boolean_) Whether the size style is automatic. * `isStackingAxisCentered` (_boolean_) Whether the marks are centered along their stacking axis. * `label` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkLabelStyleInputRepresentation_) * `opacity` (_integer_) The opacity of the mark, as a percentage value from 0 (transparent) to 100 (opaque). * `range` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkRangeStyleInputRepresentation_) * `size` (_sfdc.unified.analytics.connect.api.input.VisualizationMarkSizeStyleInputRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.input.VisualizationTooltipMarkStyleInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationForecastDimensionFieldInputRepresentation The wrapper of date dimension field. * `dateDim` (_sfdc.unified.analytics.connect.api.input.VisualizationForecastDateDimensionFieldInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationForecastFromInputRepresentation Represents the forecast 'from' date in a visualization context. * `predefinedDate` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastPredefinedDateType_) ### sfdc.unified.analytics.connect.api.input.VisualizationForecastToInputRepresentation Represents the forecast or 'to' date in a visualization context. * `forecastInterval` (_sfdc.unified.analytics.connect.api.input.VisualizationForecastIntervalInputRepresentation_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkEncodingType The encoding type of a mark in the visualization's visual specification. Type: `string`. Allowed values: `Angle`, `Color`, `Detail`, `Label`, `Range`, `Size`, `Tooltip`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineInfoInputRepresentation A reference line value or computation source for a visualization. One of: `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineComputationInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineValueInfoInputRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineScopeType The reference line scope type of the visualization's visual specification. Type: `string`. Allowed values: `Cell`, `Pane`, `Table`. ### sfdc.unified.analytics.connect.api.input.VisualizationDualAxisStyleInputRepresentation Input representation for dual axis style in a visualization. * `synchronization` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisSynchronizationType_) ### sfdc.unified.analytics.connect.api.input.BaseVisualizationAxisRangeStyleInputRepresentation The range style for a visualization axis, either automatic or custom. One of: `sfdc.unified.analytics.connect.api.input.VisualizationAutoAxisRangeStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationCustomAxisRangeStyleInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationCommonStyleInputRepresentation Input representation for common style in a visualization. * `format` (_sfdc.unified.analytics.connect.api.input.VisualizationDataFormatInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationAxisTicksStyleInputRepresentation Input representation for axis ticks style in a visualization. * `majorTicks` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationAxisTicksInfoInputRepresentation_) * `minorTicks` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationAxisTicksInfoInputRepresentation_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTextDirectionType The text direction type of the visualization's visual specification. Type: `string`. Allowed values: `Auto`, `Horizontal`, `VerticalDown`, `VerticalUp`. ### sfdc.unified.analytics.connect.api.input.VisualizationMarkColorStyleInputRepresentation Input representation for mark color style in a visualization. * `color` (_string_) The color for a mark. ### sfdc.unified.analytics.connect.api.input.VisualizationMarkConnectorStyleInputRepresentation Input representation for mark connector style in a visualization. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkConnectorType_) ### sfdc.unified.analytics.connect.api.input.VisualizationMarkLabelStyleInputRepresentation Input representation for mark label style in a visualization. * `canOverlapLabels` (_boolean_) Whether labels can overlap. * `marksToLabel` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationMarksToLabelStyleInputRepresentation_) * `showMarkLabels` (_boolean_) Whether to show mark labels. * `textDirection` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTextDirectionType_) ### sfdc.unified.analytics.connect.api.input.VisualizationMarkRangeStyleInputRepresentation Input representation for mark range style in a visualization. * `reverse` (_boolean_) Whether the range is reversed. ### sfdc.unified.analytics.connect.api.input.VisualizationMarkSizeStyleInputRepresentation Input representation for mark size style in a visualization. * `isAutomatic` (_boolean_) Whether the size value is automatic. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkSizeType_) * `value` (_integer_) The size value. ### sfdc.unified.analytics.connect.api.input.VisualizationTooltipMarkStyleInputRepresentation Input representation for mark-specific tooltip style. * `customText` (_array of sfdc.unified.analytics.connect.api.input.BaseVisualizationTooltipTextValueInputRepresentation_) Custom text sequence for the tooltip. * `showActions` (_boolean_) Whether to show actions in the tooltip. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationColorAssignmentInputRepresentation The color assignment for a visualization, either continuous or discrete. One of: `sfdc.unified.analytics.connect.api.input.ContinuousColorAssignmentInputRepresentation`, `sfdc.unified.analytics.connect.api.input.DiscreteColorAssignmentInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationMarkSizeRangeInputRepresentation Input representation for mark size range in a visualization. * `isAutomatic` (_boolean_) Whether the size is automatic (defaults to true). * `max` (_integer_) The maximum value for the size range. * `min` (_integer_) The minimum value for the size range. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkSizeType_) ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineLabelAlignmentInputRepresentation Input representation for reference line label alignment in a visualization. * `horizontal` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineHorizontalAlignmentType_) * `vertical` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineVerticalAlignmentType_) ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineFormatInputRepresentation Input representation for reference line format in a visualization. * `color` (_string_) The color of the reference line. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineStyleType_) ### sfdc.unified.analytics.connect.api.output.actions.BaseFlowActionAttributeDataRepresentation Represents flow action input variable representation in unified analytics. One of: `sfdc.unified.analytics.connect.api.output.actions.DynamicFlowActionAttributeDataRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.StaticFlowActionAttributeDataRepresentation`. ### sfdc.unified.analytics.connect.api.output.actions.DashboardNavigateActionDestinationRepresentation Dashboard A navigation destination that targets a specific dashboard page in Tableau Next. * `pageName` (_string_) PageName * `target` (_string_) Navigate to target * `type` (_string_) The shape of `destination` when `type` is `Dashboard`. Allowed values: `Dashboard`. ### sfdc.unified.analytics.connect.api.output.actions.MetricDetailsNavigateActionDestinationRepresentation MetricDetails A navigation destination that opens the details page for a metric in Tableau Next. * `target` (_sfdc.unified.analytics.connect.api.output.actions.MetricDetailsNavigateActionTarget_) * `type` (_string_) The shape of `destination` when `type` is `MetricDetails`. Allowed values: `MetricDetails`. ### sfdc.unified.analytics.connect.api.output.actions.PageNavigateActionDestinationRepresentation Page A navigation destination that targets a specific page within the current dashboard. * `target` (_string_) Navigate to target * `type` (_string_) The shape of `destination` when `type` is `Page`. Allowed values: `Page`. ### sfdc.unified.analytics.connect.api.output.actions.UrlNavigateActionDestinationRepresentation Url A navigation destination that opens an external URL. * `target` (_string_) Navigate url. * `type` (_string_) The shape of `destination` when `type` is `Url`. Allowed values: `Url`. ### sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterFieldRepresentation A unified filter field. * `expression` (_string_) The expression. * `model` (_string_) The model field reference. ### sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterMeasureCriteriaRepresentation A set of measure criteria for a unified filter. * `unifiedFilter` (_sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterRepresentation_) ### sfdc.unified.analytics.connect.api.output.UnifiedSemanticFilterTopBottomCriteriaRepresentation A set of top/bottom filtering criteria for a unified filter. * `expression` (_string_) The expression to order by for top/bottom determination. * `isTop` (_boolean_) Specifies whether the filter selects the top values (`true`) or the bottom values (`false`). * `nullValuesPosition` (_sfdc.unified.analytics.connect.api.enums.ConnectUnifiedSemanticFilterNullValuesPositionType_) * `topBottomLimit` (_integer_) The limit for top/bottom filtering. ### sfdc.unified.analytics.connect.api.output.VisualizationGreaterThanFilterInfoRepresentation GreaterThan A greater-than filter for a visualization. * `beginValue` (_any_) The begin value of the range category filters. * `type` (_string_, required) The shape of this object when `type` is `GreaterThan`. Allowed values: `GreaterThan`. * `includeNulls` (_boolean_) Whether to include nulls in the range category filters. * `showOnlyRelevantValues` (_boolean_) Whether to show only relevant values in the range category filters. ### sfdc.unified.analytics.connect.api.output.VisualizationInFilterInfoRepresentation In An inclusion filter for a visualization. * `isCustom` (_boolean_) Whether the filter is a custom filter. * `isExcludes` (_boolean_) Whether the filter should exclude the values. * `useAll` (_boolean_) Whether to use all the values in the filter. * `values` (_array of any_) The values for the filter. * `type` (_string_, required) The shape of `filterInfos` when `type` is `In`. Allowed values: `In`. ### sfdc.unified.analytics.connect.api.output.VisualizationLessThanFilterInfoRepresentation LessThan A less-than filter for a visualization. * `endValue` (_any_) The end value of the range category filters. * `type` (_string_, required) The shape of this object when `type` is `LessThan`. Allowed values: `LessThan`. * `includeNulls` (_boolean_) Whether to include nulls in the range category filters. * `showOnlyRelevantValues` (_boolean_) Whether to show only relevant values in the range category filters. ### sfdc.unified.analytics.connect.api.output.VisualizationNullsFilterInfoRepresentation Nulls A null-value filter for a visualization. * `nullType` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNullsFilterType_) * `type` (_string_, required) The shape of `filterInfos` when `type` is `Nulls`. Allowed values: `Nulls`. ### sfdc.unified.analytics.connect.api.output.VisualizationRangeFilterInfoRepresentation Range A range filter for a visualization. * `beginValue` (_any_) The begin value of the range category filters. * `endValue` (_any_) The end value of the range category filters. * `type` (_string_, required) The shape of this object when `type` is `Range`. Allowed values: `Range`. * `includeNulls` (_boolean_) Whether to include nulls in the range category filters. * `showOnlyRelevantValues` (_boolean_) Whether to show only relevant values in the range category filters. ### sfdc.unified.analytics.connect.api.output.VisualizationRelativeDateFilterInfoRepresentation RelativeDate A relative-date filter for a visualization. * `anchorRelativeDate` (_string_) The anchor filter value to a relative date. * `beginPeriod` (_sfdc.unified.analytics.connect.api.output.VisualizationRelativeDateFilterPeriodRepresentation_) * `endPeriod` (_sfdc.unified.analytics.connect.api.output.VisualizationRelativeDateFilterPeriodRepresentation_) * `includeNulls` (_boolean_) Whether to include null values. * `isFiscal` (_boolean_) Whether the value uses the standard fiscal calendar (false if custom). * `type` (_string_, required) The shape of `filterInfos` when `type` is `RelativeDate`. Allowed values: `RelativeDate`. ### sfdc.unified.analytics.connect.api.output.VisualizationTopNFilterInfoRepresentation TopN A top-N filter for a visualization. * `byField` (_string_) The field to apply the top n filter on. * `count` (_integer_) The count of the top n filter. * `direction` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTopNFilterInfoDirectionType_) * `type` (_string_, required) The shape of `filterInfos` when `type` is `TopN`. Allowed values: `TopN`. ### sfdc.unified.analytics.connect.api.output.VisualizationWildCardFilterInfoRepresentation WildCard A wildcard filter for a visualization, matching field values against a text pattern. * `includeAllValuesWhenEmpty` (_boolean_) Whether to include all values when the wild card filter is empty. * `isExcludes` (_boolean_) Whether the wild card filter is an exclude filter. * `operator` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationWildCardFilterOperatorType_) * `value` (_string_) The value of the wild card filter. * `type` (_string_, required) The shape of `filterInfos` when `type` is `WildCard`. Allowed values: `WildCard`. ### sfdc.unified.analytics.connect.api.output.VisualizationViewSpecHeaderColumnsDirectionStyleRepresentation A direction style for header columns in a visualization's view specification. * `sizing` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderColumnsSizingStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationViewSpecHeaderGroupsDirectionStyleRepresentation A direction style for header groups in a visualization's view specification. * `sizing` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderRowsSizingStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationViewSpecHeaderRowsDirectionStyleRepresentation A direction style for header rows in a visualization. * `sizing` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderRowsSizingStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation Output representation for common field labels style in a visualization. * `backgroundColor` (_string_) The background color for the field labels. * `showDividerLine` (_boolean_) Whether the divider line should be shown. * `showLabels` (_boolean_) Whether the field labels should be displayed. ### sfdc.unified.analytics.connect.api.output.VisualizationFontCommonStyleRepresentation Output representation for common font style in a visualization. * `color` (_string_) The color for the font. * `size` (_integer_) The size for the font. ### sfdc.unified.analytics.connect.api.output.VisualizationFontBanStyleRepresentation Output representation for BAN (big number) font style in a visualization. * `color` (_string_) The color for the BAN font. ### sfdc.unified.analytics.connect.api.output.VisualizationLineCommonStyleRepresentation Output representation for common line style in a visualization. * `color` (_string_) The color for the line. ### sfdc.unified.analytics.connect.api.output.VisualizationBandingStyleRepresentation Output representation for banding style in a visualization. * `rows` (_sfdc.unified.analytics.connect.api.output.VisualizationBandingCommonStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationTooltipContainerStyleRepresentation Output representation for tooltip container style. * `color` (_string_) The background color of the tooltip container. * `transparency` (_integer_) The transparency of the tooltip container (0-100). ### sfdc.unified.analytics.connect.api.output.VisualizationStyleScopeRepresentation Output representation for a style rule scope. * `markType` (_string_) Mark type to scope this rule to. ### sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockRepresentation Output representation for a style block. * `backgroundColor` (_string_) Background color (hex). * `border` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockBorderRepresentation_) * `color` (_string_) The foreground color in hex format, used for text, lines, and borders, and as the fallback mark color when no other paint is specified. * `font` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockFontRepresentation_) * `line` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockLineRepresentation_) * `opacity` (_number (double)_) Opacity value from 0 to 1. * `padding` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockPaddingRepresentation_) * `text` (_sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockTextRepresentation_) * `visibility` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleVisibilityType_) ### sfdc.unified.analytics.connect.api.output.VisualizationBlankBackgroundRepresentation Blank A blank background for a visualization. * `type` (_string_, required) The shape of `background` when `type` is `Blank`. Allowed values: `Blank`. ### sfdc.unified.analytics.connect.api.output.VisualizationGridBackgroundRepresentation Grid A grid background for a visualization. * `domain` (_sfdc.unified.analytics.connect.api.output.VisualizationGridBackgroundDomainRepresentation_) * `type` (_string_, required) The shape of `background` when `type` is `Grid`. Allowed values: `Grid`. ### sfdc.unified.analytics.connect.api.output.VisualizationMapBackgroundRepresentation Map A map background for a visualization. * `domain` (_sfdc.unified.analytics.connect.api.output.VisualizationMapBackgroundDomainRepresentation_) * `style` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationMapBackgroundStyleRepresentation_) * `styleName` (_string_) The map background style name. * `styleUrl` (_string_) The map background style url. * `type` (_string_, required) The shape of `background` when `type` is `Map`. Allowed values: `Map`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldBanStyleRepresentation Output representation for a single field's BAN (big number) style in a visualization. * `fieldLabel` (_sfdc.unified.analytics.connect.api.output.VisualizationFieldLabelsCommonStyleRepresentation_) * `format` (_sfdc.unified.analytics.connect.api.output.VisualizationDataFormatRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderMarkEncodingRepresentation Representation for header mark encoding in visualization. * `fieldKey` (_string_) The reference to the field to which the header mark encoding is applied. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationHeaderMarkEncodingType_) ### sfdc.unified.analytics.connect.api.output.VisualizationTotalsCommonStyleRepresentation Output representation for common totals style in a visualization. * `label` (_string_) Custom label for grand total rows. * `position` (_sfdc.unified.analytics.connect.api.enums.visualization.visualSpec.ConnectVisualizationPositionType_) ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderColumnsDirectionStyleRepresentation Output representation for header columns direction style in a visualization. * `mergeRepeatedCells` (_boolean_) Whether repeated cells should be merged for the visualization. * `showIndex` (_boolean_) Whether the index should be shown for the visualization. * `sizing` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderColumnsSizingStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderGroupsDirectionStyleRepresentation Representation for header groups direction style in visualization. * `mergeRepeatedCells` (_boolean_) Whether repeated cells should be merged for group headers in the visualization. * `sizing` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderRowsSizingStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderRowsDirectionStyleRepresentation Output representation for header rows direction style in a visualization. * `mergeRepeatedCells` (_boolean_) Whether repeated cells should be merged for the visualization. * `showIndex` (_boolean_) Whether the index should be shown for the visualization. * `sizing` (_sfdc.unified.analytics.connect.api.output.VisualizationHeaderRowsSizingStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderMarkStyleRepresentation Output representation for header mark style in a visualization. * `color` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkColorStyleRepresentation_) * `connector` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkConnectorStyleRepresentation_) * `isAutomaticOpacity` (_boolean_) Whether the mark opacity is managed automatically by the system. * `isAutomaticSize` (_boolean_) Whether the size style is automatic. * `isStackingAxisCentered` (_boolean_) Whether the marks are centered along their stacking axis. * `label` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkLabelStyleRepresentation_) * `opacity` (_integer_) The opacity of the mark, as a percentage value from 0 (transparent) to 100 (opaque). * `range` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkRangeStyleRepresentation_) * `size` (_sfdc.unified.analytics.connect.api.output.VisualizationMarkSizeStyleRepresentation_) * `tooltip` (_sfdc.unified.analytics.connect.api.output.VisualizationTooltipMarkStyleRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationForecastDimensionFieldRepresentation The wrapper of date dimension field. * `dateDim` (_sfdc.unified.analytics.connect.api.output.VisualizationForecastDateDimensionFieldRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationForecastFromRepresentation Represents the forecast 'from' date in a visualization context. * `predefinedDate` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastPredefinedDateType_) ### sfdc.unified.analytics.connect.api.output.VisualizationForecastToRepresentation Forecast interval to representation. * `forecastInterval` (_sfdc.unified.analytics.connect.api.output.VisualizationForecastIntervalRepresentation_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineInfoRepresentation A value definition for a visualization reference line. One of: `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineComputationInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineValueInfoRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationDualAxisStyleRepresentation Output representation for dual axis style in a visualization. * `synchronization` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisSynchronizationType_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationAxisRangeStyleRepresentation A range style for a visualization axis. One of: `sfdc.unified.analytics.connect.api.output.VisualizationAutoAxisRangeStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationCustomAxisRangeStyleRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationCommonStyleRepresentation Output representation for common style in a visualization. * `format` (_sfdc.unified.analytics.connect.api.output.VisualizationDataFormatRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationAxisTicksStyleRepresentation Output representation for axis ticks style in a visualization. * `majorTicks` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationAxisTicksInfoRepresentation_) * `minorTicks` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationAxisTicksInfoRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationMarkColorStyleRepresentation Output representation for mark color style in a visualization. * `color` (_string_) The color for a mark. ### sfdc.unified.analytics.connect.api.output.VisualizationMarkConnectorStyleRepresentation Output representation for mark connector style in a visualization. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkConnectorType_) ### sfdc.unified.analytics.connect.api.output.VisualizationMarkLabelStyleRepresentation Output representation for mark label style in a visualization. * `canOverlapLabels` (_boolean_) Whether labels can overlap. * `marksToLabel` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationMarksToLabelStyleRepresentation_) * `showMarkLabels` (_boolean_) Whether to show mark labels. * `textDirection` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTextDirectionType_) ### sfdc.unified.analytics.connect.api.output.VisualizationMarkRangeStyleRepresentation Output representation for mark range style in a visualization. * `reverse` (_boolean_) Whether the range is reversed. ### sfdc.unified.analytics.connect.api.output.VisualizationMarkSizeStyleRepresentation Output representation for mark size style in a visualization. * `isAutomatic` (_boolean_) Whether the size value is automatic. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkSizeType_) * `value` (_integer_) The size value. ### sfdc.unified.analytics.connect.api.output.VisualizationTooltipMarkStyleRepresentation Output representation for mark-specific tooltip style. * `customText` (_array of sfdc.unified.analytics.connect.api.output.BaseVisualizationTooltipTextValueRepresentation_) Custom text sequence for the tooltip. * `showActions` (_boolean_) Whether to show actions in the tooltip. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationColorAssignmentRepresentation A color assignment for a visualization. One of: `sfdc.unified.analytics.connect.api.output.ContinuousColorAssignmentRepresentation`, `sfdc.unified.analytics.connect.api.output.DiscreteColorAssignmentRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationMarkSizeRangeRepresentation Output representation for mark size range in a visualization. * `isAutomatic` (_boolean_) Whether the size is automatic (defaults to true). * `max` (_integer_) The maximum value for the size range. * `min` (_integer_) The minimum value for the size range. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkSizeType_) ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineLabelAlignmentRepresentation Output representation for reference line label alignment in a visualization. * `horizontal` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineHorizontalAlignmentType_) * `vertical` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineVerticalAlignmentType_) ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineFormatRepresentation Output representation for reference line format in a visualization. * `color` (_string_) The color of the reference line. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineStyleType_) ### sfdc.unified.analytics.connect.api.enums.FilterSelectionTypeEnum Type: `string`. ### sfdc.unified.analytics.connect.api.enums.ConnectInputParameterDataTypeEnum Enum for input parameter data types Type: `string`. Allowed values: `Boolean`, `Date`, `Number`, `Percentage`, `Text`. ### sfdc.unified.analytics.connect.api.enums.ConditionalFormattingOperatorEnum Enum for measure conditional formatting operator types. _Available April 2026 and later._ Type: `string`. Allowed values: `Between`, `Equals`, `GreaterThan`, `GreaterThanOrEqualTo`, `LessThan`, `LessThanOrEqualTo`. ### sfdc.unified.analytics.connect.api.input.actions.DynamicFlowActionAttributeDataInputRepresentation Dynamic A dynamically resolved flow action variable that references a field on another widget. * `selectionType` (_sfdc.unified.analytics.connect.api.enums.ConnectDynamicFlowSelectionTypeEnum_) * `widgetField` (_string_) Dynamic Input attribute referred widget field * `widgetId` (_string_) Dynamic Input attribute referred widgetId * `inputType` (_sfdc.unified.analytics.connect.api.enums.ConnectFlowInputTypeEnum_) ### sfdc.unified.analytics.connect.api.input.actions.StaticFlowActionAttributeDataInputRepresentation Static A flow action variable with a fixed, static value. * `value` (_string_) Static Input attribute value * `inputType` (_sfdc.unified.analytics.connect.api.enums.ConnectFlowInputTypeEnum_) ### sfdc.unified.analytics.connect.api.input.actions.MetricDetailsNavigateActionTargetInput Target input for a metric details navigate action destination * `tokenName` (_string_) Token name that references the metric ### sfdc.unified.analytics.connect.api.enums.ConnectUnifiedSemanticFilterNullValuesPositionType The position of null values in ordering for unified semantic filter top/bottom criteria. Type: `string`. Allowed values: `NullsFirst`, `NullsLast`, `Unspecified`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFilterType The type of filter in a visualization's view specification. Type: `string`. Allowed values: `GreaterThan`, `In`, `LessThan`, `Nulls`, `Range`, `RelativeDate`, `TopN`, `WildCard`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNullsFilterType The null filter info type for the filters in the visualization. Type: `string`. Allowed values: `All`, `NonNull`, `Null`. ### sfdc.unified.analytics.connect.api.input.VisualizationRelativeDateFilterPeriodInputRepresentation Input representation for a relative date filter period in a visualization. * `unit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationRelativeDateFilterPeriodUnitType_) * `value` (_integer_) The value offset for the relative date filter period. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTopNFilterInfoDirectionType The direction type of the Top N filter in the visualization. Type: `string`. Allowed values: `Bottom`, `Top`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationWildCardFilterOperatorType The wild card filter operator type of the visualization's view specification. Type: `string`. Allowed values: `Contains`, `EndsWith`, `Exact`, `StartsWith`. ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderColumnsSizingStyleInputRepresentation The sizing style for header columns in a visualization. * `fieldHeight` (_object_) The height for each field in the header columns. Additional properties: `number (double)`. * `indexHeight` (_number (double)_) The height for the index column. * `width` (_number (double)_) The width of the header columns. ### sfdc.unified.analytics.connect.api.input.VisualizationHeaderRowsSizingStyleInputRepresentation The sizing style for header rows in a visualization. * `fieldWidth` (_object_) The width for each field in the header rows. Additional properties: `number (double)`. * `height` (_number (double)_) The height of the header rows. * `indexWidth` (_number (double)_) The width for the index row. ### sfdc.unified.analytics.connect.api.input.VisualizationBandingCommonStyleInputRepresentation Input representation for common banding style in a visualization. * `application` (_sfdc.unified.analytics.connect.api.input.VisualizationBandingApplicationStyleInputRepresentation_) * `color` (_string_) The color for the banding common style. ### sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockBorderInputRepresentation Input representation for border/outline properties. * `radius` (_number (double)_) Border corner radius. * `style` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleLineStyleType_) * `width` (_number (double)_) Border width. ### sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockFontInputRepresentation Input representation for font styling properties. * `family` (_string_) Font family name. * `italic` (_boolean_) Whether text is italic. * `size` (_integer_) Font size in pixels. * `underline` (_boolean_) Whether text is underlined. * `weight` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleFontWeightType_) ### sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockLineInputRepresentation Input representation for standalone line properties. * `smoothness` (_number (double)_) Line smoothness (0 = sharp corners, 1 = fully smoothed). * `style` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleLineStyleType_) * `width` (_number (double)_) Line width. ### sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockPaddingInputRepresentation Input representation for padding properties. * `bottom` (_integer_) Bottom padding. * `left` (_integer_) Left padding. * `right` (_integer_) Right padding. * `top` (_integer_) Top padding. ### sfdc.unified.analytics.connect.api.input.VisualizationStyleBlockTextInputRepresentation Input representation for text layout properties. * `halign` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleTextHorizontalAlignmentType_) * `textDirection` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTextDirectionType_) * `valign` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleTextVerticalAlignmentType_) * `wrap` (_boolean_) Whether text wraps to multiple lines. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleVisibilityType The element visibility type for the visualization stylesheet. Type: `string`. Allowed values: `Hidden`, `Visible`. ### sfdc.unified.analytics.connect.api.input.VisualizationGridBackgroundDomainInputRepresentation Input representation for grid background domain in a visualization. * `x` (_sfdc.unified.analytics.connect.api.input.VisualizationBackgroundDomainRangeInputRepresentation_) * `y` (_sfdc.unified.analytics.connect.api.input.VisualizationBackgroundDomainRangeInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.VisualizationMapBackgroundDomainInputRepresentation Input representation for map background domain in a visualization. * `latitude` (_sfdc.unified.analytics.connect.api.input.VisualizationBackgroundDomainRangeInputRepresentation_) * `longitude` (_sfdc.unified.analytics.connect.api.input.VisualizationBackgroundDomainRangeInputRepresentation_) ### sfdc.unified.analytics.connect.api.input.BaseVisualizationMapBackgroundStyleInputRepresentation The background style for a visualization map, set by name or URL. One of: `sfdc.unified.analytics.connect.api.input.VisualizationMapBackgroundStyleNameInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationMapBackgroundStyleUrlInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationDataFormatInputRepresentation Input representation for data format in a visualization. * `dateTemplate` (_string_) The template for the date format. * `numberFormatInfo` (_sfdc.unified.analytics.connect.api.input.VisualizationNumberFormatInfoInputRepresentation_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationHeaderMarkEncodingType The encoding type of a header mark in the visualization's visual specification. Type: `string`. Allowed values: `Color`, `Label`, `Tooltip`. ### sfdc.unified.analytics.connect.api.enums.visualization.visualSpec.ConnectVisualizationPositionType Enum for position type in visualization _Available April 2026 and later._ Type: `string`. Allowed values: `End`, `Start`. ### sfdc.unified.analytics.connect.api.input.VisualizationForecastDateDimensionFieldInputRepresentation Specifies the field key for the date dimension used in the forecast visualization. * `fieldKey` (_string_) This key is used to identify and map the date dimension. * `granularity` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastGranularityType_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastPredefinedDateType The predefined date type for the forecast model used in the visualization's visual representation. Type: `string`. Allowed values: `LatestData`. ### sfdc.unified.analytics.connect.api.input.VisualizationForecastIntervalInputRepresentation Forecast interval representation. * `timeUnit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastTimeUnitType_) * `value` (_integer_) The attribute for value. ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineComputationInfoInputRepresentation Computation A computed value source for a reference line in a visualization. * `fieldKey` (_string_) The field key of the reference line. * `function` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineFunctionType_) * `label` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineLabelInputRepresentation_) * `valueType` (_string_, required) The shape of `line` when `valueType` is `Computation`. Allowed values: `Computation`. ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineValueInfoInputRepresentation Value A fixed value source for a reference line in a visualization. * `value` (_any_) The value of the reference line. * `label` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineLabelInputRepresentation_) * `valueType` (_string_, required) The shape of `line` when `valueType` is `Value`. Allowed values: `Value`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisSynchronizationType The axis synchronization type of the visualization's visual specification. Type: `string`. Allowed values: `FullRange`, `None`, `ZeroPosition`. ### sfdc.unified.analytics.connect.api.input.VisualizationAutoAxisRangeStyleInputRepresentation Auto An automatic axis range style for a visualization. * `includeZero` (_boolean_) Whether to include zero in the axis range. * `type` (_string_, required) The shape of `range` when `type` is `Auto`. Allowed values: `Auto`. ### sfdc.unified.analytics.connect.api.input.VisualizationCustomAxisRangeStyleInputRepresentation Custom A custom axis range style for a visualization. * `end` (_sfdc.unified.analytics.connect.api.input.VisualizationAxisCustomRangeExtentInputRepresentation_) * `start` (_sfdc.unified.analytics.connect.api.input.VisualizationAxisCustomRangeExtentInputRepresentation_) * `type` (_string_, required) The shape of `range` when `type` is `Custom`. Allowed values: `Custom`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationAxisTicksInfoInputRepresentation The tick style for a visualization axis, either automatic, fixed, or none. One of: `sfdc.unified.analytics.connect.api.input.VisualizationAutoAxisTicksInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFixedAxisTicksInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationNoneAxisTicksInfoInputRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkConnectorType The mark connector type of the visualization. Type: `string`. Allowed values: `Origami`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationMarksToLabelStyleInputRepresentation Which marks to label in a visualization, either all marks or line ends. One of: `sfdc.unified.analytics.connect.api.input.VisualizationAllMarksToLabelStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationLineEndsMarkToLabelStyleInputRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarkSizeType The mark size type of the visualization's visual specification. Type: `string`. Allowed values: `Percentage`, `Pixel`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationTooltipTextValueInputRepresentation A text value element in a tooltip custom text sequence for a visualization. One of: `sfdc.unified.analytics.connect.api.input.VisualizationBasicTextValueInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldTokenTextValueInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationPropertyTokenTextValueInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationSdmFieldTokenTextValueInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.ContinuousColorAssignmentInputRepresentation Continuous A continuous color assignment for a visualization. * `palette` (_sfdc.unified.analytics.connect.api.input.ContinuousPaletteInputRepresentation_) * `type` (_string_, required) The shape of `colors` when `type` is `Continuous`. Allowed values: `Continuous`. ### sfdc.unified.analytics.connect.api.input.DiscreteColorAssignmentInputRepresentation Discrete A discrete color assignment for a visualization. * `customColors` (_array of sfdc.unified.analytics.connect.api.input.DataValueToColorStringInputRepresentation_) The mapping of data values to colors. * `palette` (_sfdc.unified.analytics.connect.api.input.BaseVisualizationPaletteInputRepresentation_) * `type` (_string_, required) The shape of `colors` when `type` is `Discrete`. Allowed values: `Discrete`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineHorizontalAlignmentType The reference line label's horizontal alignment type of the visualization's visual specification. Type: `string`. Allowed values: `Auto`, `Left`, `Right`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineVerticalAlignmentType The reference line label's vertical alignment type of the visualization's visual specification. Type: `string`. Allowed values: `Auto`, `Bottom`, `Top`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineStyleType The reference line style type of the visualization's visual specification. Type: `string`. Allowed values: `None`, `Solid`. ### sfdc.unified.analytics.connect.api.output.actions.DynamicFlowActionAttributeDataRepresentation Dynamic A dynamically resolved flow action variable that references a field on another widget. * `selectionType` (_sfdc.unified.analytics.connect.api.enums.ConnectDynamicFlowSelectionTypeEnum_) * `widgetField` (_string_) widget field of the widget where dynamic input variable would be referred to * `widgetId` (_string_) widget id of the widget where dynamic input variable would be referred to * `inputType` (_sfdc.unified.analytics.connect.api.enums.ConnectFlowInputTypeEnum_) ### sfdc.unified.analytics.connect.api.output.actions.StaticFlowActionAttributeDataRepresentation Static A flow action variable with a fixed, static value. * `value` (_string_) Static input value * `inputType` (_sfdc.unified.analytics.connect.api.enums.ConnectFlowInputTypeEnum_) ### sfdc.unified.analytics.connect.api.output.actions.MetricDetailsNavigateActionTarget Represents the target for a metric details navigate action destination. * `tokenName` (_string_) Token name that references the metric. ### sfdc.unified.analytics.connect.api.output.VisualizationRelativeDateFilterPeriodRepresentation Representation for a relative date filter period. * `unit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationRelativeDateFilterPeriodUnitType_) * `value` (_integer_) The value offset of the period. ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderColumnsSizingStyleRepresentation A sizing style for header columns in a visualization. * `fieldHeight` (_object_) The height for each field in the header columns. Additional properties: `number (double)`. * `indexHeight` (_number (double)_) The height for the index column. * `width` (_number (double)_) The width of the header columns. ### sfdc.unified.analytics.connect.api.output.VisualizationHeaderRowsSizingStyleRepresentation A sizing style for header rows in a visualization. * `fieldWidth` (_object_) The width for each field in the header rows. Additional properties: `number (double)`. * `height` (_number (double)_) The height of the header rows. * `indexWidth` (_number (double)_) The width for the index row. ### sfdc.unified.analytics.connect.api.output.VisualizationBandingCommonStyleRepresentation Output representation for common banding style in a visualization. * `application` (_sfdc.unified.analytics.connect.api.output.VisualizationBandingApplicationStyleRepresentation_) * `color` (_string_) The color for the banding common style. ### sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockBorderRepresentation Output representation for border/outline properties. * `radius` (_number (double)_) Border corner radius. * `style` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleLineStyleType_) * `width` (_number (double)_) Border width. ### sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockFontRepresentation Output representation for font styling properties. * `family` (_string_) Font family name. * `italic` (_boolean_) Whether text is italic. * `size` (_integer_) Font size in pixels. * `underline` (_boolean_) Whether text is underlined. * `weight` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleFontWeightType_) ### sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockLineRepresentation Output representation for standalone line properties. * `smoothness` (_number (double)_) Line smoothness (0 = sharp corners, 1 = fully smoothed). * `style` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleLineStyleType_) * `width` (_number (double)_) Line width. ### sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockPaddingRepresentation Output representation for padding properties. * `bottom` (_integer_) Bottom padding. * `left` (_integer_) Left padding. * `right` (_integer_) Right padding. * `top` (_integer_) Top padding. ### sfdc.unified.analytics.connect.api.output.VisualizationStyleBlockTextRepresentation Output representation for text layout properties. * `halign` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleTextHorizontalAlignmentType_) * `textDirection` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTextDirectionType_) * `valign` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleTextVerticalAlignmentType_) * `wrap` (_boolean_) Whether text wraps to multiple lines. ### sfdc.unified.analytics.connect.api.output.VisualizationGridBackgroundDomainRepresentation Output representation for grid background domain in a visualization. * `x` (_sfdc.unified.analytics.connect.api.output.VisualizationBackgroundDomainRangeRepresentation_) * `y` (_sfdc.unified.analytics.connect.api.output.VisualizationBackgroundDomainRangeRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationMapBackgroundDomainRepresentation Output representation for map background domain in a visualization. * `latitude` (_sfdc.unified.analytics.connect.api.output.VisualizationBackgroundDomainRangeRepresentation_) * `longitude` (_sfdc.unified.analytics.connect.api.output.VisualizationBackgroundDomainRangeRepresentation_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationMapBackgroundStyleRepresentation A map background style for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationMapBackgroundStyleNameRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationMapBackgroundStyleUrlRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationDataFormatRepresentation Output representation for data format in a visualization. * `dateTemplate` (_string_) The template for the date format. * `numberFormatInfo` (_sfdc.unified.analytics.connect.api.output.VisualizationNumberFormatInfoRepresentation_) ### sfdc.unified.analytics.connect.api.output.VisualizationForecastDateDimensionFieldRepresentation Specifies the field key for the date dimension used in the forecast visualization. * `fieldKey` (_string_) The field key of dimension. * `granularity` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastGranularityType_) ### sfdc.unified.analytics.connect.api.output.VisualizationForecastIntervalRepresentation Forecast interval representation. * `timeUnit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastTimeUnitType_) * `value` (_integer_) The attribute for value. ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineComputationInfoRepresentation Computation A computed value definition for a visualization reference line. * `fieldKey` (_string_) The field key of the reference line. * `function` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineFunctionType_) * `label` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineLabelRepresentation_) * `valueType` (_string_, required) The shape of `endLine` when `valueType` is `Computation`. Allowed values: `Computation`. ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineValueInfoRepresentation Value A fixed-value definition for a visualization reference line. * `value` (_any_) The value of the reference line. * `label` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineLabelRepresentation_) * `valueType` (_string_, required) The shape of `endLine` when `valueType` is `Value`. Allowed values: `Value`. ### sfdc.unified.analytics.connect.api.output.VisualizationAutoAxisRangeStyleRepresentation auto An automatic range style for a visualization axis. * `includeZero` (_boolean_) Whether to include zero in the axis range. * `type` (_string_, required) The shape of `range` when `type` is `auto`. Allowed values: `auto`. ### sfdc.unified.analytics.connect.api.output.VisualizationCustomAxisRangeStyleRepresentation Custom A custom range style for a visualization axis, with defined start and end values. * `end` (_sfdc.unified.analytics.connect.api.output.VisualizationAxisCustomRangeExtentRepresentation_) * `start` (_sfdc.unified.analytics.connect.api.output.VisualizationAxisCustomRangeExtentRepresentation_) * `type` (_string_, required) The shape of `range` when `type` is `Custom`. Allowed values: `Custom`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationAxisTicksInfoRepresentation A tick configuration for a visualization axis. One of: `sfdc.unified.analytics.connect.api.output.VisualizationAutoAxisTicksInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFixedAxisTicksInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationNoneAxisTicksInfoRepresentation`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationMarksToLabelStyleRepresentation A style for labeling marks in a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationAllMarksToLabelStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationLineEndsMarksToLabelStyleRepresentation`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationTooltipTextValueRepresentation A text value in a visualization tooltip. One of: `sfdc.unified.analytics.connect.api.output.VisualizationBasicTextValueRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldTokenTextValueRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationPropertyTokenTextValueRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationSdmFieldTokenTextValueRepresentation`. ### sfdc.unified.analytics.connect.api.output.ContinuousColorAssignmentRepresentation Continuous A continuous color assignment for a visualization. * `palette` (_sfdc.unified.analytics.connect.api.output.ContinuousPaletteRepresentation_) * `type` (_string_, required) The shape of `colors` when `type` is `Continuous`. Allowed values: `Continuous`. ### sfdc.unified.analytics.connect.api.output.DiscreteColorAssignmentRepresentation Discrete A discrete color assignment for a visualization. * `customColors` (_array of sfdc.unified.analytics.connect.api.output.DataValueToColorStringRepresentation_) The mapping of data values to colors. * `palette` (_sfdc.unified.analytics.connect.api.output.BaseVisualizationPaletteRepresentation_) * `type` (_string_, required) The shape of `colors` when `type` is `Discrete`. Allowed values: `Discrete`. ### sfdc.unified.analytics.connect.api.enums.ConnectDynamicFlowSelectionTypeEnum Different selection types for flow dynamic action. Type: `string`. Allowed values: `Result`, `Selection`. ### sfdc.unified.analytics.connect.api.enums.ConnectFlowInputTypeEnum Different input types for flow action. Type: `string`. Allowed values: `Dynamic`, `Static`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationRelativeDateFilterPeriodUnitType The relative date filter period unit type of the visualization's view specification. Type: `string`. Allowed values: `Day`, `Hour`, `Minute`, `Month`, `Quarter`, `Week`, `Year`. ### sfdc.unified.analytics.connect.api.input.VisualizationBandingApplicationStyleInputRepresentation Input representation for banding application style in a visualization. * `level` (_integer_) The banding level for the banding application. * `size` (_integer_) The banding size for the banding application. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleLineStyleType The line or border dash style type for the visualization stylesheet. Type: `string`. Allowed values: `Dashed`, `Dotted`, `Solid`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleFontWeightType The font weight type for the visualization stylesheet. Type: `string`. Allowed values: `Bold`, `Normal`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleTextHorizontalAlignmentType The horizontal text alignment type for the visualization stylesheet. Type: `string`. Allowed values: `Center`, `Left`, `Right`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleTextVerticalAlignmentType The vertical text alignment type for the visualization stylesheet. Type: `string`. Allowed values: `Bottom`, `Middle`, `Top`. ### sfdc.unified.analytics.connect.api.input.VisualizationBackgroundDomainRangeInputRepresentation Input representation for background domain range in a visualization. * `max` (_number (double)_) The maximum value of the domain. * `min` (_number (double)_) The minimum value of the domain. ### sfdc.unified.analytics.connect.api.input.VisualizationMapBackgroundStyleNameInputRepresentation Name A named map background style for a visualization. * `type` (_string_, required) The shape of `style` when `type` is `Name`. Allowed values: `Name`. * `value` (_string_) The style value. ### sfdc.unified.analytics.connect.api.input.VisualizationMapBackgroundStyleUrlInputRepresentation Url A map background style defined by a URL for a visualization. * `type` (_string_, required) The shape of `style` when `type` is `Url`. Allowed values: `Url`. * `value` (_string_) The style value. ### sfdc.unified.analytics.connect.api.input.VisualizationNumberFormatInfoInputRepresentation Input representation for number format info in a visualization. * `decimalPlaces` (_integer_) The number of decimal places. * `displayUnits` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNumberFormatInfoDisplayUnitType_) * `includeThousandSeparator` (_boolean_) Whether to include the thousand separator. * `negativeValuesFormat` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNumberFormatInfoNegativeValuesType_) * `prefix` (_string_) The prefix value. * `suffix` (_string_) The suffix value. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleNumberFormatType_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastGranularityType Granularity level of the forecast in the visualization's visual representation. Type: `string`. Allowed values: `InferFromData`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastTimeUnitType The forecast interval time unit of the visualization's visual specification. Type: `string`. Allowed values: `Days`, `Hours`, `Minutes`, `Months`, `Quarters`, `Weeks`, `Years`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineFunctionType The reference line function type of the visualization's visual specification. Type: `string`. Allowed values: `Avg`, `Max`, `Min`, `Now`, `Sum`, `Today`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationReferenceLineLabelInputRepresentation A label for a reference line in a visualization. One of: `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineComputationLabelInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineCustomLabelInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineNoneLabelInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineValueLabelInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.VisualizationAxisCustomRangeExtentInputRepresentation Input representation for custom range extent in a visualization axis. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisStyleRangeType_) * `value` (_any_) Value for start/end in the custom axis range. ### sfdc.unified.analytics.connect.api.input.VisualizationAutoAxisTicksInfoInputRepresentation Auto Automatic axis ticks for a visualization. * `type` (_string_, required) The shape of `majorTicks` when `type` is `Auto`. Allowed values: `Auto`. ### sfdc.unified.analytics.connect.api.input.VisualizationFixedAxisTicksInfoInputRepresentation Fixed Fixed axis ticks for a visualization. * `dateInfo` (_sfdc.unified.analytics.connect.api.input.VisualizationAxisTicksDateInfoInputRepresentation_) * `interval` (_integer_) The interval at which axis ticks are shown. * `origin` (_string_) The origin of the axis ticks. * `type` (_string_, required) The shape of `majorTicks` when `type` is `Fixed`. Allowed values: `Fixed`. ### sfdc.unified.analytics.connect.api.input.VisualizationNoneAxisTicksInfoInputRepresentation None Hidden axis ticks for a visualization. * `type` (_string_, required) The shape of `majorTicks` when `type` is `None`. Allowed values: `None`. ### sfdc.unified.analytics.connect.api.input.VisualizationAllMarksToLabelStyleInputRepresentation All A style that labels all marks in a visualization. * `type` (_string_, required) The shape of `marksToLabel` when `type` is `All`. Allowed values: `All`. ### sfdc.unified.analytics.connect.api.input.VisualizationLineEndsMarkToLabelStyleInputRepresentation LineEnds A style that labels marks at the ends of lines in a visualization. * `labelEnd` (_boolean_) Whether to label the end of the line. * `labelStart` (_boolean_) Whether to label the start of the line. * `type` (_string_, required) The shape of `marksToLabel` when `type` is `LineEnds`. Allowed values: `LineEnds`. ### sfdc.unified.analytics.connect.api.input.VisualizationBasicTextValueInputRepresentation Text A plain text value in a tooltip text sequence for a visualization. * `value` (_string_) The plain text string. * `properties` (_sfdc.unified.analytics.connect.api.input.VisualizationTextStylePropertiesInputRepresentation_) * `type` (_string_, required) The shape of `customText` when `type` is `Text`. Allowed values: `Text`. ### sfdc.unified.analytics.connect.api.input.VisualizationFieldTokenTextValueInputRepresentation VisualizationFieldToken A visualization field token text value in a tooltip text sequence. * `fieldKey` (_string_) The field key identifying the visualization field. * `properties` (_sfdc.unified.analytics.connect.api.input.VisualizationTextStylePropertiesInputRepresentation_) * `type` (_string_, required) The shape of `customText` when `type` is `VisualizationFieldToken`. Allowed values: `VisualizationFieldToken`. ### sfdc.unified.analytics.connect.api.input.VisualizationPropertyTokenTextValueInputRepresentation PropertyToken A property token text value in a tooltip text sequence for a visualization. * `tokenType` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationPropertyTokenType_) * `properties` (_sfdc.unified.analytics.connect.api.input.VisualizationTextStylePropertiesInputRepresentation_) * `type` (_string_, required) The shape of `customText` when `type` is `PropertyToken`. Allowed values: `PropertyToken`. ### sfdc.unified.analytics.connect.api.input.VisualizationSdmFieldTokenTextValueInputRepresentation SdmFieldToken A semantic model field token text value in a tooltip text sequence. * `apiName` (_string_) The API name of the SDM field. * `tokenType` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSdmFieldTokenType_) * `properties` (_sfdc.unified.analytics.connect.api.input.VisualizationTextStylePropertiesInputRepresentation_) * `type` (_string_, required) The shape of `customText` when `type` is `SdmFieldToken`. Allowed values: `SdmFieldToken`. ### sfdc.unified.analytics.connect.api.input.ContinuousPaletteInputRepresentation Input representation for continuous color palette. * `end` (_string_) The end color for continuous assignment. * `middle` (_string_) The middle color for divergent continuous assignment. * `middleToEndSteps` (_array of string_) The steps between the middle and end colors for divergent continuous assignment. * `start` (_string_) The start color for continuous assignment. * `startToEndSteps` (_array of string_) The steps between the start and end colors for sequential continuous assignment. * `startToMiddleSteps` (_array of string_) The steps between the start and end colors for divergent continuous assignment. ### sfdc.unified.analytics.connect.api.input.DataValueToColorStringInputRepresentation Input representation for data value to color string mapping. * `color` (_string_) The color string. * `value` (_any_) The data value. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationPaletteInputRepresentation The color palette for a visualization, such as a custom palette. One of: `sfdc.unified.analytics.connect.api.input.CustomPaletteInputRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationBandingApplicationStyleRepresentation Output representation for banding application style in a visualization. * `level` (_integer_) The banding level for the banding application. * `size` (_integer_) The banding size for the banding application. ### sfdc.unified.analytics.connect.api.output.VisualizationBackgroundDomainRangeRepresentation Output representation for background domain range in a visualization. * `max` (_number (double)_) The maximum value of the domain. * `min` (_number (double)_) The minimum value of the domain. ### sfdc.unified.analytics.connect.api.output.VisualizationMapBackgroundStyleNameRepresentation Name A named map background style for a visualization. * `type` (_string_, required) The shape of `style` when `type` is `Name`. Allowed values: `Name`. * `value` (_string_) The style value. ### sfdc.unified.analytics.connect.api.output.VisualizationMapBackgroundStyleUrlRepresentation Url A URL-based map background style for a visualization. * `type` (_string_, required) The shape of `style` when `type` is `Url`. Allowed values: `Url`. * `value` (_string_) The style value. ### sfdc.unified.analytics.connect.api.output.VisualizationNumberFormatInfoRepresentation Output representation for number format info in a visualization. * `decimalPlaces` (_integer_) The number of decimal places. * `displayUnits` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNumberFormatInfoDisplayUnitType_) * `includeThousandSeparator` (_boolean_) Whether to include the thousand separator. * `negativeValuesFormat` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNumberFormatInfoNegativeValuesType_) * `prefix` (_string_) The prefix value. * `suffix` (_string_) The suffix value. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleNumberFormatType_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationReferenceLineLabelRepresentation A label for a visualization reference line. One of: `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineComputationLabelRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineCustomLabelRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineNoneLabelRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineValueLabelRepresentation`. ### sfdc.unified.analytics.connect.api.output.VisualizationAxisCustomRangeExtentRepresentation Output representation for custom range extent in a visualization axis. * `type` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisStyleRangeType_) * `value` (_any_) Value for start/end in the custom axis range. ### sfdc.unified.analytics.connect.api.output.VisualizationAutoAxisTicksInfoRepresentation Auto An automatic tick configuration for a visualization axis. * `type` (_string_, required) The shape of `majorTicks` when `type` is `Auto`. Allowed values: `Auto`. ### sfdc.unified.analytics.connect.api.output.VisualizationFixedAxisTicksInfoRepresentation Fixed A fixed tick configuration for a visualization axis, with a defined interval and origin. * `dateInfo` (_sfdc.unified.analytics.connect.api.output.VisualizationAxisTicksDateInfoRepresentation_) * `interval` (_integer_) The interval at which axis ticks are shown. * `origin` (_string_) The origin of the axis ticks. * `type` (_string_, required) The shape of `majorTicks` when `type` is `Fixed`. Allowed values: `Fixed`. ### sfdc.unified.analytics.connect.api.output.VisualizationNoneAxisTicksInfoRepresentation None An axis-tick configuration for a visualization that displays no ticks. * `type` (_string_, required) The shape of `majorTicks` when `type` is `None`. Allowed values: `None`. ### sfdc.unified.analytics.connect.api.output.VisualizationAllMarksToLabelStyleRepresentation All A style for labeling all marks in a visualization. * `type` (_string_, required) The shape of `marksToLabel` when `type` is `All`. Allowed values: `All`. ### sfdc.unified.analytics.connect.api.output.VisualizationLineEndsMarksToLabelStyleRepresentation LineEnds A style for labeling the ends of lines in a visualization. * `labelEnd` (_boolean_) Whether to label the end of the line. * `labelStart` (_boolean_) Whether to label the start of the line. * `type` (_string_, required) The shape of `marksToLabel` when `type` is `LineEnds`. Allowed values: `LineEnds`. ### sfdc.unified.analytics.connect.api.output.VisualizationBasicTextValueRepresentation Text A plain-text value in a visualization tooltip. * `value` (_string_) The plain text string. * `properties` (_sfdc.unified.analytics.connect.api.output.VisualizationTextStylePropertiesRepresentation_) * `type` (_string_, required) The shape of `customText` when `type` is `Text`. Allowed values: `Text`. ### sfdc.unified.analytics.connect.api.output.VisualizationFieldTokenTextValueRepresentation VisualizationFieldToken A field-token text value in a visualization tooltip. * `fieldKey` (_string_) The field key identifying the visualization field. * `properties` (_sfdc.unified.analytics.connect.api.output.VisualizationTextStylePropertiesRepresentation_) * `type` (_string_, required) The shape of `customText` when `type` is `VisualizationFieldToken`. Allowed values: `VisualizationFieldToken`. ### sfdc.unified.analytics.connect.api.output.VisualizationPropertyTokenTextValueRepresentation PropertyToken A property-token text value in a visualization tooltip. * `tokenType` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationPropertyTokenType_) * `properties` (_sfdc.unified.analytics.connect.api.output.VisualizationTextStylePropertiesRepresentation_) * `type` (_string_, required) The shape of `customText` when `type` is `PropertyToken`. Allowed values: `PropertyToken`. ### sfdc.unified.analytics.connect.api.output.VisualizationSdmFieldTokenTextValueRepresentation SdmFieldToken An SDM-field-token text value in a visualization tooltip. * `apiName` (_string_) The API name of the SDM field. * `tokenType` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSdmFieldTokenType_) * `properties` (_sfdc.unified.analytics.connect.api.output.VisualizationTextStylePropertiesRepresentation_) * `type` (_string_, required) The shape of `customText` when `type` is `SdmFieldToken`. Allowed values: `SdmFieldToken`. ### sfdc.unified.analytics.connect.api.output.ContinuousPaletteRepresentation Output representation for continuous color palette. * `end` (_string_) The end color for continuous assignment. * `middle` (_string_) The middle color for divergent continuous assignment. * `middleToEndSteps` (_array of string_) The steps between the middle and end colors for divergent continuous assignment. * `start` (_string_) The start color for continuous assignment. * `startToEndSteps` (_array of string_) The steps between the start and end colors for sequential continuous assignment. * `startToMiddleSteps` (_array of string_) The steps between the start and end colors for divergent continuous assignment. ### sfdc.unified.analytics.connect.api.output.DataValueToColorStringRepresentation Output representation for data value to color string mapping. * `color` (_string_) The color string. * `value` (_any_) The data value. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationPaletteRepresentation A color palette for a visualization. One of: `sfdc.unified.analytics.connect.api.output.CustomPaletteRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNumberFormatInfoDisplayUnitType The display unit type for the number format info in the visualization. Type: `string`. Allowed values: `Auto`, `B`, `G`, `K`, `M`, `None`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationNumberFormatInfoNegativeValuesType The negative value type for the number formats in the visualization. Type: `string`. Allowed values: `Auto`, `MinusAfterNumber`, `MinusAfterSuffix`, `MinusBeforeNumber`, `MinusBeforePrefix`, `Parenthesis`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleNumberFormatType The number format type of the visualization's visual specification. Type: `string`. Allowed values: `Currency`, `CurrencyCustom`, `CurrencyShort`, `Number`, `NumberCustom`, `NumberShort`, `Percentage`, `PercentageCustom`, `PercentageShort`. ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineComputationLabelInputRepresentation Computation A computed label for a reference line in a visualization. * `type` (_string_, required) The shape of `label` when `type` is `Computation`. Allowed values: `Computation`. ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineCustomLabelInputRepresentation Custom A custom label for a reference line in a visualization. * `labelText` (_string_) Label text for the reference line label. * `type` (_string_, required) The shape of `label` when `type` is `Custom`. Allowed values: `Custom`. ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineNoneLabelInputRepresentation None The absence of a label for a reference line in a visualization. * `type` (_string_, required) The shape of `label` when `type` is `None`. Allowed values: `None`. ### sfdc.unified.analytics.connect.api.input.VisualizationReferenceLineValueLabelInputRepresentation Value A value label for a reference line in a visualization. * `type` (_string_, required) The shape of `label` when `type` is `Value`. Allowed values: `Value`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisStyleRangeType The axis range type of the visualization's visual specification. Type: `string`. Allowed values: `Auto`, `Custom`. ### sfdc.unified.analytics.connect.api.input.VisualizationAxisTicksDateInfoInputRepresentation Input representation for date info in axis ticks of a visualization. * `showOnlyDateBoundary` (_boolean_) Whether to show only date axis boundary ticks. * `unit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisTicksDateUnitType_) ### sfdc.unified.analytics.connect.api.input.VisualizationTextStylePropertiesInputRepresentation Input representation for text style properties in a tooltip text value. * `bold` (_boolean_) Whether the text is bold. * `color` (_string_) The text color. * `family` (_string_) The font family. * `horizontalAlign` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleTextHorizontalAlignmentType_) * `italic` (_boolean_) Whether the text is italic. * `size` (_integer_) The font size in points (10-128). * `underline` (_boolean_) Whether the text is underlined. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationPropertyTokenType The type of a property token in a tooltip text sequence. Type: `string`. Allowed values: `DataRefreshTime`, `SdmName`, `VisualizationName`, `VisualizationTitle`, `WorkspaceName`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationSdmFieldTokenType The type of an SDM field token in a tooltip text sequence. Type: `string`. Allowed values: `Parameter`. ### sfdc.unified.analytics.connect.api.input.CustomPaletteInputRepresentation Custom A custom color palette for a visualization. * `colors` (_array of string_) The list of colors in the palette. * `type` (_string_, required) The shape of `palette` when `type` is `Custom`. Allowed values: `Custom`. ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineComputationLabelRepresentation Computation A computed-value label for a visualization reference line. * `type` (_string_, required) The shape of `label` when `type` is `Computation`. Allowed values: `Computation`. ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineCustomLabelRepresentation Custom A custom-text label for a visualization reference line. * `labelText` (_string_) The reference line label text. * `type` (_string_, required) The shape of `label` when `type` is `Custom`. Allowed values: `Custom`. ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineNoneLabelRepresentation None A hidden label for a visualization reference line. * `type` (_string_, required) The shape of `label` when `type` is `None`. Allowed values: `None`. ### sfdc.unified.analytics.connect.api.output.VisualizationReferenceLineValueLabelRepresentation Value A value-based label for a visualization reference line. * `type` (_string_, required) The shape of `label` when `type` is `Value`. Allowed values: `Value`. ### sfdc.unified.analytics.connect.api.output.VisualizationAxisTicksDateInfoRepresentation Output representation for date info in axis ticks of a visualization. * `showOnlyDateBoundary` (_boolean_) Whether to show only date axis boundary ticks. * `unit` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisTicksDateUnitType_) ### sfdc.unified.analytics.connect.api.output.VisualizationTextStylePropertiesRepresentation Output representation for text style properties in a tooltip text value. * `bold` (_boolean_) Whether the text is bold. * `color` (_string_) The text color. * `family` (_string_) The font family. * `horizontalAlign` (_sfdc.unified.analytics.connect.api.enums.ConnectVisualizationStyleTextHorizontalAlignmentType_) * `italic` (_boolean_) Whether the text is italic. * `size` (_integer_) The font size in points (10-128). * `underline` (_boolean_) Whether the text is underlined. ### sfdc.unified.analytics.connect.api.output.CustomPaletteRepresentation Custom A custom color palette for a visualization. * `colors` (_array of string_) The list of colors in the palette. * `type` (_string_, required) The shape of `palette` when `type` is `Custom`. Allowed values: `Custom`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisTicksDateUnitType The date unit type in axis ticks of the visualization's visual specification. Type: `string`. Allowed values: `Day`, `Hour`, `Minutes`, `Month`, `Quarter`, `Seconds`, `Week`, `Year`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationStyleRepresentation Abstract base output representation for style properties common to all visualization layout types. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFlowStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationMapStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationRadialStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationTableStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationVizqlStyleRepresentation`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationLayoutVisualSpecRepresentation A layout-based visual specification for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFlowLayoutVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationMapLayoutVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationRadialLayoutVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationTableLayoutVisualSpecRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationVizqlLayoutVisualSpecRepresentation`. ### sfdc.unified.analytics.connect.api.input.dataAlert.MsTeamsRecipientTypeEnum Type of a Microsoft Teams recipient for a data alert Type: `string`. Allowed values: `SalesforceUser`. ### sfdc.unified.analytics.connect.api.output.download.DownloadDashboardAssetRepresentation DownloadDashboardAsset A downloaded Tableau Next dashboard, including the filters applied to it. * `dashboardFilterSummary` (_string_) Summary of filters applied to this dashboard * `dashboardFilters` (_array of sfdc.unified.analytics.connect.api.output.download.DownloadFilterRepresentation_) List of filters applied to this dashboard * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. ### sfdc.unified.analytics.connect.api.output.BaseAnalyticsRepresentation A Tableau Next asset, identified by an ID, with a name, label, and description. One of: `sfdc.unified.analytics.connect.api.output.AnalyticsGroupRepresentation`, `sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation`, `sfdc.unified.analytics.connect.api.output.AssetReferenceRepresentation`, `sfdc.unified.analytics.connect.api.output.BaseAnalyticsAssetRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationDataSourceRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationViewRepresentation`, `sfdc.unified.analytics.connect.api.output.actions.InteractionRepresentation`, `sfdc.unified.analytics.connect.api.output.dashboard.DashboardLayoutPageRepresentation`, `sfdc.unified.analytics.connect.api.output.dashboard.DashboardLayoutRepresentation`, `sfdc.unified.analytics.connect.api.output.dashboard.DashboardPageWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetDynamicTokenRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.WidgetDataSourceRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationItemRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationWidgetLabelStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceAssetRepresentation`. ### sfdc.unified.analytics.connect.api.input.follow.FollowerInputRepresentation Follower input representation in unified analytics. * `followedAssetId` (_string_) Followed asset ID * `followerId` (_string_) Follower ID * `followerType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowerTypeEnum_) * `limit` (_integer_) Limit parameter value * `offset` (_integer_) Offset parameter value ### sfdc.unified.analytics.connect.api.output.TextWidgetInsertTokenRepresentation Token information representation * `label` (_string_) Label of the token * `name` (_string_) Name of the token ### sfdc.unified.analytics.connect.api.enums.dataorchestration.DataConnectionFilterKeyEnum DataConnection Filter Keys Type: `string`. Allowed values: `ConnectionStatuses`, `ConnectorTypes`. ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertBriefContentInputRepresentation Data alert content generated as a brief from one or more semantic data models, guided by a set of generation instructions. * `modelApiNameOrIdList` (_array of string_) Ids or API names of the semantic data models used to generate the brief * `skillInstruction` (_string_) Extensible JSON document of LLM instructions used to generate the brief ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertMetricContentInputRepresentation Data alert content sourced from a specified metric, with an accompanying instruction for the alert message. * `instruction` (_string_) input string instruction * `modelApiNameOrId` (_array of string_) Id or API name of the semantic data model ### sfdc.unified.analytics.connect.api.output.download.DownloadSubmetricAssetRepresentation DownloadSubmetricAsset A downloaded submetric, including its title, value, change, sentiment, goal status, and applied filters. * `metricBadge` (_sfdc.unified.analytics.connect.api.output.download.MetricBadgeRepresentation_) * `metricChange` (_string_) text indicating what has changed in submetric data * `metricFilterSummary` (_string_) user-facing label containing time range and other filters (if any) applied to this submetric * `metricFilters` (_array of sfdc.unified.analytics.connect.api.output.download.DownloadFilterRepresentation_) applied submetric filters * `metricGoalStatus` (_string_) Label summarizing goal status and progress. * `metricInsight` (_string_) submetric insight text * `metricSentiment` (_string_) sentiment associated with metric change - 'positive', 'negative', 'neutral' * `metricTitle` (_string_) title of the submetric * `metricValue` (_string_) top level submetric value * `parentMetricId` (_string (Id)_) parentMetricId of the submetric * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationTextValueType The type of a text value segment in a tooltip text sequence. Type: `string`. Allowed values: `PropertyToken`, `SdmFieldToken`, `Text`, `VisualizationFieldToken`. ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertBeaconReportContentInputRepresentation Data alert content that delivers a generated Beacon Report, guided by a set of generation instructions. * `skillInstruction` (_string_) Extensible JSON document of LLM instructions used to generate the Beacon Report ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertEmailRecipientsInputRepresentation A list of email recipients for a data alert, specified as user IDs or group IDs. * `recipients` (_array of string_) email addresses ### sfdc.unified.analytics.connect.api.input.common.filters.UnifiedSemanticFilterMeasureCriteriaInputRepresentation Input representation for unified filter measure criteria _Available April 2026 and later._ * `unifiedFilter` (_sfdc.unified.analytics.connect.api.input.common.filters.UnifiedSemanticFilterInputRepresentation_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationPaletteType The palette type for discrete color assignment in a visualization. Type: `string`. Allowed values: `Custom`. ### sfdc.unified.analytics.connect.api.enums.agent.AgentLlmConfigurationTypeEnum Type of agent LLM configuration metadata Type: `string`. Allowed values: `ReasoningMode`. ### sfdc.unified.analytics.connect.api.enums.ConnectMapPositionalType The type of map positional. Type: `string`. Allowed values: `Geocoded`, `Xy`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertEveryNMinutesScheduleRepresentation A schedule for a data alert that fires every N minutes, where N is the configured minute-level frequency. * `minuteLevelFrequency` (_integer_) run the evaluation every n minutes ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertDailyScheduleInputRepresentation A daily schedule for a data alert. ### sfdc.unified.analytics.connect.api.output.common.filters.UnifiedSemanticFilterRepresentation Output representation for unified filter _Available April 2026 and later._ * `fields` (_array of sfdc.unified.analytics.connect.api.output.common.filters.UnifiedSemanticFilterFieldRepresentation_) The list of fields for the unified filter * `includeNulls` (_boolean_) Whether to include null values in the filter results * `measureCriteria` (_sfdc.unified.analytics.connect.api.output.common.filters.UnifiedSemanticFilterMeasureCriteriaRepresentation_) * `operator` (_sfdc.semantic.authoring.connect.api.enums.SemanticFilterOperatorTypeEnum_) * `topBottomCriteria` (_sfdc.unified.analytics.connect.api.output.common.filters.UnifiedSemanticFilterTopBottomCriteriaRepresentation_) * `values` (_array of any_) The values for the unified filter ### sfdc.unified.analytics.connect.api.output.common.filters.UnifiedSemanticFilterMeasureCriteriaRepresentation Representation for unified filter measure criteria _Available April 2026 and later._ * `unifiedFilter` (_sfdc.unified.analytics.connect.api.output.common.filters.UnifiedSemanticFilterRepresentation_) ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineValueType The reference line value type of the visualization's visual specification. Type: `string`. Allowed values: `Computation`, `Value`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineType The reference line type of the visualization's visual specification. Type: `string`. Allowed values: `Band`, `Line`. ### sfdc.unified.analytics.connect.api.input.share.UserOrGroupSetupRecordShareInputRepresentation User Or Group Setup Record Share Input Representation _Available April 2026 and later._ * `filterBySetupObjectType` (_array of sfdc.unified.analytics.connect.api.enums.share.SetupObjectTypeEnum_) The setup object types to filter the request by * `limit` (_integer_) The limit to use for paginated results * `offset` (_integer_) The offset to use for paginating the results * `searchTerm` (_string_) Search term to filter assets by label * `userOrGroupId` (_string_) The ID of the user or group whose share information is being requested ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertMsTeamsRecipientInputRepresentation Single Microsoft Teams recipient for Data alerts. Contains user or group Id and type. * `recipient` (_string_) group or user Id * `recipientType` (_sfdc.unified.analytics.connect.api.input.dataAlert.MsTeamsRecipientTypeEnum_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationRangeFilterInfoRepresentation Range A range-based filter for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationGreaterThanFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationLessThanFilterInfoRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationRangeFilterInfoRepresentation`. ### sfdc.unified.analytics.connect.api.output.download.DownloadVisualizationWidgetAssetRepresentation DownloadVisualizationWidgetAsset A downloaded visualization widget, including the filters applied to it. * `filterSummary` (_string_) user-facing label containing filters (if any) applied to this viz widget * `filters` (_array of sfdc.unified.analytics.connect.api.output.download.DownloadFilterRepresentation_) applied viz widget filters * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. ### sfdc.unified.analytics.connect.api.enums.common.filters.ConnectUnifiedSemanticFilterNullValuesPositionType The position of null values in ordering for unified semantic filter top/bottom criteria _Available April 2026 and later._ Type: `string`. Allowed values: `NullsFirst`, `NullsLast`, `Unspecified`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertDailyScheduleRepresentation A daily schedule for a data alert. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationForecastModelType The forecast model type used in the visualization's visual representation. Type: `string`. Allowed values: `HoltWinters`, `RidgeRegression`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationReferenceLineLabelType The reference line label type of the visualization's visual specification. Type: `string`. Allowed values: `Computation`, `Custom`, `None`, `Value`. ### sfdc.unified.analytics.connect.api.enums.dataorchestration.DataTransformLastRunTimeRangeEnum DataTransform Last Run Time Range Type: `string`. Allowed values: `Last120Days`, `Last1Hour`, `Last24Hours`, `Last30Days`, `Last7Days`, `Last90Days`. ### sfdc.unified.analytics.connect.api.output.dataorchestration.DataLakeObjectAssetOutputRepresentation A data lake object asset in data orchestration, including its connection and data stream. * `connection` (_sfdc.unified.analytics.connect.api.output.dataorchestration.DataOrchestrationConnectionEnrichmentRepresentation_) * `datastream` (_sfdc.unified.analytics.connect.api.output.dataorchestration.DataOrchestrationDatastreamEnrichmentRepresentation_) ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertSlackRecipientRepresentation Represents a single Slack recipient for a data alert * `recipient` (_string_) Slack recipient id * `recipientType` (_sfdc.unified.analytics.connect.api.input.dataAlert.SlackRecipientTypeEnum_) ### sfdc.unified.analytics.connect.api.output.AnalyticsGroupRepresentation AnalyticsGroup A Tableau Next group. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) Created date of the asset * `numGroupMembers` (_integer_, nullable) The number of users in the group. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. ### sfdc.unified.analytics.connect.api.output.download.DownloadFilterOperatorRepresentation Metadata of the operator of a filter applied to a download asset * `label` (_string_) filter operator label * `name` (_string_) filter operator enum name ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertNotificationRecipientsInputRepresentation A list of notification recipients for a data alert, specified as user or group IDs. * `recipients` (_array of string_) group or user Ids ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationColorAssignmentType The color assignment type in a visualization. Type: `string`. Allowed values: `Continuous`, `Discrete`. ### sfdc.unified.analytics.connect.api.output.dataorchestration.DataTransformAssetOutputRepresentation A data transform asset in data orchestration, including its run frequency, last run status, and target object. * `frequency` (_string_) Run frequency * `lastRunStatus` (_string_) Last run status * `lastRunTime` (_string (date-time)_) Last run time * `targetObject` (_string_) Target object name * `transformStatus` (_string_) Transform status * `type` (_string_) Transform type ### sfdc.unified.analytics.connect.api.input.dataAlert.InsightTypeEnum Enum for different insight types Type: `string`. Allowed values: `Forecast`, `GoalProgress`, `PaceToGoal`, `Popc`, `RecordLevelOutliers`, `RiskyMonopoly`, `Threshold`, `Unspecified`, `UnusualChange`. ### sfdc.unified.analytics.connect.api.enums.GranteeTypeEnum Grantee Type Type: `string`. Allowed values: `Group`, `User`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertMetricContentRepresentation Data alert content sourced from a specified metric, with an accompanying instruction for generating the alert message. * `instruction` (_string_) Instructions to generate notification content * `modelApiNameOrId` (_array of string_) Id or API name of the semantic data model ### sfdc.unified.analytics.connect.api.input.follow.FollowedAssetInputRepresentation Followed asset input representation in unified analytics. * `assetsOrderBy` (_string_) Returned assets orderBy parameter value * `followedAssetType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowedAssetTypeEnum_) * `followerId` (_string_) Follower ID * `limit` (_integer_) Limit parameter value * `offset` (_integer_) Offset parameter value * `sortOrder` (_string_) Returned assets sortOrder parameter value ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMapBackgroundStyleType The style type of the visualization map background. Type: `string`. Allowed values: `Name`, `Url`. ### sfdc.unified.analytics.connect.api.output.TextWidgetInsertRepresentation Representation for insert token operation * `token` (_sfdc.unified.analytics.connect.api.output.TextWidgetInsertTokenRepresentation_) ### sfdc.unified.analytics.connect.api.enums.VizCaptureModeEnum Visualization capture mode for the Image API Type: `string`. Allowed values: `Default`, `HeadlessCapture`, `HtmlBundleCapture`. ### sfdc.unified.analytics.connect.api.enums.dataorchestration.DataLakeObjectFilterKeyEnum DataLakeObject Filter Keys Type: `string`. Allowed values: `ConnectionNames`, `ConnectorTypes`, `DloStatuses`, `LastRefreshStatuses`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertNotificationRecipientsRepresentation A list of notification recipients for a data alert. * `recipients` (_array of string_) list of notification recipients ### sfdc.unified.analytics.connect.api.input.BaseVisualizationStyleInputRepresentation Abstract base input representation for style properties common to all visualization layout types. One of: `sfdc.unified.analytics.connect.api.input.VisualizationFlowStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationMapStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationRadialStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationTableStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationVizqlStyleInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetStylesInputRepresentation Widget common styles input representation in unified analytics One of: `sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetStylesInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.container.ContainerWidgetStylesInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.filter.FilterWidgetStylesInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.image.ImageStylesInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.metric.MetricWidgetStylesInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.ParameterWidgetStylesInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.summary.SummaryWidgetStylesInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetStylesInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.visualization.VisualizationStylesInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationRangeFilterInfoInputRepresentation Range A range, greater-than, or less-than filter for a visualization. One of: `sfdc.unified.analytics.connect.api.input.VisualizationGreaterThanFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationLessThanFilterInfoInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationRangeFilterInfoInputRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationMarksToLabelType The marks to label type of the visualization's visual specification. Type: `string`. Allowed values: `All`, `LineEnds`. ### sfdc.unified.analytics.connect.api.input.follow.FollowedAssetRefInputRepresentation Followed asset ref input representation in unified analytics. _Available April 2026 and later._ * `assetsOrderBy` (_sfdc.unified.analytics.connect.api.resource.follow.OrderBy_) * `followedAssetType` (_sfdc.unified.analytics.connect.api.enums.follow.AnalyticsFollowedAssetTypeEnum_) * `followerId` (_string_) Follower ID * `limit` (_integer_) Limit parameter value * `offset` (_integer_) Offset parameter value * `sortOrder` (_sfdc.unified.analytics.connect.api.resource.follow.SortOrder_) ### sfdc.unified.analytics.connect.api.output.analyticsLibrary.AnalyticsLibraryImageRepresentation AnalyticsLibrary Image reference representation * `url` (_string (url)_) Url path to retrieve image ### sfdc.unified.analytics.connect.api.input.BaseAnalyticsInputRepresentation A base object containing the ID, name, label, and description for a Tableau Next analytics asset. One of: `sfdc.unified.analytics.connect.api.input.AssetReferenceInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationDataSourceInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationViewInputRepresentation`, `sfdc.unified.analytics.connect.api.input.actions.InteractionInputRepresentation`, `sfdc.unified.analytics.connect.api.input.dashboard.DashboardInputRepresentation`, `sfdc.unified.analytics.connect.api.input.dashboard.DashboardLayoutInputRepresentation`, `sfdc.unified.analytics.connect.api.input.dashboard.DashboardLayoutPageInputRepresentation`, `sfdc.unified.analytics.connect.api.input.dashboard.DashboardPageWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetDynamicTokenInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationItemInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationWidgetLabelStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.workspace.WorkspaceInputRepresentation`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertRawValueRepresentation An operand for a data alert condition, specified as a literal value with an explicit data type. * `dataType` (_sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertDataTypeEnum_) * `value` (_string_) Raw value ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertWeeklyScheduleInputRepresentation A weekly schedule for a data alert that fires on selected days of the week. * `daysOfWeek` (_array of sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertDayEnum_) days of the week to receive data alerts ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertNoOpReceiversInputRepresentation A no-op receiver for a data alert, meaning notifications are not delivered anywhere. ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertSlackRecipientInputRepresentation Single Slack recipient for Data alerts. Contains user or group Id and type. * `recipient` (_string_) group or user Id * `recipientType` (_sfdc.unified.analytics.connect.api.input.dataAlert.SlackRecipientTypeEnum_) ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertEmailRecipientsRepresentation A list of email recipients for a data alert. * `recipients` (_array of string_) list of Email recipients ### sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetStylesRepresentation Represents widget common styles representation in unified analytics. One of: `sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetStylesRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.container.ContainerWidgetStylesRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.filter.FilterWidgetStylesRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.image.ImageWidgetStylesRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.metric.MetricWidgetStylesRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.ParameterWidgetStylesRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.summary.SummaryWidgetStylesRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetStylesRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.visualization.VisualizationWidgetStylesRepresentation`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationFieldSimpleQuickTableCalcRepresentation A simple quick table calculation for a visualization field. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcDifferenceRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcPercentDifferenceRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcPercentOfTotalRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningAvgRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningMaxRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningMinRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldSimpleQuickTableCalcRunningSumRepresentation`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertMetricValueRepresentation An operand for a data alert condition, based on the value of a specified metric. * `factKey` (_string_) fact key * `filterContext` (_array of sfdc.unified.analytics.connect.api.output.follow.UnifiedFilterRepresentation_) filter context * `insightType` (_sfdc.unified.analytics.connect.api.input.dataAlert.InsightTypeEnum_) * `metricId` (_string_) metric or sub-metric Id * `modelApiNameOrId` (_string_) Id or API name of the semantic data model * `params` (_object_) additional metric params Additional properties: `string`. * `timeContext` (_sfdc.unified.analytics.connect.api.output.follow.UnifiedFilterRepresentation_) ### sfdc.unified.analytics.connect.api.input.download.DownloadVisualizationWidgetAssetInputRepresentation Identifies a visualization widget to download, by its dashboard, custom view, and widget ID. * `customViewId` (_string_) Custom View ID of the dashboard * `dashboardName` (_string_) API name for the dashboard * `widgetId` (_string_) ID of a widget within a dashboard ### sfdc.unified.analytics.connect.api.input.BaseVisualizationFieldOrderedQuickTableCalcInputRepresentation An ordered quick table calculation for a visualization field, computed according to a configurable sort order. One of: `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcPercentileInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankDenseInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankModifiedInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldOrderedQuickTableCalcRankUniqueInputRepresentation`. ### sfdc.unified.analytics.connect.api.output.dataorchestration.DataConnectionAssetOutputRepresentation A data connection asset in data orchestration, including its connector type and the number of dependent assets. * `connectorType` (_string_) Connector type * `dependentAssetCount` (_integer_) Count of assets that depend on this connection * `lastModified` (_string (date-time)_) Last modified date ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationAxisTicksType The axis ticks type of the visualization's visual specification. Type: `string`. Allowed values: `Auto`, `Fixed`, `None`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertBeaconReportContentRepresentation Data alert content that delivers a generated Beacon Report, guided by a set of generation instructions. * `skillInstruction` (_string_) Extensible JSON document of LLM instructions used to generate the Beacon Report ### sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetTextStylesInputRepresentation Common text style input representation for list widget label or value One of: `sfdc.unified.analytics.connect.api.input.widgets.filter.ListFilterWidgetTextStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.InputParameterWidgetTextStyleInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.ListParameterWidgetTextStyleInputRepresentation`. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationFieldMovingCalculationQuickTableCalcInputRepresentation A moving quick table calculation for a visualization field, computed over a range of preceding and following values. One of: `sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingAverageInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingMaxInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingMinInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationFieldMovingCalculationQuickTableCalcMovingSumInputRepresentation`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationRepresentation BaseVisualization A Tableau Next visualization, along with its data source, permissions, and workspace. One of: `sfdc.unified.analytics.connect.api.output.VisualizationRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationShallowRepresentation`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertMsTeamsRecipientsRepresentation A list of Microsoft Teams recipients for a data alert, each with a recipient type. * `recipients` (_array of sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertMsTeamsRecipientRepresentation_) list of Microsoft Teams recipients with their types ### sfdc.unified.analytics.connect.api.enums.dataorchestration.DataTransformFilterKeyEnum DataTransform Filter Keys Type: `string`. Allowed values: `Frequencies`, `LastRunStatuses`, `LastRunTimeRange`, `TransformStatuses`. ### sfdc.unified.analytics.connect.api.input.download.DownloadDashboardAssetInputRepresentation Identifies a Tableau Next dashboard to download, by its API name and an optional custom view. * `customViewId` (_string_) Custom view ID * `dashboardName` (_string_) Custom view ID ### sfdc.unified.analytics.connect.api.output.download.MetricBadgeRepresentation Metric Badge _Available April 2026 and later._ * `backgroundColor` (_string_) Color of badge in RGB format e.g. rgb(248, 26, 92), which may be user-defined in the case of goals * `color` (_string_) Text color of label inside of badge in RGB format e.g. rgb(248, 26, 92), which may be user-defined in the case of goals * `label` (_string_) Label displayed inside of badge - this is either trend sentiment (High, Low, Expected) or user-defined goal name ### sfdc.unified.analytics.connect.api.input.download.DownloadSubmetricAssetInputRepresentation Identifies a submetric to download, by its semantic data model ID, capture mode, and time range. * `captureMode` (_shared.analytics.platform.api.enums.TuaSubMetricCaptureMode_) * `sdmId` (_string (Id)_) Semantic data model ID * `timeRange` (_string_) Time Range ### sfdc.unified.analytics.connect.api.output.download.DownloadVisualizationAssetRepresentation DownloadVisualizationAsset A downloaded Tableau Next visualization. * `description` (_string_) The description of the asset. * `id` (_string (Id)_) The database record ID of the asset. * `label` (_string_) The label of the asset. * `name` (_string_) The name of the asset. * `createdBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `createdDate` (_string (date-time)_) The created date of the asset. * `lastModifiedBy` (_sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) * `lastModifiedDate` (_string (date-time)_) The last modified date of the asset. ### sfdc.unified.analytics.connect.api.input.BaseVisualizationByFieldSortInputRepresentation Field A sort of a visualization by a specified field. One of: `sfdc.unified.analytics.connect.api.input.VisualizationFieldSortInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationNestedSortInputRepresentation`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertWeeklyScheduleRepresentation A weekly schedule for a data alert that fires on selected days of the week. * `daysOfWeek` (_array of sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertDayEnum_) Days of the week for the schedule ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertRawValueInputRepresentation An operand for a data alert condition, specified as a literal value with an explicit data type. * `dataType` (_sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertDataTypeEnum_) * `value` (_string_) raw value of the operand ### sfdc.unified.analytics.connect.api.input.BaseVisualizationLayoutVisualSpecInputRepresentation The layout specification for a visualization, including its legends and stylesheet. One of: `sfdc.unified.analytics.connect.api.input.VisualizationFlowLayoutVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationMapLayoutVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationRadialLayoutVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationTableLayoutVisualSpecInputRepresentation`, `sfdc.unified.analytics.connect.api.input.VisualizationVizqlLayoutVisualSpecInputRepresentation`. ### sfdc.unified.analytics.connect.api.output.BaseVisualizationFieldOrderedQuickTableCalcRepresentation An ordered quick table calculation for a visualization field, computed according to a configurable sort order. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcPercentileRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankDenseRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankModifiedRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldOrderedQuickTableCalcRankUniqueRepresentation`. ### sfdc.unified.analytics.connect.api.output.common.filters.UnifiedSemanticFilterFieldRepresentation Representation for unified filter field _Available April 2026 and later._ * `expression` (_string_) The expression * `model` (_string_) The model field reference ### sfdc.unified.analytics.connect.api.output.BaseVisualizationFieldMovingCalculationQuickTableCalcRepresentation A moving quick table calculation for a visualization field, computed over a range of preceding and following values. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingAverageRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingMaxRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingMinRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationFieldMovingCalculationQuickTableCalcMovingSumRepresentation`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationBackgroundType The background type of the visualization. Type: `string`. Allowed values: `Blank`, `Grid`, `Map`. ### sfdc.unified.analytics.connect.api.input.common.filters.UnifiedSemanticFilterFieldInputRepresentation Input representation for unified filter field _Available April 2026 and later._ * `expression` (_string_) The expression * `model` (_string_) The model field reference ### sfdc.unified.analytics.connect.api.output.dataorchestration.DataOrchestrationConnectionEnrichmentRepresentation Connection Enrichment Representation _Available April 2026 and later._ * `connectorType` (_string_) Connector type * `developerName` (_string_) Connection developer name * `id` (_string_) Connection ID * `isTabNextAsset` (_boolean_) Whether the connection is present in any workspace * `masterLabel` (_string_) Connection master label ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertMsTeamsRecipientRepresentation Represents a single Microsoft Teams recipient for a data alert * `recipient` (_string_) Microsoft Teams recipient id * `recipientType` (_sfdc.unified.analytics.connect.api.input.dataAlert.MsTeamsRecipientTypeEnum_) ### sfdc.unified.analytics.connect.api.output.BaseVisualizationByFieldSortRepresentation Field A sort by field for a visualization. One of: `sfdc.unified.analytics.connect.api.output.VisualizationFieldSortRepresentation`, `sfdc.unified.analytics.connect.api.output.VisualizationNestedSortRepresentation`. ### sfdc.unified.analytics.connect.api.output.dataorchestration.DataOrchestrationDatastreamEnrichmentRepresentation Datastream Enrichment Representation _Available April 2026 and later._ * `lastRefreshStatus` (_string_) Last refresh status * `lastRefreshTime` (_string_) Last refresh time (ISO 8601 format) * `streamType` (_string_) Stream type ### sfdc.unified.analytics.connect.api.input.share.SetupRecordShareInputRepresentation Shared Record Input Item Representation _Updated April 2026: added `accessTypeFilter`, `filterByRecipientType`, `recipientSearchTerm`._ * `accessTypeFilter` (_array of sfdc.unified.analytics.connect.api.enums.share.SetupObjectAccessTypeEnum_) Access Type Filter _Available April 2026 and later._ * `filterByRecipientType` (_array of sfdc.unified.analytics.connect.api.enums.share.SetupObjectRecipientTypeEnum_) Recipients Type Filter _Available April 2026 and later._ * `limit` (_integer_) Limit parameter value * `offset` (_integer_) Offset parameter value * `orderBy` (_sfdc.unified.analytics.connect.api.enums.share.SetupRecordShareOrderByEnum_) * `recipientSearchTerm` (_string_) Recipient search term _Available April 2026 and later._ * `recordId` (_string_) Id of the record * `sortOrder` (_string_) Sort Order value, default is descending * `userOrGroupId` (_string_) Id of the User/Group ### sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetParametersRepresentation Represents widget common parameter representation in unified analytics. One of: `sfdc.unified.analytics.connect.api.output.widgets.button.ButtonWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.container.ContainerWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.filter.BaseFilterWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.image.ImageWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.lightning.AnlytLightningCompWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.metric.MetricWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.navigation.NavigationWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.BaseParameterWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.summary.SummaryWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.text.TextWidgetParametersRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.visualization.VisualizationWidgetParametersRepresentation`. ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertSlackRecipientsInputRepresentation A list of Slack recipients for a data alert, each with a recipient type. * `recipients` (_array of sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertSlackRecipientInputRepresentation_) list of Slack recipients with their types ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertDataTypeEnum Enum for different data types supported. Type: `string`. Allowed values: `Boolean`, `Number`, `Percent`, `Text`. ### sfdc.unified.analytics.connect.api.input.common.filters.UnifiedSemanticFilterInputRepresentation Input representation for unified filter _Available April 2026 and later._ * `fields` (_array of sfdc.unified.analytics.connect.api.input.common.filters.UnifiedSemanticFilterFieldInputRepresentation_) The list of fields for the unified filter * `includeNulls` (_boolean_) For In operator: set to true if values include null, otherwise undefined. For NotIn operator: set to false if values include null, otherwise undefined. * `measureCriteria` (_sfdc.unified.analytics.connect.api.input.common.filters.UnifiedSemanticFilterMeasureCriteriaInputRepresentation_) * `operator` (_sfdc.semantic.authoring.connect.api.enums.SemanticFilterOperatorTypeEnum_) * `topBottomCriteria` (_sfdc.unified.analytics.connect.api.input.common.filters.UnifiedSemanticFilterTopBottomCriteriaInputRepresentation_) * `values` (_array of any_) The values for the unified filter ### sfdc.unified.analytics.connect.api.input.common.filters.UnifiedSemanticFilterTopBottomCriteriaInputRepresentation Input representation for unified filter top/bottom criteria _Available April 2026 and later._ * `expression` (_string_) The expression to order by for top/bottom determination * `isTop` (_boolean_) Whether this is a top or bottom filter * `nullValuesPosition` (_sfdc.unified.analytics.connect.api.enums.common.filters.ConnectUnifiedSemanticFilterNullValuesPositionType_) * `topBottomLimit` (_integer_) The limit for top/bottom filtering ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertBriefContentRepresentation Data alert content generated as a brief from one or more semantic data models, guided by a set of generation instructions. * `modelApiNameOrIdList` (_array of string_) Ids or API names of the semantic data models used to generate the brief * `skillInstruction` (_string_) Extensible JSON document of LLM instructions used to generate the brief ### sfdc.unified.analytics.connect.api.input.widgets.AnalyticsWidgetParametersInputRepresentation Widget parameter input representation in unified analytics One of: `sfdc.unified.analytics.connect.api.input.widgets.button.ButtonWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.container.ContainerWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.filter.BaseFilterWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.image.ImageWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.lightning.AnlytLightningCompWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.metric.MetricWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.navigation.NavigationWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.parameter.BaseParameterWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.summary.SummaryWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.text.TextWidgetParametersInputRepresentation`, `sfdc.unified.analytics.connect.api.input.widgets.visualization.VisualizationWidgetParametersInputRepresentation`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertSlackRecipientsRepresentation A list of Slack recipients for a data alert, each with a recipient type. * `recipients` (_array of sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertSlackRecipientRepresentation_) list of Slack recipients with their types ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertMsTeamsRecipientsInputRepresentation A list of Microsoft Teams recipients for a data alert, each with a recipient type. * `recipients` (_array of sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertMsTeamsRecipientInputRepresentation_) list of Microsoft Teams recipients with their types ### sfdc.unified.analytics.connect.api.enums.ConnectNavigateActionDestinationTypeEnum Different navigate action types. Type: `string`. Allowed values: `Dashboard`, `MetricDetails`, `Page`, `Url`. ### sfdc.unified.analytics.connect.api.enums.ConnectVisualizationFieldTableCalcComputeUsingType The computation method for a table calculation on a visualization field. Type: `string`. Allowed values: `Cell`, `PaneAcross`, `PaneAcrossThenDown`, `PaneDown`, `PaneDownThenAcross`, `TableAcross`, `TableAcrossThenDown`, `TableDown`, `TableDownThenAcross`. ### sfdc.unified.analytics.connect.api.output.widgets.AnalyticsWidgetTextStylesRepresentation Common text style representation for list widget label or value One of: `sfdc.unified.analytics.connect.api.output.widgets.filter.ListFilterWidgetTextStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.InputParameterWidgetTextStyleRepresentation`, `sfdc.unified.analytics.connect.api.output.widgets.parameter.ListParameterWidgetTextStyleRepresentation`. ### sfdc.unified.analytics.connect.api.output.dataAlert.DataAlertNoOpReceiversRepresentation A no-op receiver for a data alert, meaning notifications are not delivered anywhere. ### sfdc.unified.analytics.connect.api.input.download.DownloadEphemeralVisualizationAssetInputRepresentation Identifies an ephemeral, unsaved Tableau Next visualization to download, by its answer artifacts and visualization metadata. * `answerArtifacts` (_string_) Answer artifacts JSON for the ephemeral visualization * `visualizationMetadata` (_string_) Visualization metadata JSON for the ephemeral visualization ### sfdc.unified.analytics.connect.api.input.download.DownloadVisualizationAssetInputRepresentation Identifies a Tableau Next visualization to download, by its API name and capture mode. * `accessToken` (_string_) Access token for API calls (required for HeadlessCapture and HtmlBundleCapture modes). POC only - will be replaced with proper authentication. * `visualizationName` (_string_) API name for the visualization * `vizCaptureMode` (_sfdc.unified.analytics.connect.api.enums.VizCaptureModeEnum_) ### sfdc.unified.analytics.connect.api.input.dataAlert.SlackRecipientTypeEnum Type of a Slack recipient for a data alert Type: `string`. Allowed values: `SalesforceUser`. ### sfdc.unified.analytics.connect.api.output.analyticsLibrary.AnalyticsLibraryTemplateRepresentation A preview of a dashboard template in the analytics library, including its badge and preview images. * `templateBadge` (_string_) The badge icon configured for template * `templatePreviews` (_array of string_) The preview images configured for the template ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertEveryNMinutesScheduleInputRepresentation A schedule for a data alert that fires every N minutes, where N is the configured minute-level frequency. * `minuteLevelFrequency` (_integer_) run the evaluation every n minutes ### sfdc.unified.analytics.connect.api.output.download.DownloadFilterRepresentation Metadata of a filter applied to a download asset * `field` (_sfdc.unified.analytics.connect.api.output.download.DownloadFilterFieldRepresentation_) * `operator` (_sfdc.unified.analytics.connect.api.output.download.DownloadFilterOperatorRepresentation_) * `value` (_string_) filter value(s) for this filter ### sfdc.unified.analytics.connect.api.output.usersQuery.AnalyticsUsersFromProdOrgQueryResultsRepresentation Results of Users Query from the production org queried from the personal org _Available April 2026 and later._ * `items` (_array of sfdc.unified.analytics.connect.api.output.AnalyticsUserRepresentation_) The content of the page. * `nextOffset` (_integer_) The offset of the next page. * `queryKey` (_string_) The query key to help in caching the results. * `size` (_integer_) The size of the page. ### sfdc.unified.analytics.connect.api.input.widgets.filter.FilterDetailsInputRepresentation Filter details input representation _Available April 2026 and later._ * `fieldName` (_string_) Filter field name. * `operator` (_sfdc.unified.analytics.connect.api.enums.FilterOperatorType_) * `values` (_any_) Filter values. ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertMetricValueInputRepresentation An operand for a data alert condition, based on the value of a specified metric. * `factKey` (_string_) fact key * `filterContext` (_array of sfdc.unified.analytics.connect.api.input.common.UnifiedFilterInputRepresentation_) filter context * `insightType` (_sfdc.unified.analytics.connect.api.input.dataAlert.InsightTypeEnum_) * `metricId` (_string_) metric or sub-metric Id * `modelApiNameOrId` (_string_) Id or API name of the semantic data model * `params` (_object_) additional metric params Additional properties: `string`. * `timeContext` (_sfdc.unified.analytics.connect.api.input.common.UnifiedFilterInputRepresentation_) ### sfdc.unified.analytics.connect.api.output.common.filters.UnifiedSemanticFilterTopBottomCriteriaRepresentation Representation for unified filter top/bottom criteria _Available April 2026 and later._ * `expression` (_string_) The expression to order by for top/bottom determination * `isTop` (_boolean_) Whether this is a top or bottom filter * `nullValuesPosition` (_sfdc.unified.analytics.connect.api.enums.common.filters.ConnectUnifiedSemanticFilterNullValuesPositionType_) * `topBottomLimit` (_integer_) The limit for top/bottom filtering ### sfdc.unified.analytics.connect.api.output.download.DownloadFilterFieldRepresentation Metadata for the field name of an applied filter * `label` (_string_) filter field label * `name` (_string_) filter field name ### sfdc.unified.analytics.connect.api.enums.dataorchestration.DataOrchestrationCommonFilterKeyEnum Common Data Orchestration Filter Keys Type: `string`. Allowed values: `Users`, `Workspaces`. ### sfdc.unified.analytics.connect.api.output.BaseAnalyticsAssetRepresentation BaseAnalyticsAsset A Tableau Next asset, including its creator and last-modified details. One of: `sfdc.unified.analytics.connect.api.output.BaseVisualizationRepresentation`, `sfdc.unified.analytics.connect.api.output.dashboard.DashboardRepresentation`, `sfdc.unified.analytics.connect.api.output.download.DownloadDashboardAssetRepresentation`, `sfdc.unified.analytics.connect.api.output.download.DownloadSubmetricAssetRepresentation`, `sfdc.unified.analytics.connect.api.output.download.DownloadVisualizationAssetRepresentation`, `sfdc.unified.analytics.connect.api.output.download.DownloadVisualizationWidgetAssetRepresentation`, `sfdc.unified.analytics.connect.api.output.follow.FollowedAssetRepresentation`, `sfdc.unified.analytics.connect.api.output.workspace.TypedAssetReferenceRepresentation`, `sfdc.unified.analytics.connect.api.output.workspace.WorkspaceRepresentation`. ### sfdc.unified.analytics.connect.api.input.dataAlert.DataAlertDayEnum Day of the week. Type: `string`. Allowed values: `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday`, `Wednesday`. ### shared.analytics.platform.api.enums.TuaSubMetricCaptureMode # Tableau Next Connect REST API Resources Overview The Tableau Next Connect REST API provides resources to access your Tableau Next assets and more. All Tableau Next Connect REST API resources are accessed using: - A base URL for your Salesforce org (`https://`) - The [Connect API version](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_versions.htm) information (`/services/data/v67.0`) - The Tableau Next resource (`/tableau/visualizations`) Put together, a full URL is: ```html https:///services/data/v67.0/tableau/visualizations ``` ## Org and Object Identifiers ID fields in Salesforce, and in Tableau Next, are typically 15-character, base-62, case-sensitive strings. This is also true of JSON XMD. However, many Salesforce APIs, including the Tableau Next Connect REST API, use 18-character, case-insensitive strings. For example, the `id` property of the asset resource appears in a path like the following: ```html /tableau/workspaces/{workspaceIdOrApiName}/assets/{assetId} ``` The last 3 characters are a checksum of the preceding 15 characters. Case-insensitive IDs ease interaction with external applications and development environments that use case-insensitive references. To convert an 18-character ID back to a 15-character ID, remove the last 3 characters. ## Tableau Next Resources | Resource | Description | Supported HTTP Methods | Resource URL | | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- | | Assets | Clones an asset. | [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/cloneAsset) | /tableau/assets/clone | | | Compares two or more assets. | [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/compareAssets) | /tableau/assets/compare | | | Returns the assets that depend on a specified asset. | [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getAssetDependents) | /tableau/assets/dependencies | | | Returns the references contained within a specified asset. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getAssetInnerReference) | /tableau/assets/{assetId}/references | | Dashboards | Returns a collection of dashboards or creates a new dashboard. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getDashboards), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postDashboardCollection) | /tableau/dashboards | | | Returns, updates, or deletes a dashboard with the specified ID or API name. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getDashboard), [PATCH](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/patchDashboard), [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteDashboard) | /tableau/dashboards/{dashboardIdOrApiName} | | | Returns the bundle for a dashboard with the specified ID or API name. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getDashboardBundle) | /tableau/dashboards/{dashboardIdOrApiName}/bundle | | | Returns a collection of custom views for a dashboard or creates a new custom view. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getViews), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/saveView) | /tableau/dashboards/{dashboardIdOrApiName}/customviews | | | Returns the default custom view for a dashboard. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getDefaultView) | /tableau/dashboards/{dashboardIdOrApiName}/customviews/default | | | Returns the specified custom view, or deletes a custom view. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getView), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteView) | /tableau/dashboards/{dashboardIdOrApiName}/customviews/{viewId} | | Followers | Returns a unique follower count for a specified asset. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getUniqueFollowerCount) | /tableau/follow/assets/{followedAssetId}/follower-count | | | Returns a collection of followers for a specified followed asset. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getFollowerCollection) | /tableau/follow/assets/{followedAssetId}/followers | | | Returns a collection of references to the assets a user follows. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getFollowedAssetRefCollection) | /tableau/follow/followers/{followerId}/followed-asset-refs | | | Returns a collection of followed assets for a user. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getFollowedAssetCollection) | /tableau/follow/followers/{followerId}/followed-assets | | | Adds a user as a follower of a specified asset or collection of assets, or updates a follow. | [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postFollow), [PATCH](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/patchFollow) | /tableau/follow/followers/{followerId}/follows | | | Unfollows a specified asset for a specified user. | [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteUnfollow) | /tableau/follow/followers/{followerId}/follows/{followedAssetId} | | | Returns submetric information for a specified asset. | [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postSubMetricInfo) | /tableau/follow/submetric-info | | Marketplace | Returns a marketplace installation with the specified ID. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getAnalyticsTableauMarketplaceListingInstallationTracking) | /tableau/marketplace/installations/{installationId} | | | Returns a collection of marketplace listings or publishes a new listing to the marketplace. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getMarketplaceListings), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/publishToMarketplace) | /tableau/marketplace/listings | | | Unpublishes a listing from the marketplace. | [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/unpublishFromMarketplace) | /tableau/marketplace/listings/{listingId} | | | Installs a specified marketplace listing. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getAnalyticsTableauMarketplaceListing) | /tableau/marketplace/listings/{listingId}/install | | | Returns the components of a specified marketplace package version. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getPackageComponents) | /tableau/marketplace/packages/{packageVersionId}/components | | | Creates a marketplace template. | [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postMarketplaceTemplateBuilder) | /tableau/marketplace/templates | | Personal Orgs | Syncs personal org information. | [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postAnalyticsPersonalOrgInfoSync) | /tableau/analytics-personal-org-infos | | | Returns a collection of personal orgs. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getAnalyticsPersonalOrgInfoCollection) | /tableau/personal-orgs | | | Returns, updates, or deletes a personal org with the specified ID. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getAnalyticsPersonalOrgInfo), [PATCH](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/patchAnalyticsPersonalOrgInfo), [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteAnalyticsPersonalOrgInfo) | /tableau/personal-orgs/{personalOrgInfoId} | | Record Access Shares | Returns a collection of shares for a specified record for the requesting grantee user, or shares, updates, or deletes access to a specified record. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getSetupRecordShareCollection), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postSetupRecordShareCollection), [PATCH](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/patchSetupRecordShareCollection), [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteSetupRecordShareCollection) | /tableau/records/{recordId}/shares | | | Removes access to a specified record for a specified user or group. | [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteSetupRecordShare) | /tableau/records/{recordId}/shares/{userOrGroupId} | | Subscriptions | Returns or updates a user's subscription digest configuration. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getSubscriptionDigestConfig), [PATCH](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/patchSubscriptionDigestConfig) | /tableau/subscriptions/digest/{digestConfigOwner} | | Visualizations | Returns a collection of visualizations or creates a new visualization. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getVisualizations), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/createVisualization) | /tableau/visualizations | | | Returns, updates, or deletes a visualization with the specified ID or API name. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getVisualization), [PATCH](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/updateVisualization), [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteVisualization) | /tableau/visualizations/{visualizationIdOrApiName} | | | Returns the bundle for a visualization with the specified ID or API name. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getVisualizationBundle) | /tableau/visualizations/{visualizationIdOrApiName}/bundle | | Workspaces | Returns a collection of workspaces or creates a new workspace. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getWorkspaces), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postWorkspaceCollection) | /tableau/workspaces | | | Returns, updates, or deletes a workspace with the specified ID or API name. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getWorkspace), [PATCH](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/patchWorkspace), [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteWorkspace) | /tableau/workspaces/{workspaceIdOrApiName} | | | Returns a collection of assets in a workspace or adds an asset to a workspace. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getWorkspaceAssets), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postWorkspaceAssetCollection) | /tableau/workspaces/{workspaceIdOrApiName}/assets | | | Adds a batch of assets to a workspace. | [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/batchCreateWorkspaceAsset) | /tableau/workspaces/{workspaceIdOrApiName}/assets/batch | | | Returns, clones, updates, or deletes a specified asset in a workspace. | [GET](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/getWorkspaceAsset), [POST](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/postWorkspaceAsset), [PATCH](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/patchWorkspaceAsset), [DELETE](/docs/analytics/tableau-next-rest-api/references/tableau-next-connect-api#operation/deleteWorkspaceAsset) | /tableau/workspaces/{workspaceIdOrApiName}/assets/{assetId} | # Tableau Next Development Environments Learn about the development environments that are available for Salesforce partners, Tableau data developers, and customer developers. ## Development Environment for Salesforce Partners Salesforce ISV Partners create apps for sale and distribution to Salesforce customers. If you're an ISV Partner, create a Partner Developer edition org from your Environment Hub. To turn on Data 360 and Tableau Next, log a case with Partner Support. If you're a Salesforce Consulting Partner, you can get information about setting up a development environment by contacting your Partner Account Manager. ## Development Environment for Developers Developers create apps in-house for their own Data 360 instance. Currently, sandboxes are available in beta to create and test your apps for Data 360 and Tableau Next. See [Create a Data Cloud Sandbox (Beta)](https://help.salesforce.com/s/articleView?id=data.c360_a_data_cloud_sandbox_create.htm&type=5). Then, enable Tableau Next and create your analytics assets in the sandbox. If you don't want to use a sandbox, you can get access to a second org. To find out how to access to a Data 360 test org, contact your Account team. The org used for testing is separate from the production org. This second org is another production org, and service usage is metered, resulting in billing charges the same way it is on the production org. See [Cost and Usage](https://developer.salesforce.com/docs/data/data-cloud-dev/guide/dc-cost-usage.html). ## Sandboxes vs Scratch Orgs A best practice for building and configuring new solutions is to build and test outside your production org. For clarity, here's a quick overview of both sandboxes and scratch orgs. ### What Are Sandboxes? Sandboxes are copies of your Salesforce org that you can use for development, testing, and training, without compromising the data and apps in your production org. Sandboxes don’t expire, so as long as you continue to use the sandbox, it stays active. One type of sandbox commonly used for deployment, testing, and training is a Developer sandbox. Developer sandboxes are a copy of your Salesforce production org metadata. They bring over the metadata and customizations, but not the data itself. Use sandboxes for building and testing in an isolated environment. ### What Are Scratch Orgs? Scratch orgs are ephemeral environments specifically for source-driven development. They’re short-lived copies of your org or information to use for a specific purpose. Scratch orgs expire, they have a default expiration of 7 days and a max lifespan of 30 days. Because of this short expiration time frame, scratch orgs are disposable and not intended to be the long-term home of any customizations. With source-driven development, you’re populating a scratch org with an externalized source, rather than copying it from the production org. After changes have been made in a scratch org, sync the changes back to a source control system, like GitHub. Create scratch orgs with the Command-Line Interface (CLI) or VS Code commands. They use configuration files that define the shape of the org. ## See also - [Sandbox Types and Templates](https://help.salesforce.com/s/articleView?id=sf.create_test_instance.htm) - [Scratch Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm) # Tableau Next Embedding SDK Release Notes ## v2.1.0 - **Session management**: Lightning Out upgraded to 2.2.5, plus new `getSessionExpiry()`, `refreshSession()`, and `reAuthenticateSession()` to check/extend/re-establish per-org sessions without recreating embedded components. - **`AnalyticsAgent` UI overrides**: new `welcomeImage` and `agentAvatar` props to customize the welcome screen and the agent's message avatar. - **Smaller runtime bundle**: bundler moved from webpack to Rollup; raw UMD is ~14% smaller (~107 KB → ~92 KB). - **AI onboarding skill**: built-in onboarding skill now available for AI coding assistants [SKILL.md](https://unpkg.com/@salesforce/analytics-embedding-sdk/SKILL.md). ## v2.0.0 - **Lightning Out upgrade**: supports Lightning Out 2.2.3, upgrading from `@salesforce/lightning-out@2.2.3` to `@lightning-out/application@2.1.2`. This update requires users to install v2.0.0 to continue using the embedding SDK. ## v1.1.0 - **`AnalyticsAgent` component**: Use the `AnalyticsAgent` component in the Tableau Next Embedding SDK to embed the Tableau Agent. This agent helps your users see and understand data with conversational analytics. The agent generates natural language insights, visualizations, and proactive alerts in your flow of work. For example, a customer service agent working in an external help desk system can ask, “Show me the average handle time for escalated cases this month,” and receive an immediate chart without leaving the app. - **Multi-org support** : Added support for embedding components from multiple Salesforce orgs in a single app. Use `orgConfigs` instead of a single `orgUrl` and `authCredential` in the `initializeAnalyticsSdk()` payload. - **Dashboard actions support**: The button actions configured on the dashboard are supported in third-party embedding. That includes actions such as **Salesforce Flows**, **page navigation**, and **URL navigation**, consistent with the embedded dashboard experience in Tableau Next. - **Custom View ID for Dashboards**: Pass an optional `customViewId` to render the embedded dashboard with the same custom view as in Tableau Next. A custom view is a saved filter state. This aligns with share links that include a `customViewId` query parameter, and helps preserve dashboard interactivity when embedding in other surfaces like Slack. ## v1.0.0 Initial release of the Embedding SDK with support for embedding Tableau Next dashboards, visualizations, and metrics in third-party web apps. # Tableau Next Features Overview If you're new to Tableau Next, this sections provides a brief overview of what you can do with Tableau Next. It also provides resources to learn more about Tableau Next. As Salesforce’s end-to-end, agentic analytics experience, Tableau Next integrates the analytics platform with Agentforce’s context-aware AI and the Data 360 semantic layer that unifies business knowledge across your org. Designed to be composable and API-first, Tableau Next empowers you to create, share, and reuse analytics assets seamlessly. Build and deliver personalized, contextual, and actionable insights for every user, backed by Salesforce’s enterprise-grade performance, security, and scalability. ## Data Governance and Sharing Tableau Next has a sophisticated multi-layered access control structure powered by flexible Salesforce permission sets, Data 360 governance policies, and sharing settings on each Tableau Next asset. [_Salesforce Help_: Data Governance and Sharing In Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_governance.htm) ## Marketplace and Templates ### Dashboard Templates Transform your Tableau Next dashboards into standardized templates that can be listed on Marketplace, empowering collaboration, promoting standardization, and reducing duplicate efforts across teams. The Tableau Next Marketplace allows analysts to share, customize, and deploy dashboard templates across an org, with the aim of improving efficiency and standardization. For example, after you build a dashboard highlighting your sales pipeline data, templatize it to share with your team and other sales teams. [_Salesforce Help_: Build Templates for Your Tableau Next Marketplace](https://help.salesforce.com/s/articleView?id=analytics.tua_deploy_template.htm) ### App Templates [_Developer Guide_: App Template Framework](https://developer.salesforce.com/docs/analytics/app-template-framework/guide) ## Semantic Models With semantic models, your data becomes unified into a single source of truth, accessible throughout Salesforce. Semantic models provide a way to interpret your data consistently across Salesforce by mapping it to standardized business terms and logic. Semantic models are first-class Salesforce metadata, so they’re available throughout Data 360 to power analytics and data-driven experiences. [_Salesforce Help_: About Semantic Models](https://help.salesforce.com/s/articleView?id=analytics.tua_data_sdm_about_models.htm) ## Data Source Connectors Create remote connections to your external data sources. [_Salesforce Help_: Data Source Connectors](https://help.salesforce.com/s/articleView?id=analytics.tua_data_add_external_database.htm) ## Workspaces Everything in Tableau Next exists in a workspace. A workspace is a flexible place for analysts to create and reuse analytic assets to answer questions about their data. Each workspace contains the tools needed for data analysis, including data connections, a semantic model builder and metric creator, and visualization tools to share findings with others. [_Salesforce Help_: Tableau Next Workspaces](https://help.salesforce.com/s/articleView?id=analytics.tua_workspace.htm) ## Metrics A metric is a business KPI that you can track over time and use to assess performance or business processes. A metric is derived from one or more measures. You can apply a sentiment to a metric (for example, up is good or bad), aggregation (for example, sum, non-cumulative, average, minimum, maximum), and other business contexts. [_Salesforce Help_: About Metrics](https://help.salesforce.com/s/articleView?id=analytics.tua_data_sdm_about_metrics.htm) ## Visualizations Visualizations are visual representations of your data as a chart or graph. A visualization is a powerful way to explore and analyze data. In Tableau Next, you can build visualizations with rich features, filters, calculations, and actions. [_Salesforce Help_: Build Insightful Visualizations in Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_create_viz.htm) ## Dashboards The Tableau Next dashboard is designed to streamline your workflow by providing a clear, intuitive overview of all the critical information you need. Whether you’re tracking performance metrics, managing tasks, or monitoring key data, dashboards bring everything together in one place. [_Salesforce Help_: Create Effective Dashboards With Tableau Next](https://help.salesforce.com/s/articleView?id=analytics.tua_create_dashboard.htm) # Tableau Next MCPs, APIs, and SDKs Explore the MCPs, APIs, and SDKs that you can use for Tableau Next development. ## MCPs **[Tableau Next MCP](https://developer.salesforce.com/docs/platform/hosted-mcp-servers/references/reference/tableau-next.html)** The `analytics/tableau-next` server exposes Tableau Next’s semantic layer and analytics capabilities to AI agents. It provides tools to discover semantic models (SDMs), retrieve dashboard and visualization metadata, explore metrics and KPIs, and execute natural-language analytical questions via the Analytics Agent. This is the bridge between AI agent conversations and the structured analytical layer that Tableau Next maintains over your data. ## APIs **[Tableau Next REST API](https://developer.salesforce.com/docs/analytics/tableau-next-rest-api/guide)** - Create and update visualizations and workspaces. - Get, update, and run subscription digests. - Download asset images and metadata. - Add and update followers for assets and collections of assets and query followed assets and followers for assets. - Get and update user access to assets. **[Tableau Semantics Layer APIs (beta)](https://developer.salesforce.com/docs/data/semantic-layer/guide/get-started.html)** - Run semantic queries. - Create and customize semantic models. - Produce metrics from your semantic layer. **[App Template Framework](https://developer.salesforce.com/docs/analytics/app-template-framework/references/atf-ref)** Create and manage templates, apps, assets, chains, tasks, variables, and rules. ## SDKs **[Tableau Next Embedding SDK](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-overview.html)** Use the Tableau Next Embedding SDK to integrate Tableau Next insights into your own web apps. The SDK provides modern, secure methods of authentication so that users can interact with Tableau Next features from your web app. # tan({n}) Returns the tan value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `tan()` returns `null`. `tan({n})` takes the following syntax. ```nolang SELECT TAN(N) as ALIAS FROM DATASET; ``` ## Example This example takes the tan of 90 degrees. ```nolang SELECT TAN(RADIANS(90)) as tanValue FROM "Opportunity" LIMIT 1; ``` | tanValue | | -------- | | 163312 | # tan(n) Returns the tangent value of radians value _n_. _n_ can be any real numeric value in the range of -1e308 \<= _n_ \<= 1e308. If `null` is passed as an argument, `tan()` returns `null`. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate tan(radians) as tangent; ``` # Template Dependency Syntax The syntax you use to specify dependencies in the `template-info.json` file for `templateVersion` is flexible. The value can take on any of the following. - Choose any version. - A specific version. - Versions greater than or less than the one indicated. Here is the syntax: 1. If no version is specified, any version found is used. If a version is specified, but no operator (for example, 3.0), only that version is used. 2. If the operator is “=” (=3.0), only that version is used. 3. If the operator is “\>” (\>3.0), any app with a version greater than the specified version is used 4. If the operator is “\<” (\<3.0), any app with a version less than the specified version is used. 5. If the operator is “\>=” (\>=3.0), any app with a version greater than or equal to the specified version is used. 6. If the operator is “\<=” (\<=3.0), any app with a version less than or equal to the specified version is used. # Template Folder Structure Decompressing the exported template file exposes the following folder structure. - ![This image depics a folder icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_folder_icon2.png)`` (top directory) - ![This image depics a file icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_file_icon2.png)`template-info.json` Don’t change the name of this file; processing depends on it. - ![This image depics a file icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_file_icon2.png)`variables.json` - ![This image depics a file icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_file_icon2.png)`ui.json` - ![This image depics a file icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_file_icon2.png)`template-to-app-rules.json` We recommend this naming convention as the best way to manage your rules files. - ![This image depics a file icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_file_icon2.png)`app-to-template-rules.json` We recommend this naming convention as the best way to manage your rules files. - ![This image depics a file icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_file_icon2.png)`releaseNotes.html` - ![This image depics a folder icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_folder_icon2.png)`dashboards` Subdirectory containing one or more dashboard JSON files corresponding to each dashboard in the source app. If the source app has no dashboards, this subdirectory doesn’t exist. - ![This image depics a folder icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_folder_icon2.png)`lenses` Subdirectory containing one or more lens JSON files corresponding to each lens in the source app. If the source app has no lenses, this subdirectory doesn’t exist. - ![This image depics a folder icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_folder_icon2.png)`dataflows` Subdirectory containing the dataflow JSON files corresponding to each dataflow in the source app. If the source app has no dataflows, this subdirectory doesn’t exist. - ![This image depics a folder icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_folder_icon2.png)`recipes` Subdirectory containing the recipe JSON files corresponding to each recipe in the source app. If the source app has no recipes, this subdirectory doesn’t exist. - ![This image depics a folder icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_folder_icon2.png)`external_files` Subdirectory containing one or more CSV dataset and related JSON files, such as schema and user XMD files, corresponding to each dataset in the source app. If the source app has no CSV datasets, this subdirectory doesn’t exist. - ![This image depics a folder icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_folder_icon2.png)`dataset_files` Subdirectory containing [User XMD](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_xmd.meta/bi_dev_guide_xmd/bi_xmd_intro.htm) files for SFDC datasets. If the source app has no SFDC datasets with User XMD defined, this subdirectory doesn’t exist. - ![This image depics a folder icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_folder_icon2.png)`images` Subdirectory containing one or more image files. If the source app has no images, this subdirectory doesn’t exist. - ![This image depics a file icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_file_icon2.png)`folder.json` - ![This image depics a file icon.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_file_icon2.png)`auto-install.json` Optional file to create the app with an auto-install request. You must create this file, It is not generated at template creation. The template must be installed as a managed package for app creation. # template-info.json Attributes The `template-info.json` file is the main file that describes the template. It includes or references all the information required to create a downstream app. | Attribute | Required | Description | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | Yes | The unique developer name of the template. If changed, it creates a new template; if it's changed to an existing template `devName`, it overwrites the existing template. | | `label` | Yes | The template name visible to users in the Analytics template picker and wizard. | | `description` | No | The template description. Shown in the app creation wizard template picker. | | `icons` | No | Three icon types are available: `templateBadge`, `appBadge`, and `templatePreviews`. If images are stored as static resources and the org uses a namespace, specify a `namespace` attribute for each icon. | | `tags` | No | Array of tags used in template search and shown on template details page. | | `asset​Version` | Yes | Refers to the numbered API version to use when creating Analytics assets, such as dashboards, datasets, XMDs, and dataflows. Recipes are always on the current API version. To update this version, see [Update an Existing Template.](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-update-template.md) | | `release​Info` | Yes | Container attribute only. | | `release​Info` → `template​Version` | Yes | The version of the template, tracked for the upgrade process. Calling wave/templates PUT automatically increments this number, but it can be changed manually as well. The format is `##.##`, although it's a string. | | `release​Info` → `notes​File` | No | A template dev defined HTML file to describe new release details. Basic HTML formatting is supported, but not links or javascript. Defaults to using the template description as release notes if file isn't specified. | | `rules` | No | Container attribute only - can contain 1 or more rule file definitions (loaded first to last and order matters for dependencies). | | `rules` → `type` | Yes, if `rules` is used. | `appToTemplate` applies rules when updating the template from the source app (Rest API PUT call). `templateToApp` applies rules when creating an app from a template. | | `rules` → `file` | Yes | Path to the rules file. | | `template​Type` | Yes | Can specify either `app`, `embeddedapp`, `data`, or `dashboard`. | | `ui​Definition` | No | Path the `ui.json` file. | | `variable​Definition` | No | Path to the `variables.json` file. | | `folder​Definition` | No | Path to the `folder.json` file. | | `auto​Install​Definition` | Yes for auto-installed templates, No for templates that use the configuration wizard | Path to the `auto-install.json` file. Only specify this file for auto-install templates. | | `readiness​Definition` | No | Path to the `orgReadiness.json` file. | | `apex​Callback` | No | Container attribute only. Registers an Apex class that runs on wizard load, app create, and app upgrade. The Apex class examines the org and sets variable values. For example, the Sales Analytics template uses an Apex class to check whether the org uses the Products object. If it doesn't, the `has_product` variable is set to `no`. | | `apex​Callback` → `namespace` | Yes, if `apexCallback` is used and org uses namespace. | The namespace for the org, if it has one. Required for Apex classes in the development org or packaged with the template. | | `apex​Callback` → `name` | Yes | The name of the Apex class to be used. | | `custom​Attributes` | No | Specifies information describing your template in the app creation wizard, such as Salesforce objects used or notable features. Takes a label and an array of values. | | `dashboards` | No | Container attribute only. Array of dashboard JSON files to be used, can be empty if there are no dashboard files. | | `dashboards` → `file` | Yes, if `dashboards` is used. Otherwise no. | Path to the dashboard file. | | `dashboards` → `label` | Yes, if `dashboards` is used. Otherwise no. | The dashboard label. Must match the "label" attribute in the dashboard file | | `dashboards` → `name` | Yes, if `dashboards` is used. Otherwise no. | The dashboard name. Must match the "name" attribute in the dashboard file. | | `dashboards` → `condition` | No | If condition is met, then the dashboard is created in the app; if the condition isn't met, the dashboard isn't created. Can include `Overrides`, which are defined in `variables.json`. See [Complex `variables.json` Variable Types](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-complex-var-types-variables-json.md). | | `dashboards → overwrite​On​Upgrade` | No | Indicates if asset is overwritten during the reset/upgrade process. Uses `Always`, `IfDifferent`, `Never`, or an expression that evaluates to one these values. Case sensitive. Example: `"overwriteOnUpgrade": "${Variables.DontOverwriteQuota ? 'Never' : 'IfDifferent'}",` | | `lenses` | No | Container attribute only - array of dashboard JSON files to be used, can be empty if there are no dashboard files. | | `lenses` → `file` | Yes, if `lenses` is used. Otherwise no. | Path to the lens file. | | `lenses` → `label` | Yes, if `lenses` is used. Otherwise no. | The lens label. Must match the "label" attribute in the lens file. | | `lenses` → `name` | Yes, if `lenses` is used. Otherwise no. | The lens name. Must match the "name" attribute in the lens file. | | `lenses` → `condition` | No | If the condition is met, then the lens is created in the app; if the condition isn't met, the dashboard isn't created. Can include `Overrides`, which are defined in `variables.json`. See [Complex `variables.json` Variable Types](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-complex-var-types-variables-json.md) | | `lenses → overwrite​On​Upgrade` | No | Indicates if asset is overwritten during the reset/upgrade process. Uses `Always`, `IfDifferent`, `Never`, or an expression that evaluates to one these values. Case sensitive. Example: `"overwriteOnUpgrade": "${Variables.DontOverwriteQuota ? 'Never' : 'IfDifferent'}",` | | `elt​Dataflows` | No | Container attribute only – array of dataflow JSON files to be used, can be empty if there are no dataflow files. | | `elt​Dataflows` → `file` | Yes, if `eltDataflows` is used. Otherwise no. | Path to the dataflow file. | | `elt​Dataflows` → `label` | Yes, if `eltDataflows` is used. Otherwise no. | The dataflow label. Must match the `sourceLabel` attribute in dataflow file. | | `elt​Dataflows` → `name` | Yes, if `eltDataflows` is used. Otherwise no. | The dataflow name. Must match the `name` attribute in the dataflow file. | | `elt​Dataflows` → `condition` | No | If condition is met, then the dataflow is created in the app; if the condition isn't met, the dataflow isn't created. Can include `Overrides`, which are defined in `variables.json`. See [Complex `variables.json` Variable Types](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-complex-var-types-variables-json.md) | | `elt​Dataflows` → `overwriteOnUpgrade` | No | Indicates if asset is overwritten during the reset/upgrade process. Uses `Always`, `IfDifferent`, `Never`, or an expression that evaluates to one these values. Case sensitive. Example: `"overwriteOnUpgrade": "${Variables.DontOverwriteQuota ? 'Never' : 'IfDifferent'}",` | | `recipes` | No | Container attribute only – array of recipes JSON files to be used, can be empty if there are no recipe files. | | `recipes` → `file` | Yes, if `recipes` is used. Otherwise no. | Path to the recipe file. | | `recipes` → `label` | Yes, if `recipes` is used. Otherwise no. | The recipe label. | | `recipes` → `name` | Yes, if `recipes` is used. Otherwise no. | The recipe name. | | `recipes` → `condition` | No | If condition is met, then the recipe is created in the app; if the condition isn't met the recipe isn't created. Can include `Overrides`, which are defined in `variables.json`. See [Complex `variables.json` Variable Types](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-complex-var-types-variables-json.md) | | `recipes` → `overwrite​On​Upgrade` | No | Indicates if asset is overwritten during the reset/upgrade process. Uses `Always`, `IfDifferent`, `Never`, or an expression that evaluates to one these values. Case sensitive. Example: `"overwriteOnUpgrade": "${Variables.DontOverwriteQuota ? 'Never' : 'IfDifferent'}",` | | `external​Files` | Yes | Container attribute only - array of external files, CSV and descriptive files, to be used, can be empty if there are no external files. | | `external​Files` → `file` | No | Path to the CSV file. | | `external​Files` → `name` | Yes, if `externalFiles` is used. Otherwise no. | The externalFile name. | | `external​Files` → `rows` | No | The number of rows to stub out in the dataset created from the CSV, before data upload. If not specified, defaults to 5. By default, a file has 5 rows until the user uploads their own version of the file. | | `external​Files` → `schema` | No | Path to the schema file (describes the format of the data) | | `external​Files` → `userXmd` | No | Path to the user XMD file (describes the display format of the data). | | `external​Files` → `type` | Yes | Must be `CSV`. | | `external​Files` → `condition` | No | If condition is met, then the external file is created in the app; if the condition isn't met, the external file isn't created. Can include `Overrides`, which are defined in `variables.json`. See [Complex `variables.json` Variable Types](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-complex-var-types-variables-json.md) | | `external​Files` → `overwrite​On​Upgrade` | No | Indicates if asset is overwritten during the reset/upgrade process. Uses `Always`, `IfDifferent`, `Never`, or an expression that evaluates to one these values. Case sensitive. Example: `"overwriteOnUpgrade": "${Variables.DontOverwriteQuota ? 'Never' : 'IfDifferent'}",` | | `dataset​Files` | No | Container attribute only – array of SFDC dataset to be used, can be empty if there are no SFDC dataset. | | `dataset​Files` → `user​Xmd` | No | Path to the user XMD file, if it exists. | | `dataset​Files` → `label` | Yes | The dataset label. | | `dataset​Files` → `name` | Yes | The dataset name. | | `dataset​Files` → `condition` | No | If condition is met, then the dataset is created in the app; if the condition isn't met, the dataset isn't created. Can include `Overrides`, which are defined in `variables.json`. See [Complex `variables.json` Variable Types](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-complex-var-types-variables-json.md) | | `dataset​Files` → `live​Connection` | No | The container attribute for Snowflake connection live dataset settings. | | `dataset​Files` → `live​Connection` → `connection​Name` | Yes, if `liveConnection` is used. Otherwise no. | The connection name for the Snowflake connector. This name must match the developer name of the connector in the consumer org. | | `dataset​Files` → `live​Connection` → `source​Object​Name` | Yes, if `liveConnection` is used. Otherwise no. | The Snowflake source table name. | | `image​Files` | No | Container attribute only: array of app images to be used. | | `image​Files` → `label` | Yes, if `imagesFiles` is used. Otherwise no. | A label for the image. | | `image​Files` → `name` | Yes, if `imagesFiles` is used. Otherwise no. | The image name. | | `image​Files` → `condition` | No | If the condition is met, then the image is uploaded into the app; if the condition isn't met, the image isn't uploaded. | | `image​Files` → `namespace` | Yes, if org uses a namespace. | Includes reference to namespace for static resources, for example `${Org.Namespace}`. | | `extended​Types` | No | Add extended type to a template. | | `extended​Types` → `discovery​Stories` | No | Add Einstein Discovery story extended type to template. Uses `label`, `name`, `file`, `condition`. See [Add an Einstein Discovery Story to an Analytics Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-add-discovery-story.md) | | `template​Dependencies` | No | Array of other templates the template is dependent on. See [Share Analytics Assets Between Apps](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-share-assets.md) | | `template​Dependencies →`name``|Yes, if `dependencies` is used. Otherwise no.|Developer name of the template. | | `template​Dependencies →`namespace``|No|Namespace of the org, if used. | | `template​Dependencies →`templateVersion``|No|Number of the template version. | | `template​Dependencies →`condition``|No|Condition in which to include this dependency. | | `components` | No | Container attribute only. Array of dashboard component JSON files to be used, can be empty if there are no dashboard components files. | | `components` → `file` | Yes, if `components` is used. Otherwise no. | Path to the dashboard component file. | | `components` → `label` | Yes, if `components` is used. Otherwise no. | A label for the dashboard component. | | `components` → `name` | Yes, if `components` is used. Otherwise no. | The dashboard component name. | | `components` → `condition` | No | If the condition is met, then the dashboard component is created in the app. If the condition isn't met, the dashboard component isn't created. | Icon type details: - `templateBadge` defines the small icon that appears in the app picker and at the top of the template details window. **Don't** use file extension with `name` attribute, for example `"learn"`, **not** `"learn.png"`. - `appBadge` defines the icon shown by Analytics Studio for the app after creation. Must be `"1.png"` through `"21.png"`. Use file extension with `name` attribute, for example `"16.png"`, **not** `"16"` - `templatePreviews` defines preview images displayed on the template details window during the app creation process. Supports multiple images. **Don't** use file extension with `name` attribute, for example `"preview_education"`, **not** `"preview_education.png"`. Name of the icon image must use all lower case letters. Example `namespace` attribute for `appBadge`: ```nolang "appBadge": { "name": "15.png" "namespace": "${Org.Namespace}" } ``` **important:** Make sure the Apex class can be accessed by users in the organization with Manage Analytics Templated Apps user permission. Otherwise, trying to create an app from your template results in an error. In Setup, go to **Apex Classes**, click **Security** next to the class, then add the profile with the Manage Analytics Templated Apps user permission. Example `customAttributes` value: ```nolang customAttributes" : [ { "label" : "Features", "values" : ["CUSTOM OBJECTS", "MOBILE READY"] }, {"label": "Salesforce objects", "values" : ["ACCOUNT","PRODUCT","LEADS","CASES"] }], ``` **See Also** - [Edit template-info.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-edit-template-info-json.md) - [template-info.json Example](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-template-info-json-example.md) # template-info.json Example Here are two example `template-info.json` files. ## Example ```nolang { "templateType": "app", "label": "Generic Analytics", "name": "GenericAnalytics", "description": "The Generic Analytics template creates an app that visualizes business data. v1.0 #160", "assetVersion": 43, "releaseInfo": { "templateVersion": "1.0", "notesFile": "releaseNotes.html" }, "variableDefinition": "variables.json", "uiDefinition": "ui.json", "readinessDefinition": "org-readiness.json", "apexCallback": { "namespace": "wavetemplate", "name": "GenericConfigurationModifier" }, "icons": { "appBadge": { "name": "15.png" }, "templateBadge": { "name": "Generic.png" }, "templatePreviews": [{ "name": "preview_Generic.jpg", "label": "Generic Analytics", "description": "Explore impact to sales." }] }, "tags": [ "Marketing", "Sales" ], "customAttributes": [{ "label": "Features", "values": [ "Prebuilt Dashboard", "Mobile Ready", "Dataflow", "KPI Rich Datasets" ] }, { "label": "Salesforce Objects", "values": [ "Customizable Generic Influence" ] }, { "label": "Publisher", "values": [ "Analytics" ] } ], "rules": [{ "type": "templateToApp", "file": "template-to-app-rules.json" }, { "type": "appToTemplate", "file": "app-to-template-rules.json" } ], "externalFiles": [], "lenses": [], "dashboards": [{ "file": "dashboard/Generic_Influence.json", "name": "Generic_Influence", "label": "Generic Influence" }], "eltDataflows": [{ "label": "GenericAnalyticsDataflow", "name": "GenericAnalyticsDataflow", "file": "dataflow/GenericAnalyticsDataflow.json" }], "datasetFiles": [{ "label": "GenericInfluence", "name": "GenericInfluence", "userXmd": "dataset_files/GenericInfluence_XMD.json" }, { "label": "Generic", "name": "Generic", "userXmd": "dataset_files/Generic_XMD.json" } ], "imageFiles": [{ "name": "GenericLogo", "file": "images/Generic_logo.png" "namespace": "${Org.Namespace}" //if org is namespaced }] } ``` ## Example ```nolang { "templateType": "app", "label": "Corporate Sales Results", "name": "My_Sales", "description": "Create an app from this template to get actionable insights about the sales team.", "assetVersion": 46.0, "variableDefinition": "variables.json", "uiDefinition": "ui.json", "rules": [{ "type": "templateToApp", "file": "template-to-app-rules.json" }, { "type": "appToTemplate", "file": "app-to-template-rules.json" } ], "releaseInfo": { "templateVersion": "1.1", "notesFile": "releaseNotes.html" }, "folderDefinition": "folder.json", "autoInstallDefinition": "auto-install.json", "externalFiles": [], "lenses": [], "dashboards": [{ "label": "Sales", "name": "Sales_SAMPLE_tp", "condition": "${Variables.Overrides.createAllDashboards}", "file": "dashboards/DTC_Sales_SAMPLE.json" }, { "label": "Opportunity Details", "name": "Opportunity_Details_tp", "condition": "${Variables.Overrides.createAllDashboards}", "file": "dashboards/Opportunity_Details.json" }, { "label": "Regional Sales Results", "name": "Regional_Sales_SAMPLE_tp", "condition": "${Variables.Overrides.createAllDashboards}", "file": "dashboards/Regional_Sales_SAMPLE.json" }, { "label": "Sales Performance with Selectable Measures", "name": "Sales_Performance_with_Selectable_Measures_Trailhead_tp", "condition": "${Variables.Overrides.createAllDashboards}", "file": "dashboards/Sales_Performance_with_Selectable_Measures_Trailhead.json" } ], "recipes": [{ "label": "Filter Accounts Recipe", "name": "Filter_Accounts_Recipe", "file": "recipes/Filter_Account_Recipe.json" } ], "datasetFiles": [{ "label": "Opportunity", "name": "Opportunity_SAMPLE_tp", "condition": "${Variables.Overrides.createAllDatasetFiles}", "userXmd": "dataset_files/Opportunity_SAMPLE_XMD.json" } ], "components": [{ "label": "Image Component", "name": "ImageComponent_tp", "condition": "${Variables.Overrides.createAllComponents}", "file": "components/ImageComponent.json" } ], "imageFiles": [{ "name": "LayingOutjpg", "condition": "${Variables.Overrides.createAllImages}", "file": "images/LayingOut.jpg" "namespace": "${Org.Namespace}" //if org is namespaced }, { "name": "png1", "condition": "${Variables.Overrides.createAllImages}", "file": "images/head.png" "namespace": "${Org.Namespace}" //if org is namespaced } ], "extendedTypes": {}, "templateDependencies": [], "icons": { "appBadge": { "name": "3.png" }, "templateBadge": { "name": "dtc_sales" }, "templatePreviews": [{ "name": "home_dashboard", "label": "The Sales Home Dashboard", "description": "Get an overview of your sales team and dig into the key performance indicators that matter most to you." }, { "name": "sales_results", "label": "Sales Performance with Selectable Measures", "description": "Key metrics about your sales team's performance, including details for each team member." } ] }, "tags": [ "Sales", "Team leaders", "Operations" ], "customAttributes": [{ "label": "Features", "values": [ "Prebuilt apps", "External CSV data", "Mobile ready" ] }, { "label": "Data Source", "values": [ "External CSV data", "Salesforce Opportunities Object" ] }, { "label": "Developer", "values": [ "Manny" ] } ] } ``` **See Also** - [template-info.json Attributes](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-template-info-json-attributes.md) # TemplateApexException Apex Examples Use the `TemplateApexException` class to handle errors cleanly and provide clear information to template users. **note:** Throwing an exception fails the configuration wizard. You can also create variables to track errors and report them to the user in the wizard without failing. ## Report an error to the user with a TemplateApexException: ```nolang public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo template) { // Run a query if Forecast History is enabled and report failure if isn't List usersWithForecast = Database.query('SELECT Id FROM User WHERE ForecastEnabled = true LIMIT 1'); if (usersWithForecast.isEmpty()) { // Report issue to user throw new TemplateApexException('Forecast history is not enabled. Please have your admin enable it.'); } } ``` ## Handle database exceptions with a TemplateApexException ```nolang public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo template) { String query = 'SELECT DeveloperName, MasterLabel, SplitField, SplitEntity FROM OpportunitySplitType WHERE IsActive = true AND SplitEntity = \'Opportunity\''; try { List activeSplitTypes = Database.query(query); if (activeSplitTypes.isEmpty()) { template.getVariables().get('Has_OpportunitySplits').setComputedValue('No'); } else { template.getVariables().get('Has_OpportunitySplits').setComputedValue('Yes'); } } catch (Exception e) { throw new TemplateApexException('Database query to determine Opportunity Splits failed: ' + e.getMessage()); } } ``` # Templated App Type The app you’re creating a template for can be a standard app that users install using the configuration wizard in CRM Analytics Studio. Or it can be an embedded app that is automatically installed for users and doesn’t require customization or access to Analytics Studio. You can also create data templates that users install in the Data Manager. Data templates only create data assets. In this guide, all template types follow the same steps for creation, iterative development, and testing the template. The main difference between the templates types is how the app or data assets are created in the user org from your template. ## Standard App Templates A standard app template has a `templateType` of `app`. A standard app template is listed in the Analytics Studio in the **Create→App** menu. You can design a custom creation experience for CRM Analytics users by creating a configuration wizard. Users can customize the app assets after creation, reconfigure the templated app, and upgrade the app, all in Analytics Studio. ## Embedded App Templates An embedded app template has a `templateType` of `embeddedapp`. An embedded app doesn’t require users to have access to Analytics Studio. The embedded app is created when a managed package containing the template and other supporting assets is installed in a Salesforce org. An embedded template uses the auto-install framework to install the app in an org without user interaction. ## Embedded App Considerations Embedded apps are designed for users who don’t have the full CRM Analytics experience. As a result, the following restrictions apply for embedded apps: - Only one embedded app instance per template can be created in a Salesforce org. Multiple embedded app templates can be present in a org. - Dashboards can’t contain Apex or SOQL steps. - Bulk actions aren’t allowed. - App assets can’t be customized by users after the app is created. Embedded app templates aren’t visible in Analytics Studio, nor are they returned in the Rest GET call to the `wave/templates` endpoint. To create a successful embedded app template, you must include the `folder.json` and the `auto-install.json` files. The `folder.json` file specifies the name and label for the templated app along with setting sharing rules for the app. The embedded app can’t be shared with other users and groups in Analytics Studio. The `auto-install.json` file specifies the configuration of the auto-install framework hook and the app installation. After an embedded app is created, the app dashboards must be surfaced for users using the CRM Analytics Dashboard Lightning component. ## Data Templates A data template has a `templateType` of `data`. A data template only creates data assets, like recipes and datasets. A data template is listed in the Data Manager using the **New Data App** button. You can design a custom creation experience for Data Manager users by creating a configuration wizard. Users can customize and schedule the data assets after creation. ## Data Template Considerations Data templates are designed for users who want to load and transform data in Salesforce. As a result, the following limitations apply for data templates. **template-info.json** - Use `data` for `templateType`. - Only the first entry in `templatePreviews` is shown to the user in the wizard. - `customProperties` aren’t shown to the user in the wizard. A data template can only contain `datasetFiles`, `externalFiles`, and `recipes` assets. **Not supported in the Data Manager wizard** In `template-info.json`: `templateDependencies`. In `ui.json`: `displayMessages`, `helpUrl`, and `vfPage`. **Supported for data templates only** In `ui.json`, `DatasetAnyFieldType` and `ArrayTypes` of `DatasetAnyFieldType` variables can be added to pages. For more information on the user experience for templated data apps, see [Get Started Faster with Data Templates (Beta)](https://help.salesforce.com/s/articleView?id=analytics.bi_data_templates_overview.htm&type=5). # TemplateInterruptException Apex Example Use the `TemplateInterruptException` class to handle template runtime errors cleanly and provide clear information to template users. **note:** Throwing an exception fails the app creation process. ## Report an error to the user with a TemplateInterruptException: ```nolang public override void beforeAppCreate(wavetemplate.WaveTemplateInfo template. wavetemplate.Answers answers) { // Validate that an answer is present and has a value. String includeCasesAnswer = (String)answers.get('IncludeCases'); if (includeCasesAnswer.isEmpty() || includeCasesAnswer == null) { // Report issue to user throw new TemplateInterruptException('You didn't answer "yes" to the question that asked if you use Cases. Go back to the wizard and answer this question.'); } } ``` # Test WaveTemplateConfigurationModifier Test the `WaveTemplateConfigurationModifier` before deploying a template that uses it. Before you can deploy your template or package it for the Salesforce AppExchange that uses a `WaveTemplateConfigurationModifier` class, a unit test class must be present and all of the tests must complete successfully. The unit test is designed to call and run the modifier methods and nothing more. Use the following examples when creating your own unit test class. Use the `wavetemplate.Test` helper methods for testing. - `wavetemplate.Test.getWaveTemplateInfoForApexTesting`. Retrieves the runtime template information object for testing. Requires `templateName`: ```nolang getWaveTemplateInfoForApexTesting(String templateName) ``` - `wavetemplate.Test.getDefaultAnswersForApexTesting`. Retrieves the variable answers set by user selections and/or the configuration modifier methods. Requires `templateName`: ```nolang getDefaultAnswersForApexTesting(String templateName) ``` The following code examples show how to test the methods from the [Apex Examples](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-apex-class-examples.md) page. ## Example **Generic Test Class Example** ```nolang @isTest private class ExampleWaveTemplateConfigurationModifierTest { @isTest static testMethod void testModifier() { // Test modifier methods } } ``` ## Example **`beforeAppCreate` Test Method Example** ```nolang @isTest static testMethod void testBeforeAppCreate() { wavetemplate.WaveTemplateInfo template = wavetemplate.Test.getWaveTemplateInfoForApexTesting('my_template'); wavetemplate.Answers answers = wavetemplate.Test.getDefaultAnswersForApexTesting('my_template'); ExampleWaveTemplateConfigurationModifier mod = new ExampleWaveTemplateConfigurationModifier(); //Test the beforeAppCreate method in your Apex Modifier Class System.assertEquals('Yes', answers.get(Has_Product)); mod.beforeAppCreate(template, answers); System.assertEquals('No', answers.get(Has_Product)); } ``` ## Example **`beforeAppUpdate` Test Method Example** ```nolang @isTest static testMethod void testBeforeAppUpdate() { wavetemplate.WaveTemplateInfo template = wavetemplate.Test.getWaveTemplateInfoForApexTesting('my_template'); wavetemplate.Answers answers = wavetemplate.Test.getDefaultAnswersForApexTesting('my_template'); ExampleWaveTemplateConfigurationModifier mod = new ExampleWaveTemplateConfigurationModifier(); //Test the beforeAppUpdate method in your Apex Modifier Class System.assertEquals('No', answers.get(Has_Product)); mod.beforeAppUpdate(template, '2.0', answers); System.assertEquals('Yes', answers.get(Has_Product)); } ``` ## Example **`onConfigurationRetrieval` Test Method Example** ```nolang @isTest static testMethod void testOnConfig() { wavetemplate.WaveTemplateInfo template = wavetemplate.Test.getWaveTemplateInfoForApexTesting('my_template'); ExampleWaveTemplateConfigurationModifier mod = new ExampleWaveTemplateConfigurationModifier(); //Test the onConfigurationRetrieval method in your Apex Modifier Class mod.onConfigurationRetrieval(template); System.assertEquals('No', template.getVariables().get('Has_Product').getComputedValue()); } ``` For complete information, see [Testing Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing.htm). # The Configuration Wizard A CRM Analytics template can include a configuration wizard, made up of one or more pages with questions and answers, that allows users to customize the apps they create from the template. The configuration wizard is an optional but potentially powerful part of a template. **important:** If your template is `templateType` of `embeddedapp`, the configuration wizard isn’t available for users. Embedded apps aren’t visible or installable in CRM Analytics Studio. Instead, they use the auto-install framework to install without user interaction. The configuration wizard guides users through creation of an app from the template. Users make selections that determine how the app they create from your template modifies the original. Most CRM Analytics templates developed by Salesforce include wizards. It’s likely that every customer creates a different version of an app from the template. But every customer starts with the same app template. A wizard can include questions about the data used to populate app dashboards. For example, it can ask about which Salesforce objects are used and which fields are used to store specific elements, such as user IDs, geographic location, product information, and revenue. A wizard can also ask about how to display data in the app and whether the user wants to include or exclude dashboards. Also, it can let users set elements of the UI, such as labels to identify KPIs or dashboard colors. Wizards can also include conditional questions. For example, one question can ask if a user wants to display customer satisfaction key performance indicators about service agents. If the user answers yes, the wizard can then display more questions asking about how the user wants dashboards to consume and display customer service data. Further, the wizard can contain an org data check. App datasets and dashboards usually depend on the Salesforce org where it’s created to contain specific data— certain objects, or fields in objects—to render effective visualizations. The data check reviews the org for the required data. If it’s in the org, app creation continues. If not, the wizard can display a message telling the user what requires fixing. To create the configuration wizard, you modify the template JSON files that contain the instructions the CRM Analytics platform uses to create the app. When a user creates an app from a template, CRM Analytics looks at the template JSON files’ contents, including your wizard selections. It follows instructions in the JSON to create the app. # The InsightsExternalData Object With the InsightsExternalData object, you can configure and control external data uploads. You can use it to provide metadata, trigger the start of the upload process, check status, and request cancellation and cleanup. The InsightsExternalData object is used with the InsightsExternalDataPart object, which holds the parts of the data to be uploaded. Together, they provide a programmatic way to upload a large file in parts and trigger a dataflow into a dataset. The first step is to insert a row into the InsightsExternalData object. Data parts are then uploaded to InsightsExternalDataPart objects. The Mode field is used to enable faster uploads. The Action field of the InsightsExternalData object is updated to start processing and request cancellations. After the Action field is updated to request processing, no user edits are allowed on the objects, except to request cancellation. **note:** The standard system fields (`CreatedById`, `CreatedDate`, `LastModifiedById`, `LastModifiedDate`, and `SystemModstamp`) are documented in [System Fields](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/system_fields.htm) in the _Salesforce Object Reference_. The InsightsExternalData object is available in API version 31 and later. ## Supported Calls `create()`, `delete()`, `describeSObjects()`, `query()`, `retrieve()`, `update()`, `upsert()` ## Fields Use the following fields with the `InsightsExternalData` object. ## Action **Type:** Picklist **Properties:** Create, Filter, Group, Sort, Update **Description:** Action to perform on this data. Values: `Abort`, `Delete`, `None`, `Process`. ## CompressedMetadataLength **Type:** Int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Length of the compressed metadata JSON file. This is a system field. ## Dataflow **Type:** String **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Dataflow ID used to create the dataset (API v34+). This is a system field. ## Description **Type:** String **Properties:** Create, Filter, Nillable, Sort, Update **Description:** Description of the dataset used during dataset creation. ## EdgemartAlias **Type:** String **Properties:** Create, Filter, Group, Sort, Update **Description:** Unique dataset alias (maximum 80 characters). ## EdgemartContainer **Type:** String **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** App developer name or app ID that contains the dataset. ## EdgemartLabel **Type:** String **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Dataset display name (maximum 255 characters). ## FileName **Type:** String **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** External data file identifier (maximum 255 characters). ## Format **Type:** Picklist **Properties:** Create, Filter, Group, Sort, Update **Description:** Uploaded data format. Values: `Csv`, `Binary`. ## isDependentOnLastUpload **Type:** Boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Reserved for future use. ## isIndependentParts **Type:** Boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Reserved for future use; indicates whether parts can be processed independently. ## LicenseType **Type:** Picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** License type of the external data file. Default: `EinsteinAnalytics`. ## MetaDataLength **Type:** Int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Length of metadata JSON file. This is a system field. ## MetadataJson **Type:** Blob (Base64-encoded string) **Properties:** Create, Nillable, Update **Description:** Metadata JSON that describes uploaded file structure. ## Mode **Type:** Picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Upload mode. Values: `Incremental`, `None`. ## NotificationEmail **Type:** String **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Email address used for upload notifications. ## NotificationSent **Type:** Picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Notification condition for upload events. Default: `WarningsFailures`. ## Operation **Type:** Picklist **Properties:** Create, Filter, Group, Sort, Update **Description:** Dataset load operation. Values: `Append`, `Delete`, `Overwrite`, `Upsert`. ## Status **Type:** Picklist **Properties:** Create, Filter, Group, Sort, Update **Description:** Data upload job status. Default value: `New`. ## StatusMessage **Type:** String **Properties:** Create, Nillable, Update **Description:** Error or warning reason for the upload status. ## SubmittedDate **Type:** String **Properties:** Create, Filter, Nillable, Sort, Update **Description:** Time when upload was submitted or set to Process. This is a system field. ## Target **Type:** Picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Target for external data. Valid value: `Dataset`. # The InsightsExternalDataPart Object The InsightsExternalDataPart object enables you to upload an external data file that has been split into parts. The InsightsExternalDataPart object works with the InsightsExternalData object. After you insert a row into the InsightsExternalData object, you can create part objects to split up your data into parts. If your initial data file is larger than 10 MB, split your file into parts that are smaller than 10 MB. **note:** The standard system fields (`CreatedById`, `CreatedDate`, `LastModifiedById`, `LastModifiedDate`, and `SystemModstamp`) are documented in [System Fields](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/system_fields.htm) in the _Salesforce Object Reference_. The InsightsExternalDataPart object is available in API version 31 and later. ## Supported Calls `create()`, `delete()`, `describeSObjects()`, `query()`, `retrieve()`, `update()`, `upsert()` ## Fields Use the following fields with the `InsightsExternalDataPart` object. ## CompressedDataLength **Type:** Int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The length of the compressed data. This field is overwritten when data is uploaded. ## DataFile **Type:** Blob (Base64-encoded string) **Properties:** Create, Nillable, Update **Description:** The data bytes. Parts are required to be smaller than 10 MB. For data greater than 10 MB, compress the file and split it into parts. Only the gzip format is supported. ## DataLength **Type:** Int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The length of the data. This field is overwritten when data is uploaded. ## InsightsExternalDataId **Type:** String **Properties:** Create, Filter, Group, Sort **Description:** The ID of the InsightsExternalData object that this part belongs to. ## PartNumber **Type:** Int **Properties:** Create, Filter, Group, Sort, Update **Description:** The part number. Part numbers are required to be in a contiguous sequence, starting with 1 (for example, 1, 2, 3). # The Process at a Glance After creating a source app in CRM Analytics, follow these steps to create and work with a template. The next sections of the developer guide provide details about each step. Start by developing an app in CRM Analytics Studio. That becomes the source app you use as the basis for your template. We recommend that you complete Steps 1 through 4 and 8 in Microsoft Visual Studio (VS) Code, issuing command line interface (CLI) commands from the tool’s Command Palette and using its JSON editor. 1. **Create the WaveTemplate object and files.** Create the first version of the template from the source app. 2. **Retrieve (export) the WaveTemplate object and files.** Make the files available on your local file system for editing. 3. **Edit the JSON files.** Build the configuration wizard user interface, variables, conditions, and rules into your template by editing the JSON files. You can also customize the wizard with VisualForce and add other enhancements. Use your preferred Integrated Development Environment (IDE) to edit the files, regardless of whether you create them using CLI or VS Code. 4. **Deploy the WaveTemplate object.** After editing the files in an IDE, push the them back to your development org for testing. Deploy the object every time you edit the JSON. Pulling the template files back from the development org overwrites the files on your local workstation. 5. **Test the template.** Testers can now create apps from the template in Analytics Studio for testing. After getting test results, retrieve the template object files again (Step 2), make further edits (Step 3), and redeploy them (Step 4). It’s an iterative cycle. And every time you change the JSON files, and deploy your template, test the template again. 6. **Share the template with users.** Enables creation of apps from the template. 7. **Create apps from the template.** Users create apps in Analytics Studio or by installing a managed package. Based on their feedback, continue iterative development of the app and template. 8. **Update an existing template.** Update the template after editing source app assets, including dashboards, lenses, datasets, recipes, and dataflows in Analytics Studio. **See Also** - [Create an App](https://help.salesforce.com/s/articleView?id=analytics.bi_app_create.htm&type=5) # The Source App For the purposes of CRM Analytics Templates, the app you create in CRM Analytics Analytics Studio is called the _source app_. It’s a collection of CRM Analytics assets—datasets, dataflows, recipes, lenses, and dashboards— stored together in a folder. You create the template—actually a set of JSON files—from that source app. If you update the source app in Analytics Studio, you can also update the template. The same template can also be updated by source apps in different orgs. This lets your team work collaboratively on the source app and its template. That is, more than one developer can work on the template, at the same time. ![This diagram depicts multiple orgs collaborating on a template.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_source_collaboration.png) **note:** We use the term _source app_ to refer to the app you work on, the one on which you base your template. When organizations use your template to create their own apps, we refer to them as _downstream apps_. Templates can reuse dashboards, lenses, and datasets that are part of apps other than the source app by creating dependencies on those assets. The reused assets must be part of apps created from templates. See [Share CRM Analytics Assets Between Apps](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-share-assets.md). # The Template Object Turning the source app into a template creates a `waveTemplates` object. The object contains JSON files that define an app's user experience assets and provide instructions to create the app. Template objects—called `waveTemplates`—contain two types of JSON files: - CRM Analytics app asset JSON files: Files that define the assets you create when you develop a CRM Analytics app using the tools available through CRM Analytics Studio: dashboards, lenses, datasets, recipes, dataflows, and components. Users also interact with these elements. Each app must have at least one dashboard and dataset. Dataflows and recipes are optional, but common for anything but the simplest template. Each asset has a corresponding JSON file. - CRM Analytics template JSON files: Files with instructions used by CRM Analytics to create app assets from the template. You edit these files to give users the ability to customize their version of the app. `waveTemplates` objects contain the following files. | File type | File name | Description | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | App asset JSON | `dashboard_name.json` | One JSON file for each dashboard in the source app, with the same name as its corresponding dashboard. | | App asset JSON | `lens_name.json` | One JSON file for each lens in the source app, with the same name as its corresponding lens. | | App asset JSON | dataset files (internal: internal dataset files, user `xmd.json`; external: `dataset.csv`, `dataset_schema.json`, user `xmd.json`) | Most templates include datasets to provide meaningful content, but a template doesn't require a dataset. Apps without datasets can include a dashboard that's a shell with layout only, or one that uses a query to supply data. Dataset files can be internal or external. The template includes internal datasets defined by [User XMD](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_xmd.meta/bi_dev_guide_xmd/bi_xmd_intro.htm). External dataset files refer to CSV datasets such as `dataset.csv`, but they also include `dataset_schema.json` and extended metadata (user XMD) files, such as `xmd.json`. You must have one CSV file for every external dataset in the source app. Without it, there are no external files in the template. The `dataset_schema.json` and user `xmd.json` files are optional. | | App asset JSON | dataflow files | Dataflows are one method to create internal datasets for your app, extracting and processing useful data. Templates support apps with multiple dataflows. Order the files carefully: The last dataflow can reference datasets inside the first, but the first dataflow can't reference the last. | | App asset JSON | recipe files | Recipes are another method to create internal datasets for your app, extracting and processing useful data. Templates support apps with multiple recipes. Order the files carefully: recipes are created in listed order. If dataflows are present, they're executed before the recipes. For more information on adding recipes to a template, see [Add a Recipe to a CRM Analytic Template](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-add-recipe.md). | | App asset JSON | dashboard component files | Dashboard components are a type of dashboard widget that can contain other widgets and pages. These components are used to manage and reuse groups of charts, tables, filters, text, and more in multiple dashboards in your app. Each app created from your template creates a unique instance of the component. The app dashboards reference these components by the unique name to ensure the component functionality is correct. | | App asset JSON | data transform files | Data transforms create internal datasets from Data 360 data model objects. In Winter '24, data transforms can only be added to a template manually. | | Template JSON | image files (JSON) | Include if images are used in dashboards in the source app or referred to in `template-info.json` for display in configuration wizard pages, such as the template picker or template detail page. One image file for each image. Images must be stored as Salesforce static resources. If an org is namespaced, set the static resources `namespace` attribute in the `template-info.json` entry for the image. | | Template JSON | `template-info.json` | Defines the template metadata referencing all elements of your template, including all the app asset and template asset JSON files defined in this table. | | Template JSON | `folder.json` | Lists the order in which dashboards (`featuredAssets`) appear. If not set, dashboards appear in alphabetical order. | | Template JSON | `releasenotes.html` | Defines the text describing the features and benefits of the template. Update to describe enhancements to a new template version. | | Template JSON | `variables.json` | Defines the variables used by the template JSON files. Includes text for configuration wizard questions and specifications for the answers | | Template JSON | `ui.json` | Manages the configuration wizard. It defines the number of wizard pages, the order of wizard questions, and any messages you want the user to see as the make wizard selections. Configuration settings can determine if a wizard page or question is hidden based on selections made in answer to other wizard questions. | | Template JSON | `org-readiness.json` | Defines the validations that check if the org can create an app from the template successfully. Some validations run when the template is loaded, before the configuration wizard loads, and others run during app creation. Validation success and error messages can be defined and passed to the user. | | Template JSON | `template-to-app-rules.json` | Defines the rules the template follows when creating the app, including changes made to app assets in response to user selections in answer to wizard questions. For example, a rule can determine that if an org doesn't contain data in Salesforce objects, app dashboards don't refer to those objects and the objects are excluded from the dataflow. Rules also determine how the template handles variables. For example, if the wizard asks which fields to include in filters, `template-to-app-rules.json` determines how that choice is reflected in dashboards. Rules are applied when a user creates an app from the template. Typically, a template uses multiple rules files, which must be ordered intentionally. Rules are applied in the order in which you list them. Rules listed later can reference rules listed earlier, but the first rule can't reference any rules listed after it. | | Template JSON | `app_to_template_rules.json` | Defines rules for changing template files after editing the source app. If you make a change that impacts many parts of the app, edit this file. For example, a template creates a waterfall chart based on a dataset selected by the user in the wizard. The sections of the waterfall show a series of measures, also selected using the wizard. To enable the selections to be represented as variables, tokenize a field in the dashboard when updating the template. When the app is created, the value of a variable is replaced. To replace the hard-coded value with a token, add a rule to `app_to_template_rules.json`. | | Template JSON | `auto-install.json` | Optional template file to mark the template for automatic installation. Defines the auto-install hook and app configuration settings for the auto-install framework. Templates with this file present must be of template type `app` or `embeddedapp`. This file isn't generated on template creation, you must create it. Templates created for the auto-install framework must be part of a managed package and installed into customer orgs. On package installation, an auto-install request is generated from this file configuration and the templated app is created automatically. | Example `app_to_template_rules.json` rule: ```nolang { "action":"", "key":"\"\"", "value":"\"${Variables.phoo.fieldName}\"" } ``` # Time Zone Date Functions When you enable the time zone feature, you can use the fields of the `DateTime` and `DateOnly` type to access date information in the specified time zone. For example, if a user in New York runs a SAQL query, they see date information displayed in Eastern Standard time. **note:** In SAQL, the `DateOnly` type displays the date with an empty timestamp, for example, “2014-12-31 00:00:00.” The inclusion of the timestamp is a limitation of the beta release. - **[Use Time Zone-Enabled Dates in SAQL Projections](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-use.md)** You can project an exact date such as 2017-3-31 23:59:59 or part of a date such as year, month, or day. - **[Access Date Functions with Time Zone Enabled](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-access.md)** Use these functions to get the day, week, year, and other parts of `DateTime` or `DateOnly` fields. The return values are numbers. - **[Group By Date](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-group.md)** You can group the result of your SAQL query by `DateTime` and `DateOnly` fields. - **[Order By Date](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-order.md)** You can order the result of your SAQL queries by `DateTime` or `DateOnly`. - **[Filter By Date](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-filter.md)** You can filter results by `DateTime` and `DateOnly` fields. Filters can include exact dates, specific date ranges, or relative date ranges. - **[Calculate the Time Between Two Dates](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-between.md)** Use `date_diff()` and `daysBetween()` to calculate the time between two dates. - **[Convert Dates to and from Strings](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-strings.md)** You can convert dates to strings. - **[Handle Null Dates](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-null-dates.md)** Use `is not null` to filter out null dates. - **[Determine the Day in the Week, Month, Quarter, or Year](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-timezone-day-in.md)** These functions return the day of the week, month, quarter, or year, the date of the last day of the week, month, quarter, or year, and the number of days in the quarter or year. # Time-Based Filtering SAQL gives you many ways to specify the range of dates that you want to look at, such as "all ops from the last fiscal quarter" or "all cases from the last seven days". ## Using Date Ranges in Filters Use these filters to specify the date range you want to look at: - Fixed date range, for example between August 1, 2018 and June 2, 2017 - Relative date range, for example between two years ago and last month - Open-ended ranges, for example before 04/2/2018 - Add and subtract dates, for example all records from three months before yesterday ## Example: Display Opportunities Closed This Month Suppose that you want to see which opportunities closed this month. Your data includes the account name, the close date fields, and the epoch seconds field. ![Diagram showing the number of days each account has been opened for.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_dates_data.png) Use `date()` to generate the close date in date format. Then use relative date ranges to filter opportunities closed in the current month. ```nolang q = load "OpsDates1"; q = filter q by date(’CloseDate_Year’, ‘CloseDate_Month’, ‘CloseDate_Day’) in ["current month" .. "current month"]; q = foreach q generate Account; ``` If the query is run in May 2018, the resulting data stream contains one entry: ![Screenshot displaying opportunities closed in the current month, with seconds epoch time.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_closed.png) To add the close date in a readable format, use `toDate()`. ```nolang q = load "OpsDates1"; q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["current month" .. "current month"]; q = foreach q generate Account, toDate('CloseDate_sec_epoch') as 'Close Date'; ``` The resulting data stream includes the full date and time of the close date. ![Screenshot displaying opportunities closed in the current month, with seconds epoch.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_example_result1.png) You can also display just the month and day of the close date. ```nolang q = load "OpsDates1"; q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["current month" .. "current month"]; q = foreach q generate Account, 'CloseDate_Month' + "/" + 'CloseDate_Day' as 'Close Date'; ``` The resulting data stream contains the month and day of the close date. ![Screenshot displaying opportunities closed in the current month, with close date and day.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_example_result.png) ## Fixed Date Ranges Use `dateRange()` to specify a fixed range of dates in a filter: ```nolang dateRange(startArray_y_m_d, endArray_y_m_d) ``` _startArray_y_m_d_ is an array that specifies the start date _endArray_y_m_d_ is an array that specifies the end date For example, return all records between October 2, 2014 and August 16, 2016: ```nolang q = filter q by date('CreatedDate_Year', 'CreatedDate_Month', 'CreatedDate_Day') in [dateRange([2014,10,2], [2016,8,16])]; ``` ## Relative Date Ranges Use relative date ranges to answer questions such as "how many opportunities did each rep close in the past fiscal quarter"? To specify a relative date range, use the `in` operator on an array with relative date keywords: ```nolang in ["relative_date_keyword_1".."relative_date_keyword_2"] ``` For example, return all records from one year ago up to and including the current year. ```nolang q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["1 year ago".."current year"]; ``` Return all records from two quarters ago, up to and including two quarters from now. ```nolang q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["2 quarters ago".."2 quarters ahead"]; ``` Return all records from the last two fiscal years, up to and including today. ```nolang q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["2 fiscal_years ago".."current day"]; ``` Use these relative date keywords: - current day - n day(s) ago - n day(s) ahead - current week - n week(s) ago - n week(s) ahead - current month - n month(s) ago - n month(s) ahead - current quarter - n quarter(s) ago - n quarter(s) ahead - current fiscal_quarter - n fiscal_quarter(s) ago - n fiscal_quarter(s) ahead - current year - n year(s) ago - n year(s) ahead - current fiscal_year - n fiscal_year(s) ago - n fiscal_year(s) ahead **note:** Only standard fiscal periods are supported. See "About Fiscal Years" in Salesforce Help. ## Open-Ended Date Ranges Use open-ended date ranges for queries such as "List all opportunities closed after 12/23/2014". To specify an open-ended date range, use the `in` operator on an array with a relative date keyword and a notation for up to or including: - `in [.."relative_date_keyword"]` (up to) - `in ["relative_date_keyword"..]` (up to and including) For example, return all records up to and including the current month. ```nolang q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in [.."1 year ago"]; ``` You can also specify a closed relative date range. For example, return all records from up to and including one year ago. ```nolang q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["3 years ago"..]; ``` ## Add and Subtract Dates You can add and subtract dates using the relative date keywords. To specify the date range, use the `in` operator on an array with a relative date keyword, a notation for up to, including, or a range, and the addition or subtraction operators with a time period: - `in [.."relative_date_keyword +/- time_period"]` (up to) - `in ["relative_date_keyword +/- time_period"..]` (up to and including) - `in ["relative_date_keyword_1".."relative_date_keyword_2 +/- time_period"]` (range) For example, return all records from one year ago, up to and including today. ```nolang q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["current day - 1 year"..]; ``` Return all records from today up to two years and three months from now. ```nolang q = filter q by date('CloseDate_Year', 'CloseDate_Month', 'CloseDate_Day') in ["current day".."2 years ahead + 3 months"]; ``` **See Also** - [date()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-datefilter.md) - [Display the Opportunities Closed This Month](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-date-examples.md) # timeseries Uses existing data to predict future data points. The `timeseries` statement must follow a projection statement in your query. Perform any filtering pre-projection or after the `timeseries` statement. **note:** The `timeseries` statement requires a CRM Analytics Growth or CRM Analytics Plus license to return the full set of results. Without one of these licenses, the `timeseries` statement doesn’t fail, but it only returns 1 period of forecasted data. ## Usage `timeseries` crunches your data and selects the forecasting model that gives the best fit. You can let `timeseries` select the best model or specify the model you want. `timeseries` detects seasonality in your data. It considers periodic cycles when predicting what your data will look like in the future. You can specify the type of seasonality or let `timeseries` choose the best fit. The amount of data required to make a prediction depends on how your data is filtered and grouped. For example, for a non-seasonal monthly model, 2 data points are sufficient, whereas for a seasonal monthly model, at least 24 data points (two seasonal cycles) are required. If you don't have enough data to make a good prediction, `timeseries` returns nulls in the data. If no data is passed to `timeseries`, an empty dataset is returned. ## Syntax ```nolang result = timeseries resultSet generate (measure1 as fmeasure1 [, measure2 as fmeasure2...]) with (parameters); ``` _measure1_, _measure2_, and so on, are the measures that you want to predict future values for. You can predict measures from grouping queries or from simple values queries. The predicted values and the original values are projected together. The columns from the previous `foreach` statement are also projected. _parameters_ can have the following values: - `length` (required) Number of points to predict. For example, if length is 6 and the `dateCols` type string is `Y-M`, `timeseries` predicts data for 6 months. **note:** If you want to use `dateCols` but your data stream has missing dates, use `fill` before using `timeseries`. `timeseries` makes the most accurate prediction possible by choosing the best algorithm for your data. Predictive algorithms are more accurate for shorter time periods. - `dateCols` (optional) Date fields to use for grouping the data, plus the date column type string. For example, `dateCols=(CloseDate_Year, CloseDate_Month, "Y-M")`. Date columns are projected automatically. Allowed values are: - `YearField, MonthField, "Y-M"` - `YearField, QuarterField, "Y-Q"` - `YearField, "Y"` - `YearField, MonthField, DayField "Y-M-D"` - `YearField, WeekField "Y-W"` - `ignoreLast` (optional) If `true`, `timeseries` doesn't use the last time period in the calculations. The default is `false`. Set this parameter to `true` to improve the accuracy of the forecast if the last time period contains incomplete data. For example, if you’re partway through the quarter, `timeseries` forecasts more accurately if you set this parameter to `true`. - `order` (optional) Specify the field to use for ordering the data. Mandatory if `dateCols` isn’t used. By default, this field is sorted in ascending order. Use `desc` to specify descending order, for example `order=('Type' desc)`. You can also order by multiple fields, for example `order=('Type' desc, 'Group' asc)`. For example, suppose that your data has no date columns, but it has a measure column called Week. Use `order='Week'`. **note:** Specify either `dateCols` or `order`. - `partition` (optional) Specify the column used to partition the data. The column must be a dimension. The `timeseries` calculation is done separately for each partition to ensure that each partition uses the most accurate algorithm. For example, data in one partition can have a seasonal variation while data in another partition doesn't. The partition columns are projected automatically. For example, suppose that your sales data for raw materials contains the date sold, type of raw material, and the weight sold. To predict the future weight sold for each type of raw material, use `partition='Type'`. - `predictionInterval` (optional) Specify the uncertainty, or confidence interval, to display at each point. Allowed values are `80` and `95`. The upper and lower bounds of the confidence interval are projected in columns named `column_name_low_95` and `column_name_high_95`. - `model` (optional) Specify which prediction model to use. If unspecified, `timeseries` calculates the prediction for each model and selects the best model using Bayesian information criterion (BIC). Allowed values are: - `None` `timeseries` selects the best algorithm for the data - `Additive` uses Holt's Linear Trend or Holt-Winters method with additive components. - `Multiplicative` uses Holt's Linear Trend or Holt-Winters method with multiplicative components - `seasonality` (optional) Use with `dateCols` to specify the seasonality for your prediction. Allowed values are: - `0` No seasonality - any integer between `2` and `24` If unspecified, `timeseries` calculates the prediction for each type of seasonality and selects the results with the smallest error. **Example** |`seasonality`|`dateCols`|Type of Seasonality| |-------------|----------|-------------------| |`seasonality=4`|`dateCols="Y-Q"`|Yearly seasonality, because there are four quarters in a year.| |`seasonality=12`|`dateCols="Y-M"`|Yearly seasonality, because there are 12 months in a year.| |`seasonality=7`|`dateCols="Y-M-D"`|Weekly seasonality, because there are seven days in a week.| ## Tips Here's how you can make the most of using `timeseries`: - Are you currently part way through the month, quarter, or year? Consider setting `ignoreLast` to `true` so that `timeseries` doesn't use the partial data in the current time period, leading to a more accurate prediction. - Is `timeseries` not returning any data? If there aren't enough data points to make a good prediction, `timeseries` returns `null`. Try increasing the number of data points. - Is `timeseries` returning an error? You could have gaps in your dates or times. Like all good forecasting algorithms, `timeseries` needs a continuous set of dates with no gaps, including in each partition. If you think your data has date gaps, try using [`fill`](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-fill.md) first. ## Example - How Many Tourists Will Visit Next Year? Suppose that you run a chain of retail stores, and the number of tourists in your city affect your sales. Use `timeseries` to predict how many tourists will come to your city next year: ```nolang q = load "TouristData"; q = group q by ('Visit_Year', 'Visit_Month'); q = foreach q generate 'Visit_Year', 'Visit_Month', sum('NumTourist') as 'sum_NumTourist'; -- If your data is missing some dates, use fill() before using timeseries() -- Make sure that the dateCols parameter in fill() matches the dateCols parameter in timerseries() q = fill q by (dateCols=('Visit_Year','Visit_Month', "Y-M")); -- Use timeseries() to predict the number of tourists. q = timeseries q generate 'sum_NumTourist' as Tourists with (length=12, dateCols=('Visit_Year','Visit_Month', "Y-M")); q = foreach q generate 'Visit_Year' + "~~~" + 'Visit_Month' as 'Visit_Year~~~Visit_Month', Tourists; ``` Use a timeline chart and set a predictive line to see the calculated future data. The resulting graph shows the likely number of tourists in the future. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_statement_timeseries_tourist.png) ## Example - Predict a Range with 95% Accuracy Suppose that you wanted to predict the number of tourists in your city next year with 95% accuracy. Use `predictionInterval=95` to set a 95% confidence interval for the number of tourists. The upper and lower bounds are projected as the fields `Tourists_high_95` and `Tourists_low_95`. ```nolang q = load "TouristData"; q = group q by ('Visit_Year', 'Visit_Month'); q = foreach q generate 'Visit_Year', 'Visit_Month', sum('NumTourist') as 'sum_NumTourist'; -- If your data is missing some dates, use fill() before using timeseries() -- Make sure that the dateCols parameter in fill() matches the dateCols parameter in timerseries() q = fill q by (dateCols=('Visit_Year','Visit_Month', "Y-M")); -- use timeseries() to predict the number of tourists q = timeseries q generate 'sum_NumTourist' as 'fTourists' with (length=12, predictionInterval=95, dateCols=('Visit_Year','Visit_Month', "Y-M")); q = foreach q generate 'Visit_Year' + "~~~" + 'Visit_Month' as 'Visit_Year~~~Visit_Month', coalesce(sum_NumTourist,fTourists) as 'Tourists', fTourists_high_95, fTourists_low_95; ``` Use a timeline chart and set a predictive line to see the calculated future data. In the timeline chart options, select Single Axis for the **Axis Mode**, fTourists_high_95 for **Measure 1**, and fTourists_low_95 for **Measure 2**. The resulting graph shows the likely number of tourists in the future and the 95% confidence interval. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_statement_timeseries_interval.png) ## Example - Predict Seasonal Data Suppose that you want to predict the revenue for each type of account. You know that your account revenue has yearly seasonality and that you want to group dates by quarter, so you specify `dateCols=('Date_Sold_Year','Date_Sold_Quarter', "Y-Q")` and `seasonality = 4`. To see the predicted values over the next year, use `length=4` to specify four quarters. ```nolang q = load "Account"; q = group q by ('Date_Sold_Year', 'Date_Sold_Quarter', 'Type'); q = foreach q generate 'Date_Sold_Year', 'Date_Sold_Quarter', 'Type', sum('Amount') as 'sum_Amount'; -- If your data is missing some dates, use fill() before using timeseries() -- Make sure that the dateCols parameter in fill() matches the dateCols parameter in timerseries() q = fill q by (dateCols=('Date_Sold_Year','Date_Sold_Quarter', "Y-Q"), partition='Type'); -- use timeseries() to predict the amount sold q = timeseries q generate 'sum_Amount' as Amount with (partition='Type',length=4, dateCols=('Date_Sold_Year','Date_Sold_Quarter', "Y-Q"), seasonality = 4); q = foreach q generate 'Date_Sold_Year' + "~~~" + 'Date_Sold_Quarter' as 'Date_Sold_Year~~~Date_Sold_Quarter','Type', Amount ; ``` Use a timeline chart and set a predictive line to see the calculated future data. The resulting graph shows the likely sum of revenue for each account, taking into account the quarterly seasonal variation. ![Diagram showing the meeting dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_statement_timeseries_seasonal.png) **See Also** - [Forecast Future Data Points with timeseries](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-timeseries.md) - [arimax](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-arimax.md) # TIMESERIES Use the `TIMESERIES()` table function to predict future values based on existing ones tracked over time. Optionally choose a prediction model, confidence interval, and seasonality among other parameters. `TIMESERIES()` takes the following syntax. ```nolang SELECT * FROM TIMESERIES( INPUT=>(SELECT STATEMENT), FIELDS=>ARRAY['MEASURE1', 'MEASURE2,...'], LENGTH=>NUMBER, [DATE_COLS=>ARRAY[, 'DATE_COLUMN_TYPE'],] [IGNORE_LAST=BOOLEAN,] [ORDER=>ARRAY['FIELD_NAME1', 'DESC'|'ASC', 'FIELD_NAME2', 'DESC'|'ASC',...],], [PARTITION=>'FIELD_NAME',] [PREDICTION_INTERVAL=>ARRAY[NUMBER],] [MODEL=>'MODEL_NAME',] [SEASONALITY=NUMBER] ) ``` | Name | Description | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `INPUT` | Required. A `SELECT` statement that includes date information and is the input to the `TIMESERIES()` function. | | `FIELDS` | Required. The field values in the input query from which to predict future values. Predicted values are automatically named `{predicted_fieldName}`. | | `LENGTH` | Required. The number of points to predict. | | `DATE_COLS` | Optional.`{DATE_FIELDS}`—The array of date fields from which to base future predictions.The `{DATE_COLUMN_TYPE}` string accepts these values.
  • `'{YEAR_FIELD}'`, `'{MONTH_FIELD}'`, `'Y-M'`
  • `'{YEAR_FIELD}'`, `'{QUARTER_FIELD}'`, `'Y-Q'`
  • `'{YEAR_FIELD}'`, `'Y'`
  • `'{YEAR_FIELD}'`, `'{WEEK_FIELD}'`, `'Y-W'`
  • `'{YEAR_FIELD}'`, `'{MONTH_FIELD}'`, `'{DAY_FIELD}'`, `'Y-M-D'`
| | `ORDER` | Optional, unless no `DATE_COLS` are specified. | | `PARTITION` | Optional. A field used to split query results into smaller partitions. The `TIMESERIES()` function resets when the field value changes. After each group of rows is completed for a given partition, `TIMESERIES()` runs on the next partition. | | `PREDICTION_INTERVAL` | Optional. The confidence interval to display for each forecasted data point. | | `IGNORE_LAST` | Optional. If set to `TRUE`, excludes the last time period from timeseries calculations. | | `MODEL` | Optional. Choose from these prediction models:
  • `NONE`
  • `ADDITIVE`
  • `MULTIPLICATIVE`
| | `SEASONALITY` | Optional. Use with `DATE_COLS` to specify the seasonality for the prediction. | ## Example This example predicts the annual number of tourists for two years based on available data for previous years. ```nolang SELECT * FROM TIMESERIES( INPUT=>( SELECT EXTRACT(YEAR FROM "date") AS date_Year, SUM(tourists) AS sum_tourists FROM "TouristsData" GROUP BY EXTRACT(YEAR FROM "date")), FIELDS=>ARRAY['sum_tourists'], LENGTH=>2, DATE_COLS=>ARRAY['date_Year', 'Y'] ) ``` | date (Year) | predicted_sum_tourists | Sum of tourists | | ----------- | ---------------------- | --------------- | | 2001 | 13008 | 13140 | | 2002 | 13964 | 13543 | | 2003 | 14934 | 15502 | | 2004 | 15894 | 15894 | | 2005 | 16855 | 16784 | | 2006 | 17816 | 17713 | | 2007 | 18777 | 18719 | | 2008 | 19738 | - | | 2009 | 20700 | - | | 2010 | 21662 | - | ## Example with TIMESERIES() and FILL() To fill in the gaps, the `FILL()` function takes the input of the annual tourist sums and fills in the gaps (if any) in date fields. `TIMESERIES()` takes the input from the `FILL()` function and predicts the number of tourists expected for the specified length. Here, `LENGTH` is set to 3, meaning three years. `IGNORE_LAST` is set to `TRUE` to exclude the last row for 2008 from generating timeseries predictions. `TIMESERIES()` predicts values from 2008–2010. ```nolang SELECT * FROM TIMESERIES( INPUT=>( SELECT * FROM FILL( INPUT=>(SELECT EXTRACT(YEAR FROM "date") AS date_Year, SUM(tourists) AS sum_tourists FROM "TouristsData" GROUP BY EXTRACT(YEAR FROM "date") ), DATE_COLS=>ARRAY['date_Year', 'Y'] ) ), FIELDS=>ARRAY['sum_tourists'], LENGTH=>3, DATE_COLS=>ARRAY['date_Year', 'Y'], IGNORE_LAST=>TRUE ) ``` | date (Year) | predicted_sum_tourists | Sum of tourists | | ----------- | ---------------------- | --------------- | | 2001 | 13008 | 13140 | | 2002 | 13964 | 13543 | | 2003 | 14934 | 15502 | | 2004 | 15894 | 15894 | | 2005 | 16855 | 16784 | | 2006 | 17816 | 17713 | | 2007 | 18777 | 18719 | | 2008 | 19738 | - | | 2009 | 20700 | - | | 2010 | 21662 | - | # toDate() Converts a string or Unix epoch seconds to a date. Returns a date that can be used in another function such as `daysBetween(​)`. The returned date cannot be used in a filter. ## Syntax `toDate(string, [”format"])` If a _format_ argument isn’t provided, the function uses the format `yyyy-MM-dd HH:mm:ss`. _format_ is only valid for converting date string values. For the allowed formats, see [Date Formats](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-date-formats.md). `toDate(epoch_seconds)` The _format_ argument is not valid for converting _epoch_seconds_ numerical values. **note:** Be sure to use the sec_epoch field and not the day_epoch field. ## Example: Display the Exact Date an Opportunity Opened Suppose that you want to see the exact day that an opportunity opened. Use `toDate()` with `CreatedDate_Year`, `CreatedDate_Month`, `CreatedDate_Day`, and an accepted date format. This query will resemble the example below: ```nolang q = load "oppty"; q = foreach q generate toDate(CreatedDate_Year + "/" + CreatedDate_Month + "/" + CreatedDate_Day, "yyyy/MM/dd") as CreatedDate; q = order q by 'CreatedDate'; ``` ## Example: Display the Number of Days Since an Opportunity Opened Suppose that you have an opportunity dataset with the account name and the epoch seconds fields: ![Diagram showing the opportunity dataset.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_opp_dataset.png) You want to see how many days ago an opportunity was opened. Use `daysBetween()` and `now()`. Use `toDate()` to convert the order date epoch seconds to a date format that can be passed to `daysBetween()`. ```nolang q = load "OpsDates1"; q = foreach q generate Account, daysBetween(toDate(OrderDate_sec_epoch), now()) as 'daysOpened'; ``` The resulting data stream displays the number of days since the opportunity was opened. ![Diagram showing the number of days each account has been opened for.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_date_daysopened.png) **note:** Because dates are sorted lexicographically, changing the date format also changes the sort order. **See Also** - [date()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-datefilter.md) # toDateOnly(epoch) Converts an epoch to a `DateOnly` type. ```nolang q = foreach q generate toDateOnly(epoch) as "DateTime"; ``` # toDateOnly(string, format) Converts a date in string format to a `DateOnly` type. _format_ specifies the date format and can be any valid date format. **note:** You can only use this function when the time zone feature is enabled. If the time zone feature is disabled, use the [toDate()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-todate.md) function. ```nolang q = foreach q generate toDateOnly('CloseDate',"yyyy/MM/dd") as DateTime; ``` # toDateTime(epoch) Converts an epoch day to a `DateTime` type. **note:** You can only use this function when the time zone feature is enabled. If the time zone feature is disabled, use the [toDate()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-saql-functions-todate.md) function. ```nolang q = foreach q generate toDateTime(epoch) as "DateTime"; ``` The _format_ argument isn’t valid for converting _epoch_ numerical values. It’s only valid for converting date string values. # toDateTime(string, format) Converts a date in string format to a `DateTime` type. _“format”_ specifies the date format and can be any valid date format. ```nolang q = foreach q generate toDateTime('CloseDate',"yyyy/MM/dd") as DateTime; ``` For the allowed formats, see [Date Formats](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/reference/bi-date-formats.md). If a _format_ argument isn’t provided, the function uses the format `yyyy-MM-dd HH:mm:ss`. _format_ is only valid for converting date string values. It isn’t valid for converting _epoch_ numerical values. # toString() Converts a date to a string. ## Syntax `toString(date, formatString)` For the allowed formats, see [Date Formats](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-date-formats.md). **note:** This function is identical to `date_to_string()`. ## Usage This function must take a `toDate()` or `now(​)` function as its first argument. ## Example ```nolang q = foreach q generate toString(now(​), "yyyy-MM-dd HH:mm:ss") as ds1; ``` # trim() Removes the specified substring from the beginning and the end of a string. ## Syntax `trim`(_string_,_substr_) ## Usage This function removes _substr_ from the beginning and end of _string_, then returns the result. To remove leading and trailing spaces, do not specify a value for _substr_. ## Example ```nolang –- the resulting string in both cases is 'MyString'; q = foreach q generate trim("abcMyStringabc","abc") as 'Trimmed String'; q = foreach q generate trim(" MyString ") as 'Trimmed String'; ``` # trim(LEADING | TRAILING | BOTH, {chars}, {str}) Removes leading or trailing characters from a string. If no characters are specified, the function removes blank spaces. **note:** The trim function isn’t supported in Analytics Studio. An error occurs when the function is used in the UI. The function is available using the Query API. For more information, see [Query CRM Analytics Data with the Query API](https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_rest_api_query_data.htm). - `LEADING` - : Optional. Specify to remove characters from the beginning of the string. - `TRAILING` - : Optional. Specify to remove characters from the end of the string. - `BOTH` - : Optional. Specify to remove characters from both the start and end of the string. If `LEADING`, `TRAILING`, or `BOTH` aren't specified, `trim()` defaults to `BOTH`. ## Example This example shows all variations of the `trim()` function for removing the characters "A", "b", and "n" from the beginning, end, or both sides of the City field string. ```nolang SELECT City, Trim('Abn' FROM City) as TrimCity, Trim(LEADING 'Abn' FROM City) as LTrimCity, Trim(TRAILING 'Abn' FROM City) as RTrimCity, Trim(BOTH 'Abn' FROM City) as BothTrimCity FROM "Superstore" GROUP BY City LIMIT 5; ``` | City | TrimCity | LTrimCity | RTrimCity | BothTrimCity | | ----------- | ---------- | ---------- | ----------- | ------------ | | Aberdeen | erdee | erdeen | Aberdee | erdee | | Abilene | ilene | ilene | Abilene | ilene | | Akron | kro | kron | Akro | kro | | Albuquerque | lbuquerque | lbuquerque | Albuquerque | Ibuquerque | | Alexandria | lexandria | lexandria | Alexandria | lexandria | # Troubleshooting for Tableau Next Embedding There are various error scenarios that may occur during the implementation of embedding Tableau Next components into your web app using the SDK. Each error has an explanation and a resolution. ## Error Handling | Error Code | Error Message | Resolution | | ---------- | ------------- | ---------- | | `INITIALIZATION_ERROR` | `Script load failed: ` | Ensure the `orgUrl` value provided in the embedding code matches your Salesforce org URL. For more information, see [Add the Tableau Next Component to Your Web App](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-initialize-embed.md). | | `AUTH_ERROR` | `LOError: LOApplication: frontdoorURL must be a valid URL` | Ensure the value passed to `authCredential` is a valid Frontdoor URL. Your token broker generates this URL at runtime by POSTing the OAuth access token to `/services/oauth2/singleaccess` and reading `frontdoor_uri`. This is a short-lived value. For more information, see [Generate the Access Token and Frontdoor URL for Tableau Next Embedding](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-access-token.md). | | `CONFIGURATION_ERROR` | `Missing required params: idOrApiName` | Ensure the `idOrApiName` value is provided in the embedding code. For more information, see [Add the Tableau Next Component to Your Web App](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-initialize-embed.md). | | `CONFIGURATION_ERROR` | `Missing required params: Page with label {pageName} not found` | Ensure the `pageName` value is correct in the embedding code. | | `RESOURCE_NOT_FOUND` | `Dashboard with not found` | Ensure the `idOrApiName` value is correct in the embedding code. For more information, see [Add the Tableau Next Component to Your Web App](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-initialize-embed.md). | | `INTERNAL_ERROR` | `Failed to fetch metric: ` | Ensure the `idOrApiName` value is correct in the embedding code. For more information, see [Add the Tableau Next Component to Your Web App](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-integration-initialize-embed.md). | | `INVALID_SESSION` | `Invalid session` | Ensure you have a code implementation for reauthorizing user sessions. | | `UNHANDLED_REJECTION` | `Unhandled Promise Rejection: Lightning Out container error: LWR3009: Unable to resolved bare specifier: analytics_business_user/metric/v/0_0_1` | Contact Salesforce support. | ## idOrApiName Parameter Error The `idOrApiName` parameter is required. If this parameter is missing for the initialization of any components, then the SDK throws an error to the console. ```json { "errorCode": "INTERNAL_ERROR", "message": "Missing required params: idOrApiName" } ``` ## Invalid UnifiedFilterJson Error When the filter is built with invalid values, the `applyFilters` call fails with an INTERNAL_ERROR event. Failures occur when the data source name isn't found, the field name isn't found in the data source, the filter operator isn't a correct enumerated value, or the values in the filter values are invalid. Invalid filter values can occur when the value type doesn't match the field type or there are mixed value types in the values array. ### Example: Filter values are invalid ```json { "errorCode": "INTERNAL_ERROR", "message": "Invalid values in filter JSON" } # trunc({n}[,{m}]) Returns the value of the numeric expression _n_ truncated to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ truncated to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ truncated to the integer place. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. _m_ can be an integer value between -15 and 15 inclusive. `trunc({n}[,{m}])` takes the following syntax. ```nolang SELECT trunc(N[,M]) as AliasName FROM dataset; ``` ## Example This example returns 47.385 truncated to the second decimal place. ```nolang SELECT trunc(47.385, 2) as truncExample FROM Superstore LIMIT 1; ``` | truncExample | | ------------ | | 47.38 | # trunc(n[, m]) Returns the value of the numeric expression _n_ truncated to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ truncated to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ truncated to the integer place. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. _m_ can be an integer value between -15 and 15 inclusive. This function can only be used in a `foreach` statement. ## Example ```nolang q = foreach q generate trunc(Price, 2) as Price; ``` # ui.json Attributes The `ui.json` file attributes are: | Attribute | Required | Description | | ------------------------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------- | | `pages` | No | Container attribute only - array of UI pages to be displayed. | | `pages` → `title` | Yes | String title to be displayed at the top of the page. | | `pages` → `variables` | Yes | Array of variables to display on a page, 1 variable is necessary. | | `pages` → `variables` → `name` | Yes | Variable name, must match name of variable defined in variables.json. | | `pages` → `variables` → `visibility` | No | Variable visibility (visible, disabled, hidden) defined by conditional. | | `pages` → `condition` | No | If condition is met, then the page will display; if the condition is not met, the page will not display. | | `pages` → `helpUrl` | No | URL provided by template dev to additional content to help user with creating app. | | `pages` → `vfPage` | No | Container attribute only: defines the VisualForce Page to customize this page. | | `pages` → `vfPage` → `name` | Yes | The name of VisualForce class to use. | | `pages` → `vfPage` → `namespace` | Yes, if org uses namespace. | The namespace for the org. | | `displayMessages` | No | Container attribute only - array of custom display message, currently only 1 `displayMessage` is supported. | | `displayMessages` → `text` | Yes | Text to display on the app creation progress landing page (running Astro page). | | `displayMessages` → `location` | Yes | `“AppLandingPage”` is only supported location. | **See Also** - [Edit ui.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-edit-ui-json.md) # union Combines multiple result sets into one result set. The result sets must have the same field names and structure. You can use a different dataset to create each result set, or you can use the same dataset. ## Syntax ```nolang result = union resultSetA, resultSetB [, resultSetC ...]; ``` ## Example ```nolang q = union q1, q2, q3; ``` ## Example You want to see how each rep compares to the average for deals won. You can make this comparison by appending these two result sets together:Then use `union` to append the two result sets. - Total amount of opportunities won for each rep - Average amount of opportunities won for all reps First, show the total amount of won opportunities for each rep. ```nolang opt = load "DTC_Opportunity_SAMPLE"; opt = filter opt by 'Won' == "true"; -- group by owner rep = group opt by 'Account_Owner'; -- project the sum of amount for each rep rep = foreach rep generate 'Account_Owner' as 'Account_Owner', sum('Amount') as 'sum_Amount'; rep = order rep by 'sum_Amount' desc; ``` The resulting graph shows the sum of amount for each rep. ![Diagram showing the sum of amounts for each rep.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_union_ex_1.png) Next, calculate the average of the sum of the amounts for each rep using the `average` function. ```nolang -- grouping rep by all returns all the data in a single row. avg_rep = group rep by all; -- Calculate the average of the Sum of Amount column. -- Use the text ‘Average Deal Size’ in the ‘Account Owner’ column avg_rep = foreach avg_rep generate "Average deal size" as 'Account_Owner', avg('sum_Amount') as 'sum_Amount'; ``` Because the two data streams have the same field names and structure, you can use `union` to combine them. ```nolang q = union rep, avg_rep; ``` The resulting graph contains the sum of amounts by each rep together with the average amount per rep. ![Diagram showing the sum of amounts for each rep, plus the average amount.](https://developer.salesforce.com/media/bi_dev_guide_saql/bi_saql_union_ex_2.png) Combine the SAQL fragments to get the complete SAQL statement. ```nolang opt = load "DTC_Opportunity_SAMPLE"; opt = filter opt by 'Won' == "true"; -- group by owner rep = group opt by 'Account_Owner'; -- project the sum of amount for each rep rep = foreach rep generate 'Account_Owner' as 'Account_Owner', sum('Amount') as 'sum_Amount'; rep = order rep by 'sum_Amount' desc; -- grouping rep by all returns all the data in a single row. avg_rep = group rep by all; -- Calculate the average of the Sum of Amount column. -- Use the text ‘Average Deal Size’ in the ‘Account Owner’ column avg_rep = foreach avg_rep generate "Average deal size" as 'Account_Owner', avg('sum_Amount') as 'sum_Amount'; q = union rep, avg_rep; ``` ## Considerations Using a `union` statement and a `join` statement in the same query has strict enforcements. When a `semi` or `anti` `join` statement is present, the `union` statement returns an error if there are: - mismatched number of columns - mismatched data types The errors appear as "Different number of fields found across union streams" or "Different types found for field 1: '_fieldName_' in different union inputs." There's also strict checking on the name of the columns. Using this SAQL example with a `semi` `join` statement and a `union` statement: ```soql q1 = load "Opportunity"; q2 = load "Opportunity"; q1 =join q1 by (AccountId) semi, q3 by (AccountId); q2 = group q2 by all; q1 = foreach q1 generate q1.'AccountId' as 'AccountId',q1.StageName as 'StageName', q1.'Description' as 'Description', q1.'Id' as 'Id',q1.'Amount' as 'Amount', q1.'Probability' as 'Probability'; q2 = foreach q2 generate null as 'AccountId', null as 'StageName',null as 'Description',null as 'Id', sum(unique('Amount')) over([..] partition by all) as 'Amount_total',sum(unique('Probability')) over([..] partition by all) as 'Probability'; q1 = limit q1 5; qU = union q1, q2; ``` When the join is present, strict name checking only allows for one ‘Amount’ column name, which comes from the first stream, `q1`. The ‘Amount_total’ summary column name from the second stream, `q2`, isn’t honored and only the normal 'Amount' column name is in the union results. If the `join` statement is removed, both the normal ‘Amount’ and the summary ‘Amount_total’ column names are in the union results. **See Also** - [cogroup](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-cogroup.md) - [join semi and anti](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-join-semi-anti.md) - [Append Datasets using union](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/concept/bi-saql-examples-union.md) # UNION Operator Use the `UNION` operator to combine the results of two or more `SELECT` statements. The joined statements must have the same number of columns and the same data types for corresponding columns. SQL for CRM Analytics supports `UNION ALL` only. This clause returns all results—it doesn't remove duplicate values. Let's see what happens when we combine two `SELECT` statements that retrieve the `Cities` field. ```nolang SELECT City From "Superstore" UNION ALL SELECT City from "Superstore"; ``` The query returns all `City` results in an unspecified order. | City | | --------------- | | Henderson | | Henderson | | Los Angeles | | Fort Lauderdale | | Fort Lauderdale | | Los Angeles | | Los Angeles | | Los Angeles | | Los Angeles | | Los Angeles | To include an `ORDER BY` or `LIMIT` clause when using the `UNION` operator, you must enclose the first `SELECT` statement in parentheses so that the SQL parser can identify the `UNION` operator. In this example, `ORDER BY City DESC` applies to the results of the full query, not only the second `SELECT` clause. The results display in reverse alphabetical order for the combined set of the `City` field. ```nolang (SELECT City FROM "Superstore" ORDER BY City ASC) UNION ALL SELECT City FROM "Superstore" ORDER BY City DESC; ``` | City | | ------- | | Yuma | | Yuma | | Yuma | | Yuma | | Yuma | | Yuma | | Yuma | | Yuma | | Yucaipa | | Yucaipa | | York | If you include parentheses around the second `SELECT` statement, the query returns results from the first `SELECT` statement in ascending order and the second in descending order. ```nolang (SELECT City FROM "Superstore" ORDER BY City ASC) UNION ALL (SELECT City FROM "Superstore" ORDER BY City DESC); ``` The first ten results show values from the first `SELECT` statement in ascending order. | City | | -------- | | Aberdeen | | Abilene | | Akron | | Akron | | Akron | | Akron | | Akron | | Akron | | Akron | | Akron | # unique() Returns the count of unique values. ## Example - Count the Number of Industries Use `unique()` to count the number of different industries that you have opportunities with. ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by all; q = foreach q generate unique('Industry') as 'unique_Industry'; ``` # Update Salesforce Settings for Tableau Next Embedding After creating your ECA, you need to update your Salesforce settings for trusted domains and use of cookies. Updating settings requires Salesforce Admin permissions. ## Update Session Setting for Trusted Domains Add a trusted domain for the web app where you are embedding your insights. 1. At the top of any Salesforce page, click the setup gear icon, then click **Setup**. ![Setup gear icon](https://developer.salesforce.com/docs/media/sdk/setup_nav_standard.png '{"class": "image-xxs"}') 2. From the Setup page, enter _Session_ in the Quick Find box, and then select **Session Settings**. 3. Scroll down to **Trusted Domains for Inline Frames** and click **Add Domain**. 4. Enter the domain. Acceptable formats are `example.com`, `https://example.com`, and `*.example.com`. 5. Select **Lightning Out** for the iFrame type and save. ## Ensure First-Party Use of Salesforce Cookies is Disabled 1. From the Setup page, enter _My domain_ in the Quick Find box, and then select **My Domain**. 2. In Routing and Policies, check to see if **Require first-party use of Salesforce cookies** is enabled or disabled. 3. If this setting is enabled, click **Edit** for Routing and Policies, deselect **Require first-party use of Salesforce cookies**, and save. ![Edit screen for Routing and Policies with cookies disabled](https://developer.salesforce.com/docs/media/sdk/embedded_tn_disable_cookies.png '{"class": "image-lg"}') --- [Next - Update Salesforce Settings for Tableau Next Embedding](https://developer.salesforce.com/docs/analytics/sdk/guide/sdk-setup-settings.md) # Update the Data After you upload data into a dataset, update it by adding, upserting, or removing data. To update data, set the Action field to `Process` and the Operation field to `Append`, `Upsert`, or `Delete`. This example sets the Action and Operation fields to append data to the InsightsExternalData object. To enable faster uploads, use the Mode field with a value of Incremental. ```nolang SObject sobj = new SObject(); sobj.setType("InsightsExternalData"); sobj.setField("InsightsExternalDataId", parentID); sobj.setField("Action","Process"); sobj.setField("Operation","Append"); sobj.setField("Mode","Incremental"); SaveResult[] results = partnerConnection.update(new SObject[] { sobj }); for(SaveResult sv:results) if(sv.isSuccess()) parentID = sv.getId(); ``` If Mode isn’t specified or is set to `None`, the append is a bulk upload that processes data slower. # upper() Returns a copy of the string with all characters in upper case. ## Syntax `upper`(_string_) ## Usage Returns `null` if _string_ is `null`. ## Example ```nolang upper("java") == "JAVA" ``` # upper({str}) Returns a copy of string _str_ with all cased characters converted to uppercase. ## Example This example returns the first five entries in the City column in uppercase. ```nolang SELECT upper(City) as upperCity FROM "Superstore" GROUP BY City LIMIT 5; ``` | upperCity | | ----------- | | ABERDEEN | | ABILENE | | AKRON | | ALBUQUERQUE | | ALEXANDRIA | # Use Array Functions for Multi-Select Widgets and Looping Here’s how to use an array function to create a configuration wizard widget that lets the user select multiple values. ## Create a Multi-Select Widget This `ArrayType` variable creates a wizard widget that lets the user select multiple values. ```json "Account_Fields": {        "label": "Pick the fields for your dataset",        "description": "Multiselect sobjectfield test",        "defaultValue": [          {            "sobjectName": "Account",            "fieldName": "Name"          }        ],        "required": false,        "variableType": {            "type": "ArrayType",            "itemsType": {                "type": "SobjectFieldType"            }        },        "excludeSelected": true    } ``` Results in the following wizard widget: ![This diagram depicts the resulting wizard question.](https://developer.salesforce.com/docs/media/atf/atf_multiselect_sobjectfield.png) The `ArrayType` variable contains an `itemsType` attribute, which accepts the following: - `SObjectType` - `SObjectFieldType` - `DatasetType` - `DatasetDateType` - `DatasetDimensionType` - `DatasetMeasureType` - `StringType` - `NumberType` ## How the Widget Stores Selections The widget places values in an array. The following show how the widget displays values for the user to select: ![These two images depict how selections in the widget are placed into an array.](https://developer.salesforce.com/docs/media/atf/atf_widget_array1.png) ![These two images depict how selections in the widget are placed into an array.](https://developer.salesforce.com/docs/media/atf/atf_widget_array2.png) ## Reference Array Items by Index Items in the array can be referenced by index. Arrays of `StringType` and `NumberType` are easy to work with, but arrays of `SObjectType` and `SObjectFieldType` contain multiple attributes for each item in the array. Array of `SobjectFieldType`: | Expression | Returns | | ------------------------------------------- | -------------------------------------------------------------------------------------------- | | `${Variables.Account_Fields[0]}` | (`sobjectName`=Account, `fieldName`=Name, `sobjectLabel`=Account, `fieldLabel`=Account Name) | | `${Variables.Account_Fields[0].fieldName}` | Name | | `${Variables.Account_Fields[0].fieldLabel}` | Account Name | **note:** `fieldName` is required for workflows. ## Access Array Values in Template Files The selection values from the widget are stored in the variable. There are two ways to access them in the template files (rules, dashboards, workflow). **Without looping** Use array values from `SobjectFieldType` by index. ```json "fields":[   {"name":"${Variables.Account_Fields[0].fieldName}"},   {"name":"${Variables.Account_Fields[1].fieldName}"},   {"name":"${Variables.Account_Fields[2].fieldName}"},   {"name":"${Variables.Account_Fields[3].fieldName}"},   {"name":"${Variables.Account_Fields[4].fieldName}"} ] ``` This example, without looping, would be tricky to use, because there would always need to be at least five items in the array. Any fewer would fail, and anything over five would not be used. **With looping** Use array values from `SobjectFieldType` with the `array:forEach` function. In this example, a `“set”` action loops through the `SObjectFieldTypes` in the array and adds them to the `“fields”` attribute in the `Extract_Account` step of the workflow. Each entry in `“fields”` needs “name” and `“var.fieldName”`. **rules.json** ```json "name": "AddAccountFilesToWorkflow",  "appliesTo": [    {      "type": "workflow",      "name": "*"    }  ],  "actions": [    {      "action": "set",      "description": "use selected values for sfdcDigest in workflow",      "path": "$.workflowDefinition.Extract_Account.parameters.fields",      "value": "${array:forEach(Variables.Account_Fields, '{\"name\": \"${var.fieldName}\"}')}"    }  ] ``` **workflow.json** ```json "Extract_Account":{   "action":"sfdcDigest",   "parameters":{       "fields":[],       "object":"Account"   } } ``` **Result after processing** If `Account Name`, `Account Source`, and `Industry` are selected: ```json "Extract_Account":{ "action":"sfdcDigest", "parameters":{ "fields":[ {"name":"Name"}, {"name":"AccountSource"}, {"name":"Industry"} ] } } ``` ## Combine Arrays These functions extend the power of `array:forEach`. **array:union** Uses only unique values, so no values are duplicated. ```json "value": "${array:union(array:forEach(Variables.Account_Fields, '{\"name\": \"${var.fieldName}\"}'),array:forEach(Variables.Account_Fields2, '{\"name\": \"${var.fieldName}\"}'))}" ``` **array:concat** Two new arrays: ```json "value": "${array:concat(array:forEach(Variables.Account_Fields, '{\"name\": \"${var.fieldName}\"}'),array:forEach(Variables.Account_Fields2, '{\"name\": \"${var.fieldName}\"}'))}" ``` One new array with an existing array: ```json "value":"${array:concat(Rules.CurrentNode, array:forEach(Variables.Account_Fields, '{\"name\":\"${var.fieldName}\"}'))}" ``` **Which actions support array functions** You can use array functions in the `“set”` and `“put”` actions, but not in the `“add”` or `“delete”` actions. **note:** In `“add”`, the value is being added to an existing array, so the result is an array inside an array, which is not well-formed JSON. To add more array values to an existing array, use `“set”` with the `array:concat` function. For `“delete”`, value is not used. ## Use `StringType` and `NumberType` Arrays You can use array values from `StringType` the same way as from `NumberType`. **variables.json** ```json "Account_Fields_String": {        "label": "Pick string fields for your dataset",        "description": "Multiselect string test",        "defaultValue": ["Name"],        "required": true,        "variableType": {            "type": "ArrayType",            "itemsType": {                "type": "StringType",                "enums": ["Name", "AccountSource", "Industry", "Type"]            }        }     } ``` **rules.json** ```json "value": "${array:forEach(Variables.Account_Fields_String, '{\"name\": \"${var}\"}')}" ``` ## Replace Multiple Yes/No Widgets You can also use the multiselect widget to replace multiple `StringType` widgets with `“Yes”` and `“No”` selections. This example uses three `StringType` widgets on one wizard page: ![This image depicts an example of three string types in one wizard page.](https://developer.salesforce.com/docs/media/atf/atf_3stringtypes_1wiz.png) You can replace this with a single `ArrayType` widget: ![This image depicts an example of replacing three string types with a single arrayType widget.](https://developer.salesforce.com/docs/media/atf/atf_arraytype_widget.png) The JSON for this variable is: ```json "SelectedFeatures": {    "label": "Please select the features you would like to enable?",    "description": "The selected features for this app",    "defaultValue": [     "Apex Execution"    ],    "variableType": {      "type": "ArrayType",      "itemsType" : {        "type" : "StringType",        "enums" : [         "Apex Execution",         "API",         "Content Transfer",         "Dashboard",         "Login",         "Report Export",         "Rest API",         "Setup Audit Trail",         "UI Tracking",         "URI",         "Visualforce Request",         "Wave Change",         "Wave Interaction",         "Wave Performance"        ]    }    },    "required": true  } ``` You can use the selected values to set constants in `rules.json`, which you can then reference in conditionals for actions or in `template-info.json`. ```json "constants" : [ {"name":"hasApexExecution", "value": "${array:contains(Variables.SelectedFeatures, 'Apex Execution')}"}, {"name":"hasAPI", "value": "${array:contains(Variables.SelectedFeatures, 'API')}"}, {"name":"hasContentTransfer", "value": "${array:contains(Variables.SelectedFeatures, 'Content Transfer')}"}, {"name":"hasDashboard", "value": "${array:contains(Variables.SelectedFeatures, 'Dashboard')}"}, {"name":"hasLogin", "value": "${array:contains(Variables.SelectedFeatures, 'Login')}"}, {"name":"hasReport", "value": "${array:contains(Variables.SelectedFeatures, 'Report Export')}"}, {"name":"hasRestApi", "value": "${array:contains(Variables.SelectedFeatures, 'Rest API')}"} ] ``` [Back to Rules Overview](https://developer.salesforce.com/docs/analytics/app-template-framework/guide/atf-rules-overview.md) # Use Array Functions for Multi-Select Widgets and Looping Here’s how to use an array function to create a configuration wizard widget that lets the user select multiple values. ## Create a Multi-Select Widget This `ArrayType` variable creates a wizard widget that lets the user select multiple values. ```nolang "Account_Fields": {        "label": "Pick the fields for your dataset",        "description": "Multiselect sobjectfield test",        "defaultValue": [          {            "sobjectName": "Account",            "fieldName": "Name"          }        ],        "required": false,        "variableType": {            "type": "ArrayType",            "itemsType": {                "type": "SobjectFieldType"            }        },        "excludeSelected": true    } ``` Results in the following wizard widget: ![This diagram depicts the resulting wizard question.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_multiselect_sobjectfield.png) The `ArrayType` variable contains an `itemsType` attribute, which accepts the following: - `SObjectType` - `SObjectFieldType` - `DatasetType` - `DatasetDateType` - `DatasetDimensionType` - `DatasetMeasureType` - `StringType` - `NumberType` ## How the Widget Stores Selections The widget places values in an array. The following show how the widget displays values for the user to select: ![These two images depict how selections in the widget are placed into an array.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_widget_array1.png) ![These two images depict how selections in the widget are placed into an array.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_widget_array2.png) ## Reference Array Items by Index Items in the array can be referenced by index. Arrays of `StringType` and `NumberType` are easy to work with, but arrays of `SObjectType` and `SObjectFieldType` contain multiple attributes for each item in the array. Array of `SobjectFieldType`: | Expression | Returns | | ------------------------------------------- | -------------------------------------------------------------------------------------------- | | `${Variables.Account_Fields[0]}` | (`sobjectName`=Account, `fieldName`=Name, `sobjectLabel`=Account, `fieldLabel`=Account Name) | | `${Variables.Account_Fields[0].fieldName}` | Name | | `${Variables.Account_Fields[0].fieldLabel}` | Account Name | **note:** `fieldName` is required for dataflow. ## Access Array Values in Template Files The selection values from the widget are stored in the variable. There are two ways to access them in the template files (rules, dashboards, workflow). **Without looping** Use array values from `SobjectFieldType` by index. ```nolang "fields":[        {"name":"${Variables.Account_Fields[0].fieldName}"},        {"name":"${Variables.Account_Fields[1].fieldName}"},        {"name":"${Variables.Account_Fields[2].fieldName}"},        {"name":"${Variables.Account_Fields[3].fieldName}"},        {"name":"${Variables.Account_Fields[4].fieldName}"}    ] ``` This example, without looping, would be tricky to use, because there would always need to be at least five items in the array. Any fewer would fail, and anything over five would not be used. **With looping** Use array values from `SobjectFieldType` with the `array:forEach` function. In this example, a `“set”` action loops through the `SObjectFieldTypes` in the array and adds them to the `“fields”` attribute in the `Extract_Account` step of the workflow. Each entry in `“fields”` needs “name” and `“var.fieldName”`. **rules.json** ```nolang "name": "AddAccountFilesToDataflow",  "appliesTo": [    {      "type": "workflow",      "name": "*"    }  ],  "actions": [    {      "action": "set",      "description": "use selected values for sfdcDigest in dataflow",      "path": "$.workflowDefinition.Extract_Account.parameters.fields",      "value": "${array:forEach(Variables.Account_Fields, '{\"name\": \"${var.fieldName}\"}')}"    }  ] ``` **dataflow.json** ```nolang "Extract_Account":{   "action":"sfdcDigest",   "parameters":{       "fields":[],       "object":"Account"   } } ``` **Result after processing** If Account Name, Account Source, and Industry are selected: ```nolang "Extract_Account":{ "action":"sfdcDigest", "parameters":{ "fields":[ {"name":"Name"}, {"name":"AccountSource"}, {"name":"Industry"} ] } ] ``` ## Combine Arrays These functions extend the power of `array:forEach`. **array:union** Uses only unique values, so no values are duplicated. ```nolang "value": "${array:union(array:forEach(Variables.Account_Fields, '{\"name\": \"${var.fieldName}\"}'),array:forEach(Variables.Account_Fields2, '{\"name\": \"${var.fieldName}\"}'))}" ``` **array:concat** Two new arrays: ```nolang "value": "${array:concat(array:forEach(Variables.Account_Fields, '{\"name\": \"${var.fieldName}\"}'),array:forEach(Variables.Account_Fields2, '{\"name\": \"${var.fieldName}\"}'))}" ``` One new array with an existing array: ```nolang "value":"${array:concat(Rules.CurrentNode, array:forEach(Variables.Account_Fields, '{\"name\":\"${var.fieldName}\"}'))}" ``` **Which actions support array functions** You can use array functions in the `“set”` and `“put”` actions, but not in the `“add”` or `“delete”` actions. **note:** In `“add”`, the value is being added to an existing array, so the result is an array inside an array, which is not well-formed JSON. To add more array values to an existing array, use `“set”` with the `array:concat` function. For `“delete”`, value is not used. ## Use StringType and NumberType Arrays You can use array values from `StringType` the same way as from `NumberType`. **variables.json** ```nolang "Account_Fields_String": {        "label": "Pick string fields for your dataset",        "description": "Multiselect string test",        "defaultValue": ["Name"],        "required": true,        "variableType": {            "type": "ArrayType",            "itemsType": {                "type": "StringType",                "enums": ["Name", "AccountSource", "Industry", "Type"]            }        }     } ``` **rules.json** ```nolang "value": "${array:forEach(Variables.Account_Fields_String, '{\"name\": \"${var}\"}')}" ``` ## Replace Multiple Yes/No Widgets You can also use the multiselect widget to replace multiple `StringType` widgets with `“Yes”` and `“No”` selections. This example uses three `StringType` widgets on one wizard page: ![This image depicts an example of three stringtypes in one wizard page.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_3stringtypes_1wiz.png) You can replace this with a single `ArrayType` widget: ![This image depicts an example of replacing three stringtypes with a single arrayType widget.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_arraytype_widget.png) The JSON for this variable is: ```nolang "SelectedFeatures": {    "label": "Please select the features you would like to enable?",    "description": "The selected features for this app",    "defaultValue": [     "Apex Execution"    ],    "variableType": {      "type": "ArrayType",      "itemsType" : {        "type" : "StringType",        "enums" : [         "Apex Execution",         "API",         "Content Transfer",         "Dashboard",         "Login",         "Report Export",         "Rest API",         "Setup Audit Trail",         "UI Tracking",         "URI",         "Visualforce Request",         "Wave Change",         "Wave Interaction",         "Wave Performance"        ]    }    },    "required": true  } ``` You can use the selected values to set constants in `rules.json`, which you can then reference in conditionals for actions or in `template-info.json`. ```nolang "constants" : [ {"name":"hasApexExecution", "value": "${array:contains(Variables.SelectedFeatures, 'Apex Execution')}"}, {"name":"hasAPI", "value": "${array:contains(Variables.SelectedFeatures, 'API')}"}, {"name":"hasContentTransfer", "value": "${array:contains(Variables.SelectedFeatures, 'Content Transfer')}"}, {"name":"hasDashboard", "value": "${array:contains(Variables.SelectedFeatures, 'Dashboard')}"}, {"name":"hasLogin", "value": "${array:contains(Variables.SelectedFeatures, 'Login')}"}, {"name":"hasReport", "value": "${array:contains(Variables.SelectedFeatures, 'Report Export')}"}, {"name":"hasRestApi", "value": "${array:contains(Variables.SelectedFeatures, 'Rest API')}"} ] ``` # Use Case and Syntax for Variables with Related Values Construct variables that reference related values, for example an object and fields from the object, and a dataset and dates, dimensions, and measures from the dataset. For example, the first question on a wizard page asks the user to select an object (`sObjectType` variable). The next questions can ask the user to select fields (`sObjectFields` variable) from that object. The wizard populates the questions about fields with `sObjectFields` from the `sObject` selected in the first question. The following image shows an `sObject` picker first, followed by an `sObjectField` picker. ![This diagram depicts the sObject and sObjectField pickers.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_sobject_sobjectfield.png) You can take the same approach with datasets and dataset dates, measures, and dimensions. The first question references a dataset (`datasetType` variable). Subsequent questions reference dates (`datasetDateType`), dimensions (`datasetDimensionType`), and measures (`datasetMeasureType`) from the dataset selected in the first question. Following is template JSON used to render the UI shown in the image, using `sObject` and `sObjectFields` variables. In the `variables` section, notice `CSATField` variable's type info: the `defaultValue` contains a reference to the variable's value `CSATObj` and the syntax is `{{Variables.CSATObj.sobjectName}}`. The intention here’s to replace `{{Variables.CSATObj.sobjectName}}` with the value that the user picked for the variable `CSATObj`. The `ui.json` file for the template, shown at the top of the example, orders the wizard questions defined in `variables.json`. ```nolang {  "ui" : {    "pages" : [      {        "title ": "Page1",        "variables" : [          {            "name" : "CSATObj"          },          {            "name" : "CSATField"          }        ]      }    ]  },  "variables" : {    "CSATObj" : {      "description" : "Service Analytics defaults to the Case object. If you use a different object to track CSAT, select it from the list below",      "label" : "1. What object do you use to track customer satisfaction?",      "required" : true,      "variableType" : {        "type" : "SObjectType"      },      "defaultValue" : {        "sobjectName" : "Case"      }    },    "CSATField" : {      "description" : "Service Analytics uses your choice to provide a single numerical score to indicate customer satisfaction rating.",      "label" : "2. Which field on the object you just selected do you use to track CSAT?",      "defaultValue" : {        "datasetId" : "{{Variables.CSATObj.sobjectName}}",        "fieldName" : ""      },      "required" : true,      "excludeSelected" : true,      "variableType" : {        "type" : "SobjectFieldType",        "datatype" : "xsd:double"      }    }  } } ``` ## Variable Value Reference Syntax ```nolang "${Variables.Dataset1.datasetId} ${Variables..sobjectName}" ``` # Use Cases for Tableau Next Embedding These use cases show end-to-end examples of functionality for your embedding code. For embedded components, perform interactive operations only after the component has rendered. Alternatively, you can use the `COMPONENT_LOADED` event, performing operations within its callback. ## Get the List of Dashboard Filters This example shows how to get the list of filters for a dashboard when the dashboard component loads. ```javascript
``` ## Apply an Updated Dashboard Filter This example shows how to listen for the `UPDATED_FILTERS` event and apply the updated filter to the dashboard. ```javascript
``` ## Embed a Specific Dashboard Page This example shows how to get the list the pages for a dashboard and then render that dashboard page. ```javascript div id="analytics-container"> ``` ## Embed a Custom Dashboard View Use the `customViewId` to embed a dashboard with a saved interactive state, such as pre-applied filters or context from a shared dashboard page. You can embed custom views when: - You want users to view a dashboard in a specific saved state. - You are embedding dashboard URLs that contain the `customViewId` query parameter. - You required consistent interactivity context across sessions or channels. This example shows the `AnalyticsDashboard` component with the `customViewId`. ```javascript import { initializeAnalyticsSdk, AnalyticsDashboard, EventName, analyticsEventTarget } from '@salesforce/analytics-embedding-sdk'; await initializeAnalyticsSdk({ authCredential: "https://", orgUrl: "https://" }); const dashboard = new AnalyticsDashboard({ parentIdOrElement: 'dashboard-container', idOrApiName: 'MyDashboard', customViewId: 'cview_abc123' // Optional }); await dashboard.render(); ``` The `customViewId` is part of the dashboard URL when a custom view is rendered. In this example, the `customViewId` is `cview_abc123`. ``` https:///tableau/dashboard/MyDashboard/view?customViewId=cview_abc123 ``` If the `customViewId` is omitted, the dashboard renders to the default page and view. If the `customViewId` is invalid or not accessible, the dashboard renders to the default page and view. # Use CLI to Deploy Tableau Next Assets from Sandbox to Production This document provides a comprehensive guide for deploying Tableau Next Assets between Salesforce orgs, such as from a sandbox to a production environment, by using the Salesforce Command-Line Interface (CLI) and Visual Studio Code (VS Code). This deployment process uses the Metadata API and Salesforce DX project structure to manage and transfer Tableau Next assets, which include workspaces, visualizations, and dashboards. The guide covers: - Authorization of your Salesforce orgs with the CLI. - Project set up in VS Code. - The creation and structure of manifest files (`package.xml`) to specify the assets for deployment. - The commands to retrieve the asset metadata from the source org and deploy it to the target org. - Creating and downloading the manifest file for the data kit. - Deploying the data kit first to make sure that data dependencies are present. - Deploying the Tableau Next Assets themselves. ## Before You Begin Complete these prerequisites: - Create a deployment connection between the production org and the sandbox org. See [Authorize a Deployment Connection](https://help.salesforce.com/s/articleView?id=platform.t_changesets_deployment_connection.htm). - Install VS Code, Salesforce Extension for Visual Code, and the Salesforce CLI. See [Installation Instructions](https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/install.html). To deploy Tableau Next Assets, make sure that you have these user permissions: - Data Cloud Architect permission set - Tableau Next Admin permission set - Approve Uninstalled Connected Apps user permission - [Metadata API Edit Access](https://help.salesforce.com/s/articleView?id%3Dplatform.meta_modify_metadata_perm.htm) ## Authorize Your Org Before you can run commands to retrieve asset metadata from your org, you must authorize your CLI environment. Authorize an org by running the [`sf org login web`](https://developer.salesforce.com/docs/atlas.en-us.258.0.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_org_commands_unified.htm#cli_reference_org_login_web_unified) CLI command and entering your credentials in the browser that automatically opens. For example, run this command from the command line (not from the VS Code terminal): `sf org login web --alias sandbox --instance-url https://your-org.my.salesforce.com` This command uses the `–-alias` flag to specify a simple name, like `sandbox`, for the Salesforce org. After you’ve connected and authorized the org, you can use the alias rather than the full org URL for deployment commands. To verify and view connected org, run this command in VS Code: `sf org list` ## Create a Project for Tableau Next Assets Open your VS Code desktop app and follow the given steps to create a Salesforce DX project: 1. Open the VS Code Command Palette (`⇧⌘P`) and enter **SFDX: Create Project**. 2. Press **Enter** to use a standard project template. 3. Add a project name and press **Enter**. 4. Select the directory where you want to create your project and click **OK**. 5. In the new project, create a folder for the package manifest files. For example, `manifests`. ## Create Manifest Files A manifest file is an XML file that specifies the Tableau Next assets that you want to retrieve from one org and deploy into another org. In the `manifests` folder, create an XML file with the code below. In this guide, we refer to this file name as `manifest.xml`. ```xml 65.0 ``` ### Manifest File Syntax The syntax of a manifest file includes three primary elements: `types`, `members`, and `name`. The `version` element is required. All of these elements are included in the parent `Package` element. **Example `manifest.xml` File** This example shows a manifest file with the 6 Tableau Next assets for version 65.0 of Salesforce: - Two workspaces: `Winter_2025` and `Winter_2025`. - Three visualizations: `Fall_Sales_2025`, `Projections`, and `Opportunities`. - One dashboard: `Spring_Plan_2026`. ```xml Winter_2025 Winter_2025 AnalyticsWorkspace Fall_Sales_2025 Projections Opportunities AnalyticsVisualization Spring_Plan_2026 AnalyticsDashboard 65.0 ``` **`Package` Block** ```xml ``` Each `Package` block includes one or more `types` blocks and a `version` element. For the `xmlns` attribute, specify the `soap.sforce.com` namespace as shown in the example. **`version` Element** The `version` element must contain the version of Salesforce used to create the newest assets in your manifest file. Because versioning is backwards-compatible, we recommend putting the current version of your Salesforce org in this element. To determine the version of Salesforce for your org, run the [`sf org display -o `](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_org_commands_unified.htm#cli_reference_org_display_unified) command: **Syntax** `sf org display -o ` **Example** `sf org display -o sandbox` The command returns org information, including the current API version. ![The org information, including the current API version.](https://developer.salesforce.com/docs/media/tn-isv-dev/tn_isv_dev_api_version.png '{"class": "image-md"}') **`types` Block** The `types` block takes one or more `members` elements and a `name` element. Each `types` block corresponds to one of three Tableau Next asset types: `AnalyticsWorkspace`, `AnalyticsVisualization`, or `AnalyticsDashboard`. ```xml API-name asset-type-name ``` Here’s an example of a `types` block that specifies an API name of `Winter_2025` for `members` that is an asset type, `AnalyticsWorkspace`: ```xml Winter_2025 AnalyticsWorkspace ``` **`members` Element** Each `members` element specifies the API name, like `workspace1`, for the specific asset that you want to deploy. You can have multiple `members` elements in a `types` block, each specifying a different API name. ```xml Winter_2025 Spring_2026 Summer_2026 AnalyticsWorkspace ``` **API Name** The API name is the asset name generated by Salesforce when the asset is created. To retrieve the API name, open the asset in Tableau Next and copy the name from the end of the URL. For example, this URL opens workspace Winter 2025: `https://org-name.lightning.force.com/tableau/workspace/Winter_2025` The API name for the Winter 2025 workspace is `Winter_2025`. As shown here, this URL opens the visualization, Fall Sales 2025: `https://org-name.lightning.force.com/tableau/visualization/Fall_Sales_2025` The API name for Fall Sales 2025 is `Fall_Sales_2025`. ![The Fall Sales 2025 visualization with the API name in the URL.](https://developer.salesforce.com/docs/media/tn-isv-dev/tn_isv_dev_viz_api_name.png '{"class": "image-md"}') **`name` Element** The `name` element specifies the type of asset. For example, `AnalyticWorkspace`. Each `types` block contains only one `name` element. There are three types of Tableau Next assets that you can specify in the XML. This table lists the asset type and the corresponding name that is specified in the `name` element: | Asset Type | `name` | | ---- | ---- | | Workspace | `AnalyticsWorkspace` | | Visualization | `AnalyticsVisualization` | | Dashboard | `AnalyticsDashboard` | ## Deploy Tableau Next Assets This procedure describes how to deploy Tableau Next assets that don't require data kit customizations. ### Retrieve the Project After you’ve created your manifest file, you can use it to retrieve the asset metadata from the source org. Run the [`sf project retrieve start`](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm#cli_reference_project_retrieve_start_unified) command in VS Code: **Syntax** `sf project retrieve start --manifest -o ` **Example** `sf project retrieve start --manifest manifests/manifest.xml -o sandbox` The command creates metadata files for each asset specified in the manifest file. VS Code writes these metadata files into your project at the `../force-app/main/default` path. ### Deploy the Project Now that all metadata files are in your project folder, you can deploy them to the destination org. **note:** Before you can deploy the project to the destination org, you must [Authorize Your Org](#authorize-your-org). Run the `sf project deploy start` command in VS Code: **Syntax** `sf project deploy start --manifest -o ` **Example** `sf project deploy start --manifest manifests/manifest.xml -o prod` The command creates the Tableau Next assets in the target org by using the metadata files for each asset specified in the manifest file. **note:** You can’t deploy data kits containing Tableau Next assets from on a higher major release version, such as preview sandboxes, to production orgs on a lower major release version. Make sure that your sandbox org is on the same release version as your production org before creating the data kit. - You can deploy within the same major release from a lower minor version to a higher minor version. - You can deploy within the same major release from a higher minor version to a lower minor version. - You can deploy from a lower major release to a higher major release, which supports backward compatibility and automated upgrade processes. - **You can’t deploy from a higher major release to a lower major release.** For more information about sandbox previews, see [What are Preview and Non-Preview Sandboxes?](https://help.salesforce.com/s/articleView?id=platform.data_sandbox_preview.htm) and [Salesforce Sandbox Preview Instructions](https://help.salesforce.com/s/articleView?id=000391927&type=1). ## Deploy Tableau Next Assets with Data Kit Objects If your Tableau Next assets rely on DMOs, DLOs, or semantic models, you may need to deploy those data assets from the sandbox to the production environment. If these assets exist in the production environment and are the latest production versions of the assets used to create the Tableau Next assets in your sandbox environment, then you don’t need to deploy them. If you're deploying Tableau Next assets that require a data kit, deploy the data kits first. After you verify that the data kits are deployed and contain the same data used to generate the Tableau Next assets, then deploy the Tableau Next assets. ### Deploy Data Kit #### Create a Data Kit Use this process to create a standard data kit for a managed package. For more information about creating data kits, see [Use CLI to Deploy Changes from a Sandbox to Data Cloud](https://developer.salesforce.com/docs/data/data-cloud-dev/guide/dc-deploy_data_kit_using_cli.html). 1. In your Developer Edition org, go to **Data Cloud Setup**. 2. Under Developer Tools, click **Data Kits**. 3. Click **New**. 4. Name the data kit and add an optional description, such as what it contains. 5. For Data Kit Type, select DevOps. 6. Save your changes. 7. Add one or more Data 360 features by clicking **Add** in the appropriate section, then configure the data kit details. 8. Review the **Publishing Sequence**. You must ensure your assets reflect the following sequence, at a minimum: - Semantic Models - Workspaces - Visualizations - Dashboards This is due to the dependency sequencing for data kits. Visualizations have dependencies on semantic models and workspaces, and dashboards have dependencies on visualizations. The default sequence is based on each asset's creation date, which may not suitable in all cases. For more information, see [Create and Publish a Standard Data Kit](https://help.salesforce.com/s/articleView?id=data.c360_a_data_stream_bundle_package_kits.htm). **important:** If you don't review and update the publishing sequence, data kit deployment will fail. 9. Save your changes. #### Download the Data Kit Manifest File 1. In your Developer Edition org, go to **Data Cloud Setup**. 2. Under Developer Tools, click **Data Kits**. 3. Select the data kit that you want to deploy. 4. On the top right of the page, click the dropdown arrow, and then click **Download Manifest File**. This downloads a manifest file, `package.xml`, to your computer. #### Retrieve Your Data Kit **note:** Before you can retrieve the data kit, you must [Authorize Your Org](#authorize-your-org). 1. Rename `package.xml`, the manifest file that you downloaded, to match your file naming scheme for the sandbox deployment project, for example, `manifest\_datakit.xml`. 2. In VS Code, add `manifest\_datakit.xml` to the `manifests` folder in your project. 3. Run the `sf project retrieve start` command in VS Code. **Syntax** `sf project retrieve start --manifest -o ` **Example** `sf project retrieve start --manifest manifests/manifest_datakit.xml -o sandbox` The command creates metadata files for each asset specified in the manifest file. VS Code writes these metadata files into your project under the `../forc-app/main/default` path. #### Deploy the Data Kit Now that all metadata files are in your project folder, you can deploy them to the destination org. **note:** Before you can deploy the project to the destination organization, you must [Authorize Your Org](#authorize-your-org). Run the `sf project deploy start` command in VS Code: **Syntax** `sf project deploy start --manifest -o ` **Example** `sf project deploy start --manifest manifests/manifest_datakit.xml -o prod` The command creates the data kit assets in the target org by using the metadata files for each asset specified in the manifest file. ### Deploy Your Tableau Next Assets After you’ve verified that the data kits are deployed and contain the same data used to generate the Tableau Next assets, then deploy the Tableau Next assets. See [Deploy Tableau Next Assets](#deploy-tableau-next-assets). # Use Functions in Rules Functions make rules more powerful. For example, use functions to apply rules iteratively to arrays or to make rules conditional on the content of a string or an array. CRM Analytics Templates supports string, array, and json functions as well as static math and sfdc_fma functions. Use the `"Rules.CurrentNode"` property in conjunction with functions. It contains the last results of the JSON `'path'` argument supplied in the action of your rule. Use the EL Expression Language to invoke custom functions with an expression. Functions can appear in the static text of an EL expression, for example: ```nolang "name" : "my name in lowercase is ${string:toLowerCase(Variables.myName)}", ``` See the sections that follows for complete information about each function type. - **[string Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-functions-string.md)** Use `string` functions in rules to manipulate text strings in asset JSON at runtime. - **[array Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-functions-array.md)** Use `array` functions in rules to manipulate arrays in asset JSON at runtime. - **[json Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-functions-json.md)** Use json functions in rules to manipulate JSON at runtime. For example, find all the JSON paths in a dashboard that have a link widget and update the links at runtime. - **[Static Functions](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-functions-static.md)** Static functions have specialized use in template rules. # Use Group and Filter Pre-projection Improve query performance by moving group and filter operations on simple fields before the `foreach` statement. A simple field is projected as-is and doesn't have additional expressions. Projection refers to the subset of columns that your query returns. In SAQL, projection occurs in the `foreach` statement, where the query performs an operation on each row in the dataset. **note:** SAQL supports only pre-projection filters that follow this format: `fieldName operatorName constant`. For example, you can include `q = filter q by Category;`, but not `q = filter q by Discount > 1;`. The same applies to grouping. For example, you can include `q = group q by Category;`, but not `q = group q by Discount > 1;`. ## Example: Filter In this query, the `filter` statement occurs post-projection. ```nolang q = load "Superstore"; q = foreach q generate 'Category' as 'Store_Category', 'Sub_Category' as 'Store_Sub_Category'; q = filter q by 'Store_Category'=="Furniture"; ``` Here, we move the filter to pre-projection. Because the `Category` field occurs before the `foreach` statement, it doesn't have an alias. ```nolang q = load "Superstore"; q = filter q by 'Category'=="Furniture"; q = foreach q generate 'Category' as 'Store_Category', 'Sub_Category' as 'Store_Sub_Category'; ``` ## Example: Group In this example, the query first creates two new fields: `Detailed_Category`, a combination of the `Category` and `Sub_Category` fields, and `Adjusted_Discount`. After grouping the results by `Detailed_Category`, the second `foreach` statement takes the average of `Adjusted_Discount` for each `Detailed_Category`. ```nolang q = load "Superstore"; q = foreach q generate 'Category'+ "-" + 'Sub_Category' as 'Detailed_Category', 2*'Discount' as 'Adjusted_Discount'; q = group q by 'Detailed_Category'; q = foreach q generate 'Detailed_Category', avg('Adjusted_Discount') as 'Avg_Adjusted_Discount'; ``` Instead of using two `foreach` statements, group by `Sub_Category` pre-projection, and add its alias in the `foreach` statement. ```nolang q = load "Superstore"; q = group q by ('Category', 'Sub_Category'); q = foreach q generate 'Category'+ "-" + 'Sub_Category' as 'Detailed_Category', 2*avg('Discount') as 'Avg_Adjusted_Discount'; ``` **See Also** - [group-by](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-groupby.md) - [filter](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-statement-filter.md) # Use Live Datasets in a CRM Analytics Template Use live datasets in your CRM Analytics template with the `liveConnection` attribute to bring in live connections to Snowflake source tables. Creating a template from a source app with live datasets generates the dataset information, but there are considerations for successful app creation for your users. ## Live Datasets in template-info.json Live datasets are generated when a template is created from the source app containing a live connection to Snowflake. Like a standard SFDC dataset, a live dataset contains a `name` attribute and an optional `label` attribute. Live datasets also contain a `liveConnection` attribute with the Snowflake source table information. ```nolang "datasetFiles": [ { "name": "my_live_data", "label": "My Live Dataset", "liveConnection": { "connectionName": "myuniquelongconnectioname", "sourceObjectName": "Account" } } ] ``` ## Live Datasets in Templated Assets When you create your template from your source app with a live dataset, the template generation tokenizes the live dataset, just as it does for standard SFDC datasets. Here’s an example of a tokenized live dataset in a dashboard template file. ```nolang "connectionName" : "${App.Connections.myuniquelongconnectioname.Name}", "datasets" : [ { "name" : "${App.Datasets.my_live_data.Name}" } ], ``` ## Considerations for Templates with Live Datasets For a user to create an app from your template, their consumer org must have an existing connection to Snowflake. This Snowflake connection must have a developer name with the exact value that is specified for the `connectionName` of the dataset entry in the template-info.json file. As a template developer, you must document that your template relies on a Snowflake connection with a specific name in order for app creation from the template to succeed. Prompt your users to verify a Snowflake connection on a custom Visualforce page that you can create and use in the configuration wizard. **note:** If a Snowflake connection developer name doesn’t match the `connectionName` in the consumer org, app creation from the template fails. The app creation notification email notifies the user of the failure. To clarify that a Snowflake connection is for use in a templated app, it’s recommended that you create a unique, longer `connectionName` value. The previous examples highlight using a unique and long connection name. When an app instance is created from your template, the connection information is cloned for each instance. When an app instance is deleted, the cloned connection associated with that app is also deleted, as long as no other live datasets are referencing the connection. The original Snowflake connection created to support templated app instances isn’t deleted, in case other app instances are using the connection. **See Also** - [Create an App](https://help.salesforce.com/s/articleView?id=sf.bi_explorer_direct_data_snowflake_create_connection.xml) # Use SAQL in the CRM Analytics Dashboard Use the CRM Analytics Studio user interface to modify existing SAQL queries or write new ones. Writing SAQL queries in the user interface is the easiest way to get started. Every component in CRM Analytics uses SAQL behind the scenes. You can build a widget in a dashboard, then switch to the SAQL view to see the SAQL query for the widget. Or, you can create a lens while exploring a dataset, then switch to the SAQL view to see the SAQL query for the lens. Let’s look at the query generated by a widget in a dashboard. **note:** After you edit the SAQL for a widget, you may not be able to go back to the dashboard view, depending on how complex the SAQL query is. For more information about working with SAQL queries, see [Tips for Working with SAQL Queries in the Query Editor](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboard_step_saql_limitations.htm&type=5). 1. In your Salesforce org, open CRM Analytics Studio, then open a dashboard. For example, open Opportunity Details. 2. Click **Edit**. ![Click Edit on a sample dashboard](https://developer.salesforce.com/media/bi_dev_guide_saql/wave_saql_overview_editdashboard.png) 3. Click a query to edit, for example Amount_1, then click **Edit** in the dropdown list. ![Select Edit in a step](https://developer.salesforce.com/media/bi_dev_guide_saql/wave_saql_overview_editstep.png) 4. Click **SAQL Mode** to display the SAQL query. ![Click the SAQL Mode button](https://developer.salesforce.com/media/bi_dev_guide_saql/wave_saql_overview_selectSAQL.png) 5. View the SAQL query. Here is the SAQL query for our example: ```nolang q = load "DTC_Opportunity_SAMPLE"; q = filter q by 'Closed' == "false"; q = group q by all; q = foreach q generate sum('Amount') as 'sum_Amount'; q = limit q 2000; ``` 6. Edit the query, then click **Run Query** to run the new query. For example, you could change the `sum` to `average`. # Use the Apex Access Methods The `Access` class provides utility methods to check Integration User access to sObjects and sObjectFields. Use these methods in your `WaveTemplateConfigurationModifier` implementation. Apex is the object-oriented Salesforce programming language that allows developers to execute flow and transaction control statements on the Lightning Platform server along with calls to the API. Using `Access` in a smart wizard simplifies standard app creation in these ways: - Checks if the Integration User has access to sObjects. - Checks if the Integration User has access to sObjectFields. - Checks if the Integration User has access to enough records in an sObject to continue with template processing. The `Access` methods can also be used with embedded apps to check if the org has given access to the Integration User for the necessary sObjects and sObjectFields. In this use case, you can fail app creation with a clear message for the Auto-Install request. For complete details about Apex, see [Apex Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm). - **[Access Methods](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-apex-access-class-methods.md)** Use the `Access` features with the following methods. - **[Access Apex Examples](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-apex-access-class-examples.md)** Examples include checking the Integration User access inside your WaveTemplateConfigurationModifier implementation. # Use the Apex WaveTemplateConfigurationModifier Class The `WaveTemplateConfigurationModifier` class checks an org’s data. Also, to simplify app creation, it can modify the template configuration wizard accordingly. Apex is the object-oriented Salesforce programming language that allows developers to execute flow and transaction control statements on the Lightning Platform server along with calls to the API. Using `WaveTemplateConfigurationModifier` in a smart wizard simplifies standard app creation in these ways: - Checks if the org has data required to create the app. - Checks if security settings enable app creation. For example, it determines if the Analytics Integration User has access to all fields required to create the app. - Checks the org’s fiscal year start date. Based on the outcome, the wizard can use a default setting, such as January 1, or require the user to choose a fiscal year start date for use in the app. - Hides or exposes a wizard question (variable) based on the org data. For example, say that your wizard includes a question about opportunities. The smart wizard can check an org for the Opportunity object and, if it detects use of the object., display the question. - Sets the values included in a wizard question’s answer field. The smart wizard can include or exclude specific fields and expand or limit the number of values displayed. The `WaveTemplateConfigurationModifier` can also be used with embedded apps to check the org’s data and security settings. In this use case, you can fail app creation with a clear message for the Auto-Install request. You can also set template variables based on org settings to be used in app creation. Declare the class in `template-info.json`. If you implement the modifier and unit test classes in your Visual Studio project, include your classes in the `classes` directory along with the class metadata files. For complete details about Apex, see [Apex Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm). - **[WaveTemplateConfigurationModifier Interfaces](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-apex-class-overview.md)** The main class is `WaveTemplateConfigurationModifier` with these supporting classes and their methods. - **[WaveTemplateConfigurationModifier Methods](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-apex-class-methods.md)** Extend `WaveTemplateConfigurationModifier` with the following methods. - **[WaveTemplateConfigurationModifier Apex Examples](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-apex-class-examples.md)** Examples include setting computed values for questions, hiding a question, managing enum values, working with array type variables, and more. - **[TemplateApexException Apex Examples](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-apex-class-error-examples.md)** Use the `TemplateApexException` class to handle errors cleanly and provide clear information to template users. - **[TemplateInterruptException Apex Example](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-apex-class-error-examples2.md)** Use the `TemplateInterruptException` class to handle template runtime errors cleanly and provide clear information to template users. - **[Test WaveTemplateConfigurationModifier](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-apex-class-testing-examples.md)** Test the `WaveTemplateConfigurationModifier` before deploying a template that uses it. # Use the App Install History Page Use the App Install History page to monitor installations in progress, track the assets created for the app, and view logs to troubleshoot any installation issues. | User Permissions Needed | | | ------------------------- | -------------------------- | | To manage installed apps: | Manage Analytics Templates | For an overview of the App Install History page, see [Monitor and Troubleshoot Templated App Installations](https://help.salesforce.com/s/articleView?id=bi_monitor_app_install.htm). The default view on this page is for App Templates. Use the filter ![The filter control to select the template type to display.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_app_history_filter_icon.png) to select Data Templates. Templates use tokens to assign IDs, names, and labels at runtime, along with replacing variables and constants. The app state is the runtime state of the templated app during creation or upgrade. It stores the context information of the tokens used to create and update the app assets, along with data prep uploads and job runs. The state for each install task detail record contains context information about the user, org, apps, app, variables, and constants, represented as a tree. For each item, click ![Use to expand the app install state tree](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_app_install_state_expand_icon.png) to expand the elements of the tree. ![The app install state tree with expansion](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_app_install_state2.png) User: The user context information for installing the templated app, which includes user ID, username, first name, and last name. Org: The org context information for installing the templated app, which includes the org ID, the org name, and the org namespace. Apps: The dependent app context information. This information includes the template name for dependent apps, the assets in those apps, and the asset source names. App: The asset context information for the app. The list of assets updates with each installation step, as the runtime determines which assets are created or updated and then processes the assets. Possible assets for a templated app include: - Dashboards: a list of dashboards with ID, name, and label - Components: a list of components with ID, name, and label - Lenses: a list of lenses with ID, name, and label - Datasets: a list of datasets with ID, version ID, alias, fully qualified name, name, and label - EdgeMarts: same as the list of datasets (Deprecated) - Folder: the folder ID, name, and fully qualified name - Images: a list of images with ID, name, and namespace - Dataflows: a list of dataflows with ID - Recipes: a list of recipes with ID, name, and label - Connections: a list of connections with name Variables: The runtime variables that are used to generate the templated app. The variables are a list of name and value pairs to display the value of each variable at runtime. Constants: The runtime constants that are used to generate the templated app. The constants are a list of name and value pairs to display the value of each constant at runtime. # Use the Salesforce CLI to Retrieve the Template Files Pull the template metadata from the scratch org to your local workspace using the Salesforce CLI command `sf project retrieve start`. The command stores the template files on your system under the folder `force-app\main\default\waveTemplates\MyNewTemplate` Access them locally on your file system for further development using the IDE of your choice. **note:** If you created your template in CRM Analytics Studio, use the CLI to log in to your org and then use the `sf project retrieve start --metadata "WaveTemplateBundle:MyTemplate"` CLI command to retrieve your files for editing. For information on setting up and using the CLI for template development, see [Prerequisites](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-prerequisites.md). **See Also** - [Salesforce CLI Command Reference: project retrieve start](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm#cli_reference_project_retrieve_start_unified) # Use Time Zone-Enabled Dates in SAQL Projections You can project an exact date such as 2017-3-31 23:59:59 or part of a date such as year, month, or day. Project the entire `CloseDate` field to see the `CloseDate` field for a record. `CloseDate` can be a `DateTime` or `DateOnly` type. ```nolang q = foreach q generate CloseDate as 'Close Date'; ``` Project the year, month, day, and epoch date for a record. ```nolang q = foreach q generate year('CloseDate') as 'Year', month('CloseDate') as 'Month', day('CloseDate') as 'Day', epochSecond('CloseDate') as 'Seconds Epoch'; ``` # Use Visual Studio Code to Retrieve the Template Files Pull the template metadata from the scratch org to your local workspace using the Command Palette **Pull Source from Default Scratch Org**. Use VS Code to view and edit the template files. The command stores the template files on your system under the folder `main\default\waveTemplates\MyNewTemplate` Use VS Code to edit and customize the template. You must have the Salesforce Analytics Extension Pack installed. To get content assist and validation when you edit a template json file, make sure the VS Code language mode is set to **ADX Template Json**. For information on setting up and using the VS Code for template development, see [Prerequisites](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-prerequisites.md). # Use VisualForce To Customize the Wizard UI To customize wizard appearance beyond the default interface, use VisualForce and a JavaScript library. CRM Analytics runs the wizard before generating the app from the template. The wizard consists of a set of pages, each of which contains questions or other elements you use to set up the app. The framework lets you run a custom APEX class at any time during app creation. This class can answer questions about the org automatically or validate the org to ensure it meets the requirements to create the app. CRM Analytics uses a default format for the error messages generated by the validation process. VisualForce and a JavaScript library lets you customize the format and include links to help the admin edit the org to meet app-creation requirements. VisualForce lets you replace any or all of the autogenerated wizard pages with a custom VisualForce page that can display anything you want. The illustration shows how you can integrate a custom VisualForce page into the app creation flow. ![This diagram depicts integrating a custom VisualForce page into the default framework.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_integrating_vf_in_flow.png) The VisualForce renders everything inside the red lines in the example wizard shown here. It interacts with the wizard through a JavaScript SDK. ![This diagram depicts the VisualForce page.](https://developer.salesforce.com/media/bi_dev_guide_wave_templates/bi_templatesdev_vf_page.png) The JavaScript SDK is essentially be a pub/sub eventing mechanism with a set of events fired and consumed during a well-defined lifecycle. The SDK is versioned and can be included in any VisualForce page as follows: ```nolang ``` Here’s example code for the VisualForce page: ```nolang // Subscribe to event that gets fired when the page first loads Wave.wizard.publish(   {name : 'wizard.ready', "payload" : {}, callback : function (response) { var payload = response.payload; var metadata = {   page : payload.page,   variableDefinitions : payload.variableDefinitions,   values : payload.initialValues }   }}); // Update and validate a single answer to a question Wave.wizard.publish({   name: "wizard.update",   payload: {name: "Fiscal_Month", value: "01 - January"},   function(response) {       var errors = response.payload;   } }); ``` ## Declaring the VisualForce Page in ui.json In order to replace the default rendering of a wizard page the application developer simply specifies the Visualforce name in `ui.json` page as follows: ```nolang   "pages" : [   {       "title": "These questions focus on how CRM Analytics displays data for Accounts”, "variables": [           { "name": "Customer" },           { "name": "Customer_L2" },           { "name": "Source" },           { "name": "Geo_Maps" },           { "name": "Geography" },           { "name": "Geography_L2" }       ],       "vfPage":{           "namespace": "",           "name": ""       }         }] ``` **important:** Make sure any Visualforce page included in a class can be accessed by users in the organization with Manage Analytics Templated Apps user permission. Otherwise, trying to create an app from your template results in an error. In Setup, go to **Visualforce Pages**, click **Security** next to the page, then add the profile with the Manage Analytics Templated Apps user permission. Refer to the "VisualForce Events for Customizing the Wizard UI" reference section at the end of this guide for details on the events to which you can subscribe or publish. # Using Filters in Tableau Next Components Analytics components leverage filters to narrow down the data displayed. When embedding these components, filters are crucial for refining the data your users see, allowing them to concentrate on specific details. For instance, if a component presents account insights, you can apply a filter based on account ID to ensure only information relevant to the account the user is currently viewing is rendered. **important:** Filters are supported for `AnalyticsDashboard`, `AnalyticsMetrics`, and `AnalyticsVisualization` components only. For embedded components, perform filter operations only after the component has rendered. Alternatively, you can use the `COMPONENT_LOADED` event, performing filter operations within its callback. ```javascript analyticsComponent.addEventListener(EventName.COMPONENT_LOADED, (event) => { analyticsComponent.applyFilters([ // UnifiedFilterJson filter definition ]); }); ``` Filter methods utilize `UnifedFilterJson` for data input and output. The syntax for `UnifiedFilterJson` is ```json { "dataSource": "", //string "fieldName": "", //string "operator": , //enumeration "values": [, , ...] //array of 1 or more filter values } ``` The `dataSource` is the API name of the semantic model the component is retrieving the data from. The `fieldName` is the API name of a field present in the data source. Use one of the `FilterOperation` enumerated values to specify the filter action. Then specify one or more values to use for the filter. These values can be text, numerical, boolean, or date types, but the types can’t be mixed. They must all be the same type. A natural language filter like “show the data from the semantic model, C360SDM, where the account id equals 3054X'”, is represented in `UnifiedFilterJson` as: ```json { "dataSource": "C360SDM", "fieldName": "AccountID", "operator": FilterOperator.Equals, "values": ["3054XF"] } ``` ## Get the Component Filters To see the current filters for a component, use the `getFilters` method. This method returns a list of `UnifiedFilterJson` objects. ### Example ```javascript filters = analyticsComponent.getFilters(); ``` ## Apply Component Filters To apply filters in your component, use the `applyFilters` method. ```javascript analyticsComponent.applyFilters([ { dataSource: "C360S", fieldName: "AccountID", operator: FilterOperator.Equals, values: ["3054XF"], }, ]); ``` ## Clear Component Filters To clear all filters for your component, use the `clearFilters` method. ```javascript analyticsComponent.clearFilters(); ``` ## Supported Filter Operators Valid values for the `FilterOperator` enumeration are: - `Between` - `Contains` - `ContainsIgnoreCase` - `CurrentFiscalQuarter` - `CurrentFiscalQuarterToDate` - `CurrentFiscalYear` - `CurrentFiscalYearToDate` - `CurrentMonth` - `CurrentMonthToDate` - `CurrentQuarter` - `CurrentQuarterToDate` - `CurrentWeek` - `CurrentYear` - `CurrentYearToDate` - `DoesNotEndWith` - `DoesNotEndWithIgnoreCase` - `DoesNotEquals` - `DoesNotEqualsIgnoreCase` - `DoesNotStartWith` - `DoesNotStartWithIgnoreCase` - `EndsWith` - `EndsWithIgnoreCase` - `Equals` - `EqualsIgnoreCase` - `GreaterThan` - `GreaterThanOrEqualTo` - `IsEmpty` - `IsNotEmpty` - `IsNotNull` - `IsNull` - `LastNDays` - `LessThan` - `LessThanOrEqualTo` - `NextFiscalQuarter` - `NextFiscalYear` - `NextMonth` - `NextNDays` - `NextQuarter` - `NextWeek` - `NextYear` - `NotContains` - `NotContainsIgnoreCase` - `NotInValues` - `PreviousFiscalQuarter` - `PreviousFiscalQuarterToDate` - `PreviousFiscalYear` - `PreviousFiscalYearToDate` - `PreviousMonth` - `PreviousMonthToDate` - `PreviousQuarter` - `PreviousQuarterToDate` - `PreviousWeek` - `PreviousYear` - `PreviousYearToDate` - `StartsWith` - `StartsWithIgnoreCase` - `Tomorrow` - `Values` - `Yesterday` ## Filter Errors Filters require specific values to work as expected and should be tested before production use. If you add code to let your users define filters, make sure you build in validation and error handling. Here are possible errors for filters at runtime. | Error Code | Error Message | Resolution | | ---------- | ------------- | ---------- | | `INTERNAL_ERROR` | `Invalid fieldName in filter JSON` | Check the `fieldName` in the filter code or prompt your user to provide a valid `fieldName` value. | | `INTERNAL_ERROR` | `Invalid filter operator in filter JSON` | Check the `operator` in the filter code or prompt your user to provide a valid `operator` value. | | `INTERNAL_ERROR` | `Invalid data source in filter JSON` | Check the `dataSource` in the filter code or prompt your user to provide a valid `dataSource` value. | | `INTERNAL_ERROR` | `Cannot find enum for name ` | Check the `operator` in the filter code or prompt your user to provide a valid `operator` value. | | `INTERNAL_ERROR` | `Invalid values in the filter JSON` | Check the `values` in the filter code or prompt your user to provide valid `values`. | **See Also** - [`AnalyticsFilter`](/docs/analytics/sdk/references/sdk-js-v2/AnalyticsFilter.html) - [`FilterOperator`](/docs/analytics/sdk/references/sdk-js-v2/FilterOperator.html) - [`UnifiedFilterJson`](/docs/analytics/sdk/references/sdk-js-v2/UnifiedFilterJson.html) # var_pop() Returns the population variance of the values in a field. Accepts measure fields as input. This function does not accept expressions. `var_pop()` follows this syntax. ```nolang SELECT var_pop(FIELD1, FIELD2) FROM DATASET; ``` # var_samp() Returns the sample variance of the values in a field. Accepts measure fields as input. This function does not accept expressions. `var_samp()` follows this syntax. ```nolang SELECT var_samp(FIELD1, FIELD2) FROM DATASET; ``` # var() Returns the variance of the values in a field. Accepts measure fields as input but not expressions. ## Example - Calculate the Variance of Deal Amount ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by all; q = foreach q generate var('Amount') as 'var_Amount'; ``` **See Also** - [varp()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-varp.md) # 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 |
  • 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' | 'Visible' | 'Hidden'`
  • Example Expressions:
    • `"{{Variables.booleanType ? 'Visible' : 'Hidden'}}"`
    • `"{{Variables.orgHasUserObject == 'Yes' ? 'Visible' : 'Hidden'}}"`
    • `"{{Variables.orgHasUserObject == 'Yes' ? 'Disabled' : 'Visible' }}"`
| ## 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"             }         ]
    } } ``` # variables.json Attributes Named nodes, each representing a single variable. Each node contains the following attributes: ## variable Attributes | Attribute | Required | Description | | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `computedValue` | No | The computed value for the variable. The computed value is set by the `WaveTemplateConfigurationModifier` implementation. | | `description` | No | Additional text that appears under the label for more information. | | `defaultValue` | No | The default value for the variable, if the user doesn’t change the value in the wizard. Can be the most likely value a user would use. | | `excludeSelected` | No | Indicates whether values selected for another variable are excluded from the list of values for this variable (`) or not (`). For use with variable types like `SObjectType` or `SObjectFieldType`. The default is `false`. | | `excludes` | No | Allows specific values to be excluded from the picker selections | | `label` | No | The visible label for the variable in the UI wizard. The format is typically a question like “Do you use product?”. | | `required` | No | Indicates whether the variable value required in the UI. The default is `false`. | | `variableType` | No | The variable type. | ## variableType Attributes | Attribute | Required | Description | | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `dataType` | No | Specifies the data type for a FieldType variable types. The data type value format for `SObjectFieldType` is `xsd:string`. 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 `DataLakeObjectFieldType` and `DataModelObjectFieldType`, valid values are `string`, `number`, `date`, and `date_time`. | | `fieldType` | No | Specifies the field type for a `CalculatedInsightsFieldType` variable. Valid values are `dimension` and `measure`. | | `enums` | No | Specifies a list of values for an enumerated variable type for a `StringType` or `NumberType` variable type. | | `enumsLabels` | No | Specifies a list of labels for the enumerated values of a `StringType` or `NumberType` variable only. | | `itemsType` | No | Specifies the items type for an `ArrayType` variable. The items type must be a valid variable type. | | `max` | No | Specifies the maximum value for a `NumberType` variable only. | | `min` | No | Specifies the minimum value for a `NumberType` variable only. | | `type` | Yes | The type of the variable. Valid types are:
  • `ArrayType` (Enumerated)
  • `BooleanType` (Enumerated)
  • `CalculatedInsightFieldType` (Object)
  • `CalculatedInsightType` (Object)
  • `ConnectorType` (String)
  • `DataLakeFieldObjectType` (Object)
  • `DataLakeObjectType` (Object)
  • `DataModelFieldObjectType` (Object)
  • `DataModelObjectType` (Object)
  • `DatasetAnyFieldType` (Object)
  • `DatasetDateType` (Object)
  • `DatasetDimensionType` (Object)
  • `DatasetMeasureType` (Object)
  • `DatasetType` (Object)
  • `DateTimeType`
  • `NumberType` (Enumerated)
  • `SObjectFieldType` (Object)
  • `SObjectType` (Object)
  • `StringType` (Enumerated)
| **See Also** - [Edit variables.json](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/concept/bi-templatesdev-edit-variables-json.md) # varp() Returns the variance of the values in a field. Accepts measure fields as input but not expressions. ## Example - Calculate the Population Variance of Deal Amount ```nolang q = load "DTC_Opportunity_SAMPLE"; q = group q by all; q = foreach q generate varp('Amount') as 'var_Amount'; ``` **See Also** - [var()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-var.md) # View or Modify a Dashboard JSON File Use the JSON Editor to modify the JSON for a dashboard or lens. | Required Editions | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Available in Salesforce Classic and Lightning Experience. | | Available with CRM Analytics, which is available for an extra cost in **Enterprise**, **Performance**, and **Unlimited** Editions. Also available in **Developer** Edition. | | User Permissions Needed |   | | ------------------------------------------------- | ---------------------------------------- | | To modify the JSON file that defines a dashboard: | Create and Edit CRM Analytics Dashboards | JSON Editor displays the JSON of a lens or dashboard and lets you quickly see the effect of your edits in the running asset. 1. To access JSON Editor, open the lens or dashboard you want to edit, and press CTRL+E for PCs or CMD+E for Macs. 2. Modify the JSON in the editor. You can use standard keyboard shortcuts for editing functions and search. 3. To go back to the user interface and see how edits to the JSON appear in the lens or dashboard, click **Done**. 4. To retain your edits, save the lens or dashboard. Changes made in the JSON editor are not saved until you explicitly save the lens or dashboard. ## Next Steps In JSON Editor, the following shortcuts let you perform basic actions from your keyboard. | JSON Editor Keyboard Shortcut | Description | | ----------------------------------------- | ----------------------------------------------------------------- | | CRTL+3 (Windows); CMD+3 (Mac) | Disregard changes and load the original JSON | | CRTL+X (Windows); CMD+X (Mac) | Cut | | CRTL+C (Windows); CMD+C (Mac) | Copy | | CRTL+V (Windows); CMD+V (Mac) | Paste | | CRTL+Z (Windows); CMD+Z (Mac) | Undo | | SHIFT+CRTL+Z (Windows); SHIFT+CMD+Z (Mac) | Redo | | CRTL+F (Windows); CMD+F (Mac) | Search (RegExp, case-sensitive, or whole word searches available) | | CRTL+E (Windows); CMD+E (Mac) | View dashboard with changes to JSON | # VisualForce Events for Customizing the Wizard UI This reference section explains the details of using VisualForce for customizing the Wizard user interface. | Event Name | Subscribe/Publish | Description | Response | | ---------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ready` | publish | Fired from client indicating they are ready to receive events. | Response contains all the metadata: page, variableDefinitions, initialValues needed to render the questions and possible answers for the page. | | `update` | publish | Fired from client when ready to update one or more variables. | Variables with errors messages. | | `visibility` | publish | Fired from client to check ‘visibility’ of one or more questions. | Variables and their visibility enum. | | `values` | publish | Fired from client to request the most up-to-date values of each question. | The values of all variables in the entire wizard. | | `next` | subscribe | Fired from parent when user clicks “continue” button. May or may not advance the page. If there are errors in the variable values, the page will not advance. | A list of variables that are required with no values. | | `resize` | publish | Fired from client to change the size of the VisualForce page. | None. | | `options` | publish | Fired from client to get a list of ‘options’ for filling in drop-down list boxes. | List will be filtered for “queryable,” “excludes,” “exclude selected.” “Tags” will be applied to indicate which option values are “default,” “recommended,” or “previous” values. You can use this for sObjects, sObjectFields, string enums, and number enums. | | `computed` | publish | Fired from client to set the computed (suggested) values for a variable. | Variables with success or error messages. | | `close` | publish | Fired from client to close the wizard. No actions are taken as part of the close. | None. | | `buttons` | publish | Change the text of the Back and Next button. Can also enable or disable the Back or Next button. |   | | `create` | publish | Fired from the client to create an app before the final screen. Calls `POST /wave/folder` and returns results. | The status of the POST call. Success if app creation is kicked off successfully (not final app status), otherwise Fail. | | `dataset` | COMING SOON | Dataset | _Coming soon; not currently supported in this release. We intend to implement this as an ‘options’ event._ | | `dataset fields` | COMING SOON | Dimensions, Measures tied to parent datasets | _Coming soon; not currently supported in this release. We intend to implement this as an ‘options’ event._ | ## Event: wizard.ready - **Subscribe/Publish:** publish - **Input/Multiple:** optional - **Size:** small, medium, large - **Banner:** visible, title, progress **Note:** for VisualForce pages, the banner is hidden by default. - **Response:** Yes - **Normalized Input:** N/A - **Input Examples:** - `{}` - `{size : “large” }` - `{banner : visible : true, title : “My Custom title”, progress : “Almost done”}}` - `{size : “small”, banner : {visible : false}}` - **Output Example:** ```nolang {  "page": {    "condition": null,    "helpUrl": null,    "title": "Page 1",    "variables": [      {        "name": "stringExample",        "visibility": "Visible"      },      {        "name": "visibilityControl"        "visibility": "Visible"      },      {        "name": "visibilityTest",        "visibility": "Hidden"      }    ]  },  "variableDefinitions": {    "stringExample": {      "label": "What is the value of the string?",      "description": "The String.",      "defaultValue": null,      "variableType": {        "type": "StringType",        "enums": [          "foo",          "bar",          "baz",          "testStr"        ]      }    },    "stringExample2": {      "label": "What is the value of this string?",      "description": "The String2.",      "defaultValue": null,      "variableType": {        "type": "StringType"      }    },    "visibilityControl": {      "label": "Do you want to answer more questions?",      "description": "Check to test visibility",      "variableType": {        "type": "BooleanType"      },      "defaultValue": false,      "required": true    },    "visibilityTest": {      "label": "I should only be visible when visibilityControl is checked",      "variableType": {        "type": "StringType",        "enums": [          "aaa",          "bbb",          "ccc"        ]      }    },    "visibilityTest2": {      "label": "I should only be enabled when visibilityControl is checked",      "variableType": {        "type": "StringType"      }    },    "datasetExample": {      "label": "Pick a dataset",      "description": "Interesting dataset",      "variableType": {        "type": "DatasetType"      }    },    "dimensionExample": {      "label": "Pick a dimension",      "description": "Dim testing",      "defaultValue": {        "datasetId": "{{Variables.datasetExample.datasetId}}",        "fieldName": "test"      },      "variableType": {        "type": "DatasetDimensionType"      },      "required": false    }  },  "initialValues": {    "stringExample": null,    "stringExample2": null,    "visibilityControl": false,    "dimensionExample": {      "datasetId": "{{Variables.datasetExample.datasetId}}",      "fieldName": "test"    }  } } ``` ## Event: wizard.update - **Subscribe/Publish:** publish - **Input/Multiple:** yes - **Response:** yes - **Normalized Input:** yes - **Input Examples:** - `{name : “myVariable”, value : “some value” }` - `[{name : “myVariable”, value : “some value” }]` - `[{name : “myVariable”, value : “some value” }, {name : “myNumber”, value : 123}]` - `{myVariable : “some value”, myNumber: 123, myBoolean : true}` - `{name : “mySObject”, value : {sobjectName : “Account”}}` - **Output Example:** always an array ```nolang [    {name : “myVariable”: value : “some value”, valid : true },    {name : “myNumber”: value : null, valid : false, errorMessage : “Not a valid value”}    {name : “mySObject”: value : {sobjectName : “Account”}, valid : true} ] ``` ## Event: wizard.visibility - **Subscribe/Publish:** publish - **Input/Multiple:** yes - **Response:** yes - **Normalized Input:** yes - **Input Examples:** - `[“myVariable”, “myNumber”]` - `[{name : “myVariable”}]` - `{name : “myVariable”}` - `“myVariable”` - **Output Example:** always an array ```nolang [
     {name : “myVariable”: visibility : “Hidden”},
     {name : “myNumber”: visibility : “Visible”},
     {name : “myOtherVariable”: visibility : “Disabled”}
 ]
 ``` ## Event: wizard.values - **Subscribe/Publish:** publish - **Input/Multiple:** n/a - **Response:** yes - **Normalized Input:** n/a - **Input Examples:** - `{}` - **Output Example:** ```nolang {      values : {        myVariable: “foo”,        myNumber: 123,        myBoolean: true,        myDimension: {fieldName : “days”}   } } ``` ## Event: wizard.next - **Subscribe/Publish:** subscribe - **Input/Multiple:** n/a - **Response:** yes - **Normalized Input:** n/a - **Output Example:** Page will not advance if required fields are not met. - ```nolang {        “myVariable”: {              errorMessage: “Not a valid value”,              isRequired : true,              variableName : “myVariable”        } } ``` - ```nolang {} ``` ## Event: wizard.resize - **Subscribe/Publish:** publish - **Input/Multiple:** n/a - **Response:** no - **Normalized Input:** n/a - **Input Examples:** - `{size : “small”}` - `{size : “medium”}` - `{size : “large”}` ## Event: wizard.options - **Subscribe/Publish:** publish - **Input/Multiple:** no - **Response:** yes - **Normalized Input:** n/a - **Input Examples:** - `{name : “mySObjectVariableName”}` - `{name : “mySObjectFieldVariableName”}` - `{name : “myStringVariableName”}` - `{name : “myNumbertVariableName”}` - **Output Example:** ```nolang { "options": [   {     "label": "Account",     "value": "Account",     "tags": [       {         "tag": "Default",         "toolTip": "Default answer"       }     ]   },   {     "label": "Oppty",     "value": "Opportunities"   } ] } ``` ## Event: wizard.buttons - **Subscribe/Publish:** publish - **Input/Multiple:** n/a - **Response:** no - **Normalized Input:** n/a - **Input Examples:** - ```nolang {buttons : { next : {disabled : true, text : “Fix error before continue”}, back : {disabled : false, text : “Go Back”} } } ``` - ```nolang { buttons : { back : {disabled : true} } } ``` - ```nolang { buttons : { next: {“text” : “Proceed at Own Risk”} } } ``` - **Output Example:** None. Buttons should update accordingly. ## Event: wizard.create - **Subscribe/Publish:** publish - **Input/Multiple:** no - **Response:** yes - **Normalized Input:** yes - **Input Examples:** - ```nolang {folder : {label : "vfTest", description : "my desc"}} ``` # visualizationParameters Properties The `visualizationParameters` key contains chart properties defined for the step. When you associate the step with a widget, the widget properties override these settings. | Field Name | Description | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `options` | Specifies chart properties for steps added or clipped to the designer. CRM Analytics overrides these options when they are defined in the widget parameters. For more information about chart properties, see [Visualizing Data With Charts](https://help.salesforce.com/articleView?id=bi_visualize.htm). | | `visualizationType` | Specifies the chart type. You can override the chart type at the widget level. Valid values for visualizationType are:
  • `calheatmap`— calendar heat map
  • `choropleth` — choropleth (map)
  • `combo` — lines and bars to show multiple metrics
  • `flatgauge` — flat gauge
  • `funnel` — funnel
  • `hbar` — horizontal bar
  • `hdot` — horizontal dot plot
  • `heatmap`— heat map
  • `matrix`— matrix
  • `parallelcoords` — parallel coordinates
  • `pie` — donut
  • `pivottable` — pivot table
  • `polargauge` — polar gauge
  • `pyramid` — pyramid
  • `rating` — rating
  • `scatter` — scatter plot
  • `stackhbar` — stacked horizontal bar
  • `stackpyramid` — stacked pyramid
  • `stackvbar` — stacked vertical bar
  • `stackwaterfall` — stacked waterfall
  • `time` — timeline
  • `time-bar` — time bar
  • `time-combo` — time bar
  • `vbar` — vertical bar
  • `vdot` — vertical dot plot
  • `waterfall` — waterfall
| # WaveTemplateConfigurationModifier Apex Examples Examples include setting computed values for questions, hiding a question, managing enum values, working with array type variables, and more. ## Example **Create your class:** ```nolang public class ExampleWaveTemplateConfigurationModifier extends wavetemplate.WaveTemplateConfigurationModifier { public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo template) { // Method implementation } } ``` ## Example **Set the computed value for one of the questions:** ```nolang public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo template) { Map variables = template.getVariables(); variables.get('Has_Product').setComputedValue('No'); } ``` ## Example **Hide one of the questions:** ```nolang public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo template) { template.getUI().getPages().get(0).getVariables() .get('Has_Product').setVisibility(wavetemplate.VisibilityEnum.Hidden); } ``` ## Example **Remove an enum value from the dropdown list box using the specified array index:** ```nolang public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo template) { Map variables = template.getVariables(); wavetemplate.VariableDefinition hasProduct = variables.get('Has_Product'); List enums = hasProduct.getVariableType().getEnums(); enums.remove(1); hasProduct.getVariableType().setEnums(enums); } ``` ## Example **Populate the enum values in the dropdown list box (StringType variable):** ```nolang public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo template) { Map variables = template.getVariables(); wavetemplate.VariableDefinition caseRecordTypes = variables.get('IncludeCaseRecordTypes'); List enums = caseRecordTypes.getVariableType().getEnums(); RecordType [] results = [SELECT Name FROM RecordType where sobjectType = 'Case']; for (RecordType record : results){ //adds the record type names to the drop down list enums.add((string)record.get('Name')); } caseRecordTypes.getVariableType().setEnums(enums); } ``` ## Example **Given the following ArrayType variable:** ```nolang "OpptyRecordType": { "label": "Select OpptyRecordTypes that you want to bring in to Salesforce", "description": "Choose OpptyRecordTypes that you want to bring in to Salesforce.", "required": false, "variableType": { "type": "ArrayType", "itemsType": { "type": "StringType", "enums": ["Test", "Test2"] }    } } ``` **Add more values to the ArrayType variable enums:** ```nolang Map variables = template.getVariables(); wavetemplate.VariableDefinition enumsTest = variables.get('OpptyRecordType'); List enums = enumsTest.getVariableType().getItemsType().getEnums(); //create an empty list if you want to overwrite the original enums. RecordType [] results = [SELECT Name FROM RecordType where sobjectType = 'Opportunity' AND IsActive = true]; for ( RecordType record : results ) { enums.add((string)record.get('Name')); } enumsTest.getVariableType().getItemsType().setEnums(enums); ``` ## Example **Reduce the possible answers via the excludes:** ```nolang public override void onConfigurationRetrieval(wavetemplate.WaveTemplateInfo template) { Map variables = template.getVariables(); wavetemplate.VariableDefinition hasProduct = variables.get('Has_Product'); Set excludes = new Set(); excludes.add('Foo'); excludes.add('Bar'); hasProduct.setExcludes(excludes); } ``` ## Example **Set a variable answer before the app creates. Updating answers overwrites any value the user selected in the wizard:** ```nolang public override void beforeAppCreate(wavetemplate.WaveTemplateInfo waveTemplate, wavetemplate.Answers answers) { answers.put('Has_Product', 'No'); } ``` ## Example **Set a variable answer before the app updates. Updating answers overwrites any value the user selected in the wizard:** ```nolang public override void beforeAppUpdate(wavetemplate.WaveTemplateInfo waveTemplate, String previousAppVersion, wavetemplate.Answers answers) { answers.put('Has_Product', 'Yes'); } ``` # WaveTemplateConfigurationModifier Interfaces The main class is `WaveTemplateConfigurationModifier` with these supporting classes and their methods. ## WaveTemplateInfo Provides access to a template's release information, UI information, and variable definitions | Method | Description | | ------------------------------------------------- | -------------------------------------------------------------- | | `ReleaseInfo getReleaseInfo();` | Gets the release information for the template. | | `UI getUI();` | Gets the UI information for the template configuration wizard. | | `Map getVariables();` | Gets the variable definitions for the template. | ## ReleaseInfo The release information for a template. | Method | Description | | ------------------------------ | --------------------------------- | | `String getTemplateVersion();` | Gets the version of the template. | ## UI The UI information used to dynamically build the configuration wizard for the template. | Method | Description | | -------------------------- | ---------------------------------------------------------- | | `List getPages();` | Gets a list of all the pages for the configuration wizard. | ## UIPage The information for a page in the configuration wizard. | Method | Description | | --------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | `String getTitle();` | Gets the title of the configuration wizard page. | | `String getCondition();` | Gets the condition expression of the configuration wizard page. | | `Map getVariables();` | Gets the variables for the configuration wizard page. | | `void setTitle(String title);` | Set the title for the configuration wizard page. This value overrides the value specified in the JSON file. | ## Answers Contains a collection of all the answers to the variables. | Method | Description | | ------------------------------------ | ------------------------------------------------------------- | | `Object get(String name);` | Get the value (answer) of a specific variable (question). | | `void put(String name, Object obj);` | Update the value (answer) for a specific variable (question). | ## Variable Represents a template variable on a template configuration page. | Method | Description | | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `String getName();` | Get the name of the variable. | | `String getVisibility();` | Get the visibility of the variable in the configuration wizard. Returns a string as the value can contain a ternary operator. | | `void setVisibility(VisibilityEnum visibility);` | Set the visibility of the variable in the configuration wizard. This value overrides the value specified in the JSON file. Valid values are:
  • `Disabled`
  • `Hidden`
  • `Visible`
| ## VariableDefinition Represents a template variable definition. | Method | Description | | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `String getName();` | Get the name for the variable definition. | | `String getLabel();` | Get the label for the variable definition. | | `String getDescription();` | Get the description for the variable definition. | | `Object getDefaultValue();` | Get the default value for the variable definition. | | `VariableType getVariableType();` | Get the variable type information for the variable definition. | | `Boolean isRequired();` | Indicates whether a variable value is required for this variable definition (`true`) or not (`false`). | | `Boolean isExcludeSelected();` | Indicates whether values selected in other variables should be excluded from this variable definition (`true`) or not (`false`). | | `Set getExcludes();` | Return a list of variable values to be excluded from the pick list displayed to the user. This can be a single regex. | | `void setLabel(String label);` | Set the label for the variable definition. This value overrides the label specified in the JSON file. | | `void setDescription(String description);` | Set the description for the variable definition. This value overrides the description specified in the JSON file. | | `void setComputedValue(String Object);` | Set the computed value for the variable definition. This value overrides the value specified in the JSON file and replaces the `defaultValue`. | | `void setRequired(Boolean required);` | Set the `isRequired` value for the variable definition. This value overrides the value specified in the JSON file. | | `void setExcludes(Set excludes);` | Set the excludes list value for the variable definition. This value overrides the value specified in the JSON file. | ## VariableType The variable type of a variable definition. | Method | Description | | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `VariableTypeEnum getType();` | Gets the variable type for the variable definition. Valid values are:
  • `BooleanType`
  • `StringType`
  • `NumberType`
  • `ArrayType`
  • `DateTimeType`
  • `ObjectType`
  • `SobjectType`
  • `SobjectFieldType`
  • `DatasetType`
  • `DatasetDimensionType`
  • `DatasetMeasureType`
  • `DatasetDateType`
| | `String getDataType();` | Gets the SOAP data type for a `SObjectFieldType` variable definition. Valid values are:
  • `xsd:int`
  • `xsd:string`
  • `xsd:datetime`,
  • `xsd:boolean`
  • `xsd:any`
| | `VariableTypeEnum getType();` | Gets the variable type for the variable definition. Valid values are:
  • `BooleanType`
  • `StringType`
  • `NumberType`
  • `ArrayType`
  • `DateTimeType`
  • `ObjectType`
  • `SobjectType`
  • `SobjectFieldType`
  • `DatasetType`
  • `DatasetDimensionType`
  • `DatasetMeasureType`
  • `DatasetDateType`
| | `VariableType getItemsType();` | Gets the variable type for each entry in an `ArrayType` variable definition. | | `Set getEnums();` | Gets the enumerated values for a `StringType` or `NumberType` variable definition. | | `void setEnums(Set enums);` | Set the enumerated values for a `StringType` or `NumberType` variable definition. These values overrides the values specified in the JSON file. | # WaveTemplateConfigurationModifier Methods Extend `WaveTemplateConfigurationModifier` with the following methods. - `onConfigurationRetrieval`. Runs before the wizard starts. This method is for standard apps only. If the org lacks required data or settings, you can customize the wizard (variables) based on the org data check or disable app creation. Requires `WaveTemplateInfo`: ```nolang onConfigurationRetrieval(wavetemplate.WaveTemplateInfo waveTemplate) ``` - `beforeAppCreate`. Runs after completion of the wizard for standard apps or on app creation for embedded apps. Use this method to avoid errors during app creation as the result of invalid user selections or org settings. Requires `WaveTemplateInfo` and `Answers`: ```nolang beforeAppCreate(wavetemplate.WaveTemplateInfo template, wavetemplate.Answers answers) ``` - `beforeAppUpdate`. Runs before app updates based on new version of the template for standard and embedded apps. Use this method to validate that org data is compatible with new version. Requires `WaveTemplateInfo`, `Answers`, and the previous app version: ```nolang beforeAppUpdate(wavetemplate.WaveTemplateInfo template, String previousAppVersion, wavetemplate.Answers answers) ``` The methods are optional and all of them can be overridden. # week_first_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the first day (Sunday) of the week that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", week_first_day(OrderDate) as "week_first_day" FROM "dates_sample_data"; ``` | date | week_first_day | | ------------------- | ------------------- | | 2015-01-21 15:30:00 | 2015-01-18 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-18 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-25 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-01 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-17 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-25 00:00:00 | | 2015-12-03 00:00:00 | 2015-11-29 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-10 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-10 00:00:00 | # week_last_day({date}) Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day (Saturday) of the week that contains the specified date. ## Example ```nolang SELECT OrderDate as "date", week_last_day(OrderDate) as "week_last_day" FROM "dates_sample_data"; ``` | date | week_last_day | | ------------------- | ------------------- | | 2015-01-21 15:30:00 | 2015-01-24 00:00:00 | | 2015-01-21 00:00:00 | 2015-01-24 00:00:00 | | 2015-01-31 10:00:30 | 2015-01-31 00:00:00 | | 2015-02-03 15:30:00 | 2015-02-07 00:00:00 | | 2016-01-21 23:59:59 | 2016-01-23 00:00:00 | | 2015-10-31 23:59:59 | 2015-10-31 00:00:00 | | 2015-12-03 00:00:00 | 2015-12-05 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-16 00:00:00 | | 2016-01-11 03:30:00 | 2016-01-16 00:00:00 | # week_last_day(date) Returns the date of the last day of the week for a specific date. ```nolang q = foreach q generate week_last_day('BillDate') as "Week Last Day"; ``` # WHERE Clause By default, a SQL query retrieves every row in your dataset. Use the optional `WHERE` clause to restrict your query results to a conditional expression. The conditional expression in the `WHERE` clause takes the following syntax. ```nolang fieldExpression [logicalOperator fieldExpression2][...] ``` ```nolang SELECT COUNT(*) as Count FROM "Superstore" WHERE City = 'San Francisco'; ``` | Count | | ----- | | 510 | You can add multiple field expressions to conditional expressions with logical operators. ```nolang SELECT COUNT(*) as Count FROM "Superstore" WHERE City = 'Los Angeles' OR City = 'San Francisco'; ``` | Count | | ----- | | 1,257 | The `WHERE` clause supports these operators. | Type | Operator Name | Supported Types | | -------------------- | ---------------------- | ------------------------ | | Comparison Operators | !=, = | Numeric, String, Boolean | |   | \<, \<=, >, >= | Numeric, String | |   | `IN`, `NOT IN` | Numeric, String | | Null Operators | `IS NULL, IS NOT NULL` | Numeric | | Logical Operators | `AND, OR, NOT` | Boolean | The left operand of a comparison operator must be a valid field. The right operand cannot be a field. Arithmetic operators (e.g. +, -, /, \*, %) between supported types can be used on the right hand side. `WHERE` is limited to comparisons within a single column. In a non-nested query (a non-subquery), you can’t pass fields to a math or string function in a `WHERE` clause. You can pass a constant. To pass fields to a math or string function in a subquery, include it in the outer query’s `WHERE` clause. If you use it in the innermost query, SQL throws an error. # Why CRM Analytics Templates? Templates can bring the investment you make in CRM Analytics app development to life. When you build an app using CRM Analytics Studio, you load data into CRM Analytics, transform it, create visualizations from the data, and design dashboards in a development or scratch org. Then, you store all the assets in a CRM Analytics app, which is actually a folder used to contain all an app’s assets. Instead of having to do all that work, other organizations can use your template to create their own version of your app built around their own data. After you develop your app in CRM Analytics Studio, turn it into a template with clicks in Analytics Studio, a simple command in Visual Studio Code, or the Salesforce command line interface (CLI). Then distribute it to customers, partners, and other teams within your company. They can deploy the template to their own Salesforce orgs and, with CRM Analytics Studio, use it to create a custom version of the app using their own data—either from Salesforce or another environment. You can edit the template files to include features that let users customize the version of the app that they create from the template via a configuration wizard. When they create the app, they can customize the app’s appearance, how it consumes and displays data, which dashboards and charts to display, and other aspects of the app’s functionality. You can also design your template to create apps that require no customization or user interaction, but are automatically installed into an organization using a managed package. CRM Analytics embedded dashboards surface your templated app into orgs without requiring users to have access to CRM Analytics Studio. - **[The Source App](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-master-app.md)** For the purposes of CRM Analytics Templates, the app you create in CRM Analytics Analytics Studio is called the *source app*. It’s a collection of CRM Analytics assets—datasets, dataflows, recipes, lenses, and dashboards— stored together in a folder. - **[Templated App Type](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-app-type.md)** The app you’re creating a template for can be a standard app that users install using the configuration wizard in CRM Analytics Studio. Or it can be an embedded app that is automatically installed for users and doesn’t require customization or access to Analytics Studio. You can also create data templates that users install in the Data Manager. Data templates only create data assets. - **[The Configuration Wizard](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-wizard.md)** A CRM Analytics template can include a configuration wizard, made up of one or more pages with questions and answers, that allows users to customize the apps they create from the template. The configuration wizard is an optional but potentially powerful part of a template. - **[The Template Object](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-template-object.md)** Turning the source app into a template creates a `waveTemplates` object. The object contains JSON files that define an app's user experience assets and provide instructions to create the app. # widget Properties The `widgets` key defines all widgets that are available in the dashboard. It contains a separate node for each widget. Each widget appears in all layouts to which it’s added. The properties available for each widget depend on the widget type. For example, a chart widget has the `legend` property, but a text widget doesn’t. | Property Name | Description | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `parameters` | Widget parameters vary depending on the type of widget and, if applicable, type of chart. The `step` element defines the step attached to a widget. For detailed information about different widget parameters, see [parameters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-widgets-parameters-properties.md). | | `type` | The widget type specifies one of the other supported widget types. The value of this field must be a string.
  • `chart`
  • `comparetable`
  • `container`
  • `dateselector`
  • `globalfilters`
  • `filterpanel`
  • `image`
  • `link`
  • `listselector`
  • `number`
  • `pillbox`
  • `rangeselector`
  • `table`
  • `text`
  • `valuestable`
| # widgets JSON The `widgets` section defines the widgets that appear in the dashboard. Each widget has a name. ## Example ```nolang "widgets": { "text_1": { "parameters": { "fontSize": 20, "text": "Grouping", "textAlignment": "center", "textColor": "#091A3E" }, "type": "text" }, "pillbox_1": { "parameters": { "compact": false, "exploreLink": false, "step": "StaticSAQLMinRanges" }, "type": "pillbox" }, "chart_1": { "parameters": { "autoFitMode": "fit", "showValues": true, "legend": { "showHeader": true, "show": true, "position": "right-top", "inside": false }, "axisMode": "multi", "visualizationType": "hbar", "exploreLink": true, "title": { "label": "", "align": "center", "subtitleLabel": "" }, "trellis": { "enable": false, "type": "x", "chartsPerLine": 4 }, "measureAxis2": { "showTitle": true, "showAxis": true, "title": "" }, "measureAxis1": { "showTitle": true, "showAxis": true, "title": "" }, "theme": "wave", "step": "Account_BillingCount_1", "dimensionAxis": { "showTitle": true, "showAxis": true, "title": "" } }, "type": "chart" } } ``` - **[widget Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-widgets-parameters.md)** The `widgets` key defines all widgets that are available in the dashboard. It contains a separate node for each widget. Each widget appears in all layouts to which it’s added. The properties available for each widget depend on the widget type. For example, a chart widget has the `legend` property, but a text widget doesn’t. - **[parameters Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-widgets-parameters-properties.md)** The `parameters` key contains a list of properties that control the appearance of the widget. Each widget type, including each chart type, contains a unique set of properties. # widgets Properties The `widgets` key contains properties that determine the height and width of each widget, and where it's placed on the dashboard layout. Because the Dashboard Designer uses a grid, you specify the properties in terms of rows and columns. For example, you specify the number of columns to determine the width of a widget.
Property NameTypeDetails
nameString

Internal name of the widget. This name is used to reference the widget in the dashboard JSON. Not included in the Dashboard Designer's user interface.

columnInteger

The column number where the widget starts. Column and row specify the top left corner of the widget.

If this widget is included in a container, these properties are relative to the container widget.

Included in the Dashboard Designer's user interface. Value is determined based on the widget's placement.

rowInteger

The row number where the widget starts. Column and row specify the top left corner of the widget.

Included in the Dashboard Designer's user interface. Value is determined based on the widget's placement.

colspanIntegerThe number of columns that a widget spans—the width of the widget. If the dashboard doesn't have enough columns to accommodate the specified width, then columns are added to the dashboard. Included in the Dashboard Designer's user interface. Value is determined based on the widget's placement.
rowspanIntegerThe number of rows that a widget spans—the height of the widget. If the dashboard doesn't have enough rows to accomodate the specified height, then rows are added. Included in the Dashboard Designer's user interface. Value is determined based on the widget's placement.
widgetStyleArray

Contains properties that set the border type, border color, and background color. Available for all widgets. Not included in the Dashboard Designer's user interface.

- **[widgetStyle Properties](https://developer.salesforce.com/docs/analytics/bi-dev-guide-json/guide/bi-dbjson-gridlayout-widgets-pages-widgetstyle-properties.md)** The `widgetStyle` key contains properties that set the border type, border color, and background color of the widget. You can specify these attributes at two levels. To set the default for all dashboard widgets, use the `widgetStyle` field under `gridLayouts`. To set a specific widget, use the `widgetStyle` field under `widgets`. This setting overrides the default settings for all widgets. # widgetStyle JSON and Properties The `widgetStyle` key contains the default widget properties that can be applied to each widget. **note:** You can specify these attributes at two levels. To set the default for all dashboard widgets, use the `widgetStyle` field under `gridLayouts`. To set a specific widget, use the `widgetStyle` field under `widgets`. Settings at the widget level override the default settings for all widgets. | Property Name | Type | Details | | ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `backgroundColor` | String | Color of the widget's background, specified in hex color code. The default is `#FFFFFF`. Included in the Dashboard Designer's user interface. | | `borderColor` | String | Color of the widget's border, specified in hex color code. The default is `#FFFFFF`. If no border is specified, the widget has no border. Included in the Dashboard Designer's user interface. | | `borderEdges` | List | A list of values that specify which edges of the widget have a border. Valid values are `left`, `right`, `top`, `bottom`, and `all`. Default is no border. Included in the Dashboard Designer's user interface. | | `borderRadius` | Integer | Roundness of the border corners.Valid values are: `0`(not rounded, default), `4`, `8`, and `16`. The higher the value, the more rounded the corner.Included in the Dashboard Designer's user interface. | | `borderWidth` | Integer | Thickness of the border.Valid values are: `1`, `2` (default), `4`, and `8`. The higher the value, the thicker the border.Included in the Dashboard Designer's user interface. | # widgetStyle Properties The `widgetStyle` key contains properties that set the border type, border color, and background color of the widget. You can specify these attributes at two levels. To set the default for all dashboard widgets, use the `widgetStyle` field under `gridLayouts`. To set a specific widget, use the `widgetStyle` field under `widgets`. This setting overrides the default settings for all widgets. | Property Name | Type | Details | | ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `backgroundColor` | String | Background color of the widget. The default is `#FFFFFF`. Included in the Dashboard Designer's user interface. | | `borderColor` | String | Color of the widget's border. The default is `#FFFFFF`. Included in the Dashboard Designer's user interface. | | `borderEdges` | List | A list of values that specify which edges of the widget have a border. Valid values are `left`, `right`, `top`, `bottom`, and `all`. Default is no border. Included in the Dashboard Designer's user interface. | | `borderRadius` | Integer | The roundness of the border corners.Valid values are: `0` (not rounded, default), `4`, `8`, and `16`. The higher the value, the more rounded the corner.Included in the Dashboard Designer's user interface. | | `borderWidth` | Integer | Width of the widget's border. Valid values are `1`, `2` (default), `4`, and `8`. Included in the Dashboard Designer's user interface. | # Window Functions A window function lets you perform calculations on a selection—or "window"—of rows that are related to the current row. Unlike a regular aggregate function, such as `avg()`, `sum()`, or `count()`, the row output of a window function isn’t grouped into a single row. A window function takes this syntax. ```nolang () OVER ([PARTITION BY ] [ORDER BY ORDER_CLAUSE] ) AS