Import Business Analyst Report Template (Business Analyst)

Available with Business Analyst license.

Summary

Imports an online report so that it can run locally using a locally installed ArcGIS Business Analyst dataset.

This tool is the underlying engine that runs the Import Template interactive workflow from the Catalog pane. This tool is ideal for performing more advanced automated tasks, such as importing templates through Python scripting or programmatically modifying data paths.

The Import Template workflow will run the tool in the background and add its information to the Geoprocessing history.

Usage

  • The report template ID will be the portal item ID.

  • All Business Analyst reports contain a unique alphanumeric report template ID. To locate a report template ID, in the Catalog window, click the Portal tab, and click the My Content button. In the Report Templates folder, hover over a report template. The report template ID is listed as the Name value. The Path URL contains the report template ID and connects to the item page in your portal or on ArcGIS Online.

  • The output folder will contain all of the resources required to run the report locally.

  • The Dataset ID parameter refers to the ID of the local Esri dataset.

  • The Config parameter is an optional parameter that defines the associated Statistical Data Collection (SDCX) that will be stored locally or referenced.

  • If the Config parameter is not specified, the tool will use the default download option. To set download options, click Project > Options > Business Analyst > Set options for importing report templates.

Parameters

LabelExplanationData Type
Online Report Template ID

The report template ID.

String
Output Folder
(Optional)

The local folder where the report template items will be imported.

Folder
Dataset ID
(Optional)

The dataset that will be used to populate the report variables.

String
Config
(Optional)

A JSON string specifying where the report's SDCX map report variables will be stored. The config options are as follows:

  • ID—The portal item ID of the SDCX
  • Download—True or false. Set to true to download the SDCX, or set to false to reference an existing SDCX.
  • Path—The location of the SDCX. Use an empty string to use the existing default—for example, the report output folder location—or specify a new folder location or an existing folder that contains the SDCX.
  • Name—The name of the SDCX. Specify a new name for the SDCX or the name of an existing SDCX.

String

Derived Output

LabelExplanationData Type
Updated Folder

The updated folder.

Folder

arcpy.ba.ImportBusinessAnalystReportTemplate(online_report_template_id, {output_folder}, {dataset_id}, {config})
NameExplanationData Type
online_report_template_id

The report template ID.

String
output_folder
(Optional)

The local folder where the report template items will be imported.

Folder
dataset_id
(Optional)

The dataset that will be used to populate the report variables.

String
config
(Optional)

A JSON string specifying where the report's SDCX variables will be stored. The config options are as follows:

  • id—The portal item ID of the SDCX.
  • download—True or false. Set to true to download the SDCX, or set to false to reference an existing SDCX.
  • path—The location of the SDCX. Use an empty string to use the existing default—for example, the report output folder location—or specify a new folder location or an existing folder that contains the SDCX.
  • name—The name of the SDCX. Specify a new name for the SDCX or the name of an existing SDCX.

String

Derived Output

NameExplanationData Type
updated_folder

The updated folder.

Folder

Code sample

ImportBusinessAnalystReportTemplate example (Python window)

The following Python window script demonstrates how to use the ImportBusinessAnalystReportTemplate function.

import arcpy
arcpy.ba.ImportBusinessAnalystReportTemplate(
    online_report_template_id="33bcaa1e97fc4b9ba7fc68e14402a10f",
    output_folder=r"C:\ArcGIS\Business Analyst Templates",
    dataset_id="USA_ESRI_2022",
    config='{"downloadConfig":[{"id":"023871b31068415cbc0340fdd3ec5ba7","download":true,"path":"","name":"San Francisco Spending"}]}')

Licensing information

  • Basic: Requires Business Analyst
  • Standard: Requires Business Analyst
  • Advanced: Requires Business Analyst

Related topics