---
schema_version: "1"
id: 366e0ffe66f74f21d61825ddd88e8d4d7cdbc556bf587a75a15721b89625cc4f
title: Embed an Omniscript in Another Omniscript
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_embed_an_omniscript_in_another_omniscript_20581.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_embed_an_omniscript_in_another_omniscript_20581.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 32a8580c431ec7918a2da71dc53796639d78e6b79bed177686af4b36deb9b107
description: An Omniscript can be reused in one or more existing Omniscripts. Reusing Omniscripts enables you to build a variety of smaller scripts and then piece them together into one or more parent scripts. Embedded Omniscripts behave just like other Omniscript elements.
products:
  - Omnistudio
release: "264"
---
# Embed an Omniscript in Another Omniscript

An Omniscript can be reused in one or more existing Omniscripts. Reusing Omniscripts enables you to build a variety of smaller scripts and then piece them together into one or more parent scripts. Embedded Omniscripts behave just like other Omniscript elements.

A reusable Omniscript cannot contain another reusable Omniscript. Additionally, no element in a reusable Omniscript can have the same name as an element in the parent script. Reusable Omniscripts adopt the script configuration of the parent script.

Make sure that each embedded Omniscript defines unique **Element Name** JSON nodes in its Set Values elements. If two child Omniscripts of the same parent set values for the same JSON nodes, only values from the first child Omniscript are set, even if both children run conditionally.

1. In the Omniscript you want to reuse, click Setup, and select **Reusable**.
2. Activate the reusable Omniscript.
3. Navigate to the Omniscript where you want to use the reusable Omniscript.
4. From the elements panel, expand the **Omniscripts** section.
5. Locate the reusable Omniscript and drag it into the canvas.
6. Preview your Omniscript to test the behavior.

## Activate and Deactivate Embedded Omniscripts

When you activate or deactivate an embedded script, Salesforce updates all activated parent Omniscripts to reflect the change.

1. From the Setup section of the embedded Omniscript, activate or deactivate the Omniscript.
2. Verify the Affected Omniscripts (any active Omniscript that this form is embedded in), and click **Proceed**.
    
    ![image](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio-264-0-0-production-enus/f526eaa8-ae05-487a-8944-4bb99b0b78ac/omnistudio/images/salesforce_omniscript_addrscripts.png)
3. After the parent scripts update, click **Done**.

## Conditionally Run Embedded Omniscripts

Using the Conditional View property in the parent Omniscript, you can run an embedded Omniscript only under certain conditions.

1. From the Properties section of the reusable Omniscript element of the parent Omniscript, expand **Conditional View**.
2. Click the **Show Element If True** link. The Edit Show Hide Rules window opens.
3. Create conditions as described in [Conditionally Display Omniscript Elements](https://help.salesforce.com/s/articleView?id=xcloud.os_conditionally_display_elements_using_the_conditional_view_property_19389.htm&release=264.0.0&type=5 "With the Conditional View property, you can hide an element or a group of elements in a block or step based on certain conditions. Every step, block, or element supports at least one conditional view. Elements contain up to three conditional view options depending on the type of element. For example, an action outside of a step doesn’t have a Read-Only option since the action isn’t visible.").
4. Click **Save**.

Elements in the embedded Omniscript run only if the conditions are true for those elements. If the conditions change while the embedded Omniscript is running, subsequent embedded Omniscript elements don't run. If the conditions are false for any embedded Omniscript elements, those elements are skipped.