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.
-
Get a Developer Edition Org Sign up for a Sign up for a Developer Edition org to use as your Dev Hub org. If you're a Salesforce Partner, you can use your Partner Business Org (PBO) as your Dev Hub org. If you don’t yet have a PBO, follow the steps in Join the Salesforce Partner Community and Request a Salesforce Partner Business Org to get one.
Standard Developer Edition orgs may require specific activation or contact Salesforce support to provision Data 360 and Tableau Next features. Provisioning these features can take time after activation.
-
Enable Dev Hub Enable Dev Hub in your Developer Edition org or PBO. See Select and Enable a Dev Hub.
-
Enable Data 360 and Tableau Next for Scratch Orgs To use Data 360 and Tableau Next in scratch orgs, Salesforce partners must log a case with Salesforce Partner Support. This feature is only available for scratch orgs created from a Dev Hub that’s part of your Partner Business Org (PBO).
-
Enable Second-Generation Managed Packaging Enable 2GP in your Dev Hub org. See Enable Dev Hub and Second-Generation Managed Packaging.
-
Sign Up for a Namespace Org If you already have a registered namespace, you can skip this step. Otherwise, create a separate Developer Edition org to serve as your namespace org, and specify your desired namespace. See Create and Register Your Namespace for Second-Generation Managed Packages.
-
Register the Namespace From your Dev Hub org, register the namespace created in the previous step. See Link a Namespace to a Dev Hub Org.
-
Install Development Tools
- Install VS Code. See Install Salesforce Extensions in Visual Studio Code.
- Install the Salesforce CLI. See Install Salesforce CLI.
- Install the Salesforce Extension Pack (Expanded) for VS Code. See Salesforce Extension Pack (Expanded).
-
Create a project. See Create a Salesforce DX Project.
-
Configure sfdx-project.json:
- Specify your package's namespace with the
namespaceattribute. For example:"namespace":"exp-mgr". - Specify the login URL for production, which is
https://login.salesforce.com.
- Specify your package's namespace with the
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 opencommand. 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.xmlfile that you downloaded contains all the metadata entities related to the data kit. - Use this
package.xmlfile in your Salesforce DX project to retrieve the data kit metadata. From the CLI, use the commandsf project retrieve start --manifest package.xmlto 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 startcommand to deploy the components listed in thepackage.xmlfile. Seeproject 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_KITcommand to create a beta Salesforce managed package that points to your data kit metadata folder. Beta packages can only be installed in scratch orgs. Seepackage 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.jsonfile. 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.