Omniscript Best Practices (Managed Package)

For the managed package runtime, enhance the performance and usability of Omniscript by following the Omniscript best practices whenever possible.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

Business Process and Logic

Business Process and Logic best practices include:

  • Use unique names for Omniscript elements and Omnistudio Data Mapper response nodes.
  • Use one owner for each Omniscript.
  • Identify reusable elements by building a skeleton of the entire Omniscript.
  • Document the purpose of an element in the element's Internal Notes property.
  • Maintain Data Mappers and Apex classes by avoiding element name changes. If the element name must be updated, apply the name changes to the Data Mapper or Apex class.
  • Avoid assigning a ContextId within the Omniscript. Omniscript's ContextId is a reserved key that assigns a Record Id from the URL.
  • When processes are repeatable across multiple Omniscripts, create a reusable Omniscript, and add it to the appropriate parent Omniscripts.

User Interface

LWC Omniscripts use Lightning web components to define the styling for both individual elements and the Omniscript itself. Angular Omniscripts use templates to determine the look of the Omniscript.

Angular Omniscript UI best practices include:

  • Customize an Angular UI element by editing the template's CSS. Avoid changing the JavaScript and HTML whenever possible.
  • Store custom templates in a single location such as a static resource or in Vlocity Templates.
  • Apply global branding by using the Newport Design System.

LWC Omniscript UI best practices include:

  • Create custom Lightning web components that extend an Omniscript element's component to apply styling changes.
  • Apply global branding by using the Newport Design System.

Accessibility

Accessibility best practices include:

  • Currently, edit blocks configured in table mode in Omniscripts aren't compatible with screen readers. If you use a screen reader, we recommend that you use Flexcards instead of Omniscripts. In Flexcards, you can use data tables or Lightning datatables that are compatible with screen readers. See Show Data in a Table on a Flexcard and Lightning Web Component – Datatable.

User Experience Design Principles

UX design principles include:

  • Reduce the number of fields the user must input information into by prefilling the fields using contextual data.
  • Avoid confusing the user by breaking processes up into shorter steps that contain a minimal amount of elements.
  • Guide the user by creating contextual help text and logically ordering input fields.

Performance Factors

A set of best practices exists for both client-side and server-side performance.

Client-side best practices include:

  • Reduce Conditional Views, Merge Fields, Formulas where possible.
  • Speed up the application of responses by trimming the Response JSON.
  • Remove spaces from element names to improve the Omniscript's load time.
  • Minimize the number of elements in the script. A single Omniscript cannot exceed 750 elements, including embedded reusable Omniscripts. For example, if an Omniscript has 500 elements with embedded Omniscript references, such as a reusable Omniscript with 250 elements, then the Omniscript has reached the maximum of 750 elements.
  • Run logic on the server where possible, including conditional logic in Integration Procedures and formulas in Data Mappers.
  • Test performance by enabling time tracking. If time tracking is not used in production, disable the feature before deploying it to production.
  • PDFs larger than 250KB generate slowly. PDFs larger than 1MB can take several minutes to generate and sometimes time out.

Server-side best practices include:

  • Cut down the payload size of a request by trimming the JSON request.
  • Don't create Omniscripts with Lightning web components larger than 4 MB. In preview, Omniscripts that are larger than 4 MB show the error "Omniscript is either inactive or has not been deployed." Download the Omniscript LWC to check its size.
  • Reduce server roundtrips by using Integration Procedures whenever multiple actions run between steps. Run Integration Procedures asynchronously by enabling the fire-and-forget property.
  • Remove unnecessary data by trimming the Data Mapper extract output.