---
schema_version: "1"
id: 34be1d2eabaf9554ce99a682439d776f620af9089878930ddd7d7c721dfd9978
title: Export and Import Omniscripts
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_export_omniscripts_23953.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_export_omniscripts_23953.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 0e0e59040de0503806291bd3f1b5b159bc9faf9454c95585c95f8e674b0c388f
description: Export or import Omniscripts to use them in another org, such as when you create them in a sandbox or to use sample data packs that Salesforce provides. When exporting or importing data packs for Omniscripts, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack.
products:
  - Omnistudio
release: "264"
---
# Export and Import Omniscripts

Export or import Omniscripts to use them in another org, such as when you create them in a sandbox or to use sample data packs that Salesforce provides. When exporting or importing data packs for Omniscripts, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack.

#### See Also

- [Create a DataPack or MultiPack](https://help.salesforce.com/s/articleView?id=xcloud.os_create_a_datapack.htm&type=5&language=en_US)
- [Import a DataPack](https://help.salesforce.com/s/articleView?id=xcloud.os_import_a_datapack.htm&type=5&language=en_US)
- [Data Deployment with Data Packs](https://help.salesforce.com/s/articleView?id=xcloud.os_data_deployment_with_datapacks.htm&type=5&language=en_US)

## Export an Omniscript

To export an Omniscript in the new designer on the standard runtime, use the Salesforce CLI. Omnistudio exports the file in JSON format.

Before you begin:

- [Set up Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
- [Authorize your org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm).
- Export any associated Data Mappers, Integration Procedures, and Flexcards, in that order.
    
    See [Export or Import an Omnistudio Data Mapper](https://help.salesforce.com/s/articleView?id=xcloud.os_export_or_import_an_omnistudio_data_mapper.htm&release=264.0.0&type=5 "Export or import Data Mappers to use them in another org, such as when you create them in a sandbox. When exporting or importing data packs for Data Mappers, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack."), [Export or Import an Omnistudio Integration Procedure](https://help.salesforce.com/s/articleView?id=xcloud.os_export_or_import_an_omnistudio_integration_procedure.htm&release=264.0.0&type=5 "Export or import Integration Procedures to use them in another org, such as when you create them in a sandbox. When exporting or importing data packs for Integration Procedures, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack."), and [Export and Import Flexcards](https://help.salesforce.com/s/articleView?id=xcloud.transfer_flexcards_and_sample_data_packs.htm&release=264.0.0&type=5 "Import or export Flexcards to use them in another org, such as when you create them in a sandbox or to use sample data packs that Salesforce provides. When exporting or importing data packs for Flexcards, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack.").

1. From a terminal in VS Code, enter this command, and replace the variables with values for your org.
    
    `sf data export tree --query "SELECT IsMetadataCacheDisabled, IsTestProcedure, Description, OverrideKey, Name, OmniProcessKey, Language, PropertySetConfig, LastPreviewPage, OmniProcessType, ElementTypeComponentMapping, SubType, ResponseCacheType, IsOmniScriptEmbeddable, CustomJavaScript, IsIntegrationProcedure, VersionNumber, DesignerCustomizationType, Namespace, Type, RequiredPermission, WebComponentKey, IsWebCompEnabled,(SELECT Description, DesignerCustomizationType, Name, EmbeddedOmniScriptKey, IsActive, Type, ParentElementId, PropertySetConfig, SequenceNumber, Level, Id from OmniProcessElements) from OmniProcess where OmniProcessType='OmniScript' and id='omniscript_id'" --target-org org_alias --plan --output-dir export_directory`
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_note.png)
    
    Note
    
    Don't include the `isActive` field on OmniProcess when you export the Omniscript.
    
    org\_alias
    
    The alias of the org from where you’re exporting.
    
    export\_directory
    
    The directory in the project where the exported JSON is stored.
    
    omniscript\_id
    
    The ID of the Omniscript that you want to export.
2. Verify whether the JSON file is downloaded in the export directory.

## Import an Omniscript

To import an Omniscript in the new designer on the standard runtime, use the Salesforce CLI.

Before you begin:

- [Set up Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
- Import any associated Data Mappers, Integration Procedures, and Flexcards, in that order.
    
    See [Export or Import an Omnistudio Data Mapper](https://help.salesforce.com/s/articleView?id=xcloud.os_export_or_import_an_omnistudio_data_mapper.htm&release=264.0.0&type=5 "Export or import Data Mappers to use them in another org, such as when you create them in a sandbox. When exporting or importing data packs for Data Mappers, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack."), [Export or Import an Omnistudio Integration Procedure](https://help.salesforce.com/s/articleView?id=xcloud.os_export_or_import_an_omnistudio_integration_procedure.htm&release=264.0.0&type=5 "Export or import Integration Procedures to use them in another org, such as when you create them in a sandbox. When exporting or importing data packs for Integration Procedures, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack."), and [Export and Import Flexcards](https://help.salesforce.com/s/articleView?id=xcloud.transfer_flexcards_and_sample_data_packs.htm&release=264.0.0&type=5 "Import or export Flexcards to use them in another org, such as when you create them in a sandbox or to use sample data packs that Salesforce provides. When exporting or importing data packs for Flexcards, if you encounter Apex limit errors such as heap or CPU limits, reduce the size of the data pack by unselecting dependencies during the export process. Additionally, break the data pack into multiple smaller data packs. As a best practice, we recommend including no more than 10 elements in each data pack.").

From a terminal in VS Code, enter this command, and replace the variables with values for your org.

`sf data import tree --plan ./export_directory/OmniProcess-OmniProcessElement-plan.json --target-org org_alias`

org\_alias

The alias of the org where you’re importing.

export\_directory

The directory in the project where the exported JSON is stored.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/images/icon_note.png)

Note

If the exported JSON file has `isActive=true`, the import operation fails.

## Export an Omniscript from the Designer on a Managed Package

Export Omniscripts in a data pack to share them with other Salesforce orgs.

1. From the App Launcher, find and select **Omniscripts**.
2. Expand an Omniscript and select the version to export.
3. Click ![actions menu icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/flexcard_header_menu_icon.png), and then select **Export**.
4. Follow the instructions and enter the information as needed.
5. To store the data pack and access it from Omni DataPacks, select **Add To Library**.
6. To store the data pack on your local machine, select **Download**.
7. Click **Done**.

## Import an Omniscript to the Designer on a Managed Package

If you're using the designer on a managed package, add existing Omniscripts to an org by importing them with a data pack.

1. From the App Launcher, find and select **Omniscripts**.
2. Click **Import** and then follow the instructions.