For the managed package runtime, 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.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
Note 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.
Note 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.
- In the Omniscript you want to reuse, click Setup, and check the Reusable checkbox.
- Activate the reusable Omniscript.
- Navigate to the Omniscript that will host the reusable Omniscript.
- In your Omniscript's Build panel, expand the Omniscripts section.
- Locate the reusable Omniscript and drag it into the canvas.
- Preview your Omniscript to test the behavior.
What’s next: Activate and Deactivate Embedded Omniscripts (Managed Package).
- Embedding a Reusable Omniscript (Managed Package)
For the managed package runtime, you can embed active reusable Omniscripts in other Omniscripts. For example, if you have an Omniscript that updates a case, you might want to add that reusable script component at the end of an Omniscript form used for troubleshooting. - Activate and Deactivate Embedded Omniscripts (Managed Package)
For the managed package runtime, when you activate or deactivate an embedded script, Vlocity updates all activated parent scripts to reflect the change. - Conditionally Run Embedded Omniscripts (Managed Package)
For the managed package runtime, using the Conditional View property in the parent Omniscript, you can run an embedded Omniscript only under certain conditions.