Workflow for Tableau Next Scratch Orgs

Creating and packaging a Tableau Next templated app is similar to creating and packaging any app with second-generation packaging (2GP), but there are a few key differences in the process. You still use the Salesforce CLI commands and scratch orgs, but with Data 360 in the mix, some features that you want to include must be added to a data kit first. Then you retrieve that metadata into a Salesforce DX project and move that project to a GitHub repository. Once there, other developers can clone it, deploy the data kit metadata to their scratch org, and continue to make customizations. When development is complete, you create your app template, package it up, and send it out into the world.

Tableau Next requires Dev Hub enabled in Developer, Enterprise, Performance, or Unlimited Editions. Scratch orgs are supported in Developer, Enterprise, Group, and Professional Editions.

Make sure to complete these prerequisites before you create and start working on a Tableau Next templated app or assets.

  • Create a project. See Create a Salesforce DX Project.

  • Configure sfdx-project.json:

    • Specify your package's namespace with the namespace attribute. For example: "namespace":"exp-mgr".
    • Specify the login URL for production, which is https://login.salesforce.com.

To work with Data 360 and Tableau Next features in a scratch org, you must first set up a scratch definition file and use the Salesforce CLI to create the scratch org.

  • To create a scratch org, from the CLI, use the command sf org create scratch -a SCRATCH_ORG_NAME -f config/ project-scratch-def.json -w 10 -v DEVHUB_ALIAS. The next example shows a sample scratch definition file. See Create Scratch Orgs. This scratch org is the publisher or source org where you create the Data 360 and Tableau Next elements and add them to a data kit.

Sample project-scratch-def.json file with Data 360 and Tableau Next licenses.

  • To open the scratch org, run the sf org open command. Navigate to Data Cloud Setup to verify that Data 360 is enabled. If you see green checkmarks, then Data 360 is provisioned.
  • From Salesforce Setup, in the Quick Find box, enter Tableau Next, and then select Tableau Next Setup.
  • Enable Tableau Next.
  • In the scratch org, create your Data 360 elements: data streams, data mappings, calculated insights, streaming or batch data transforms, and so on. To know what Data 360 features are available for packaging, see Data 360 Extensibility Readiness Matrix.
  • In the Data 360 UI, create a standard data kit and add the Data 360 features that you created to that data kit. See Create a Data Kit
  • Review the publishing sequence for the data kit.
  • In your scratch org, from Data Cloud Setup, click Data Kits.
  • Select the data kit, and then click Download Manifest. The package.xml file that you downloaded contains all the metadata entities related to the data kit.
  • Use this package.xml file in your Salesforce DX project to retrieve the data kit metadata. From the CLI, use the command sf project retrieve start --manifest package.xml to retrieve the data kit metadata from the scratch org into the project that you created. See Retrieve Source From the Scratch Org to Your Project. After this command completes, you see new project folders that contain the data kit metadata.
  • Upload the entire project to GitHub or any source control system. Another developer can then download that project, deploy the data kit into their scratch org, and modify it. For example, that developer can add a new data stream to the data kit. This workflow enables multiple developers to work on the same data kit.
  • From your project directory, run the sf project deploy start command to deploy the components listed in the package.xml file. See project deploy start.

    sf project deploy start --manifest package.xml

  • Now the data kit is installed, but you still must deploy the data streams, data models, calculated insights, and all the data kit elements into the second scratch org to use them. See Deploy a Data Stream from a Data Kit.

  • After the data kit is deployed to the second scratch org, open the scratch org to see the data kit and all of its data stream bundles, data models, calculated insights, and so on.

  • A second developer can then create a data stream in their scratch org, add it to a data kit, retrieve the metadata into their project, and then upload that project to GitHub for another developer to work on.

  • From the CLI, run the sf package create -n PACKAGE_NAME -t Managed -v DEVHUB_ALIAS -p PATH_TO_DATA_KIT command to create a beta Salesforce managed package that points to your data kit metadata folder. Beta packages can only be installed in scratch orgs. See package create.

  • If your Data 360 app builds on the Data Cloud SSOT package, you must declare the SSOT package as a dependency in your sfdx-project.json file. You can find the latest SSOT package ID on the Salesforce Partner Community site. For example, if your package includes a CRM data stream that maps to a standard DMO, the SSOT package must be included as a dependency.