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.

    1>>sf analytics app list
    2
    3NAME        LABEL       FOLDERID            STATUS           TEMPLATESOURCEID
    4──────────  ──────────  ───────────  ──────
    5MyNewApp  MyNewTemplate  00l0S000000MmGQQA0  newstatus
    6SharedApp1  Shared App  00l0S000000Mm9tQAC  completedstatus  0Nk0S0000008OJDSA2
    7SharedApp   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]

    folderidRequired. The ID of the source app to use when creating the template. You can use analytics:app:listto see information about the apps on your org.
    usernameThe user name or alias of the target org. If not specified, CRM Analytics uses the default org.
    api_versionThe API version to use for this command.
    --jsonUse this flag to specify format the output as JSON.
    --loglevelSpecify 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