Loading
Feature Disruption - Service Cloud VoiceRead More
Feature degradation | Gmail Email delivery failureRead More
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Conditionally Display Omniscript Elements

          Conditionally Display Omniscript Elements

          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.

          When you hide an element in an Omniscript, Omnistudio sets the contents of the element to null in the data JSON. Consider this behavior if your Omniscript references the hidden field. For example, suppose a Set Error element assesses whether a Text element is filled before proceeding to the next page. If the Text element is conditionally hidden, the Text element value is null, and the error is set.

          1. From an element's properties, expand Conditional View section.
          2. Select a Condition Type from the dropdown menu.

            Condition

            Description

            Show Element if True

            The element renders only if the conditional is true. If the conditional is false, the element is hidden from the UI.

            For blocks, this condition type is the only one available.

            Disable Read Only if True

            Disables Read Only on an element if the conditional is true. If the value is false, the element becomes Read Only.

            Set Element to Required if True

            The element becomes required if the condition is true.

            Note
            Note If a condition type isn't listed for an element, it isn't supported. Adding it using the JSON editor doesn't work.
          3. Choose the logical operator for the group (AND or OR). The AND operator requires that all conditions are met. The OR operator requires that at least one condition is met.
          4. Click Add Condition.
          5. In the left operand, enter the name of the element in plain text.
            Note
            Note

            If the element is repeatable, enter the name of the element followed by |n, where n is the nth repeated element. For example, if Age is repeated, Age|2 refers to the second instance of the repeated element.

          6. In the right operand, enter one of these syntax types:
            • If the element type is Text, enter the string in plain text.
            • If the element type is Checkbox or Disclosure, enter true or false.
            • If the element type is Number, enter a number.
            • If the element type is Select or Radio, type in the name of the option in plain text—for example, Yes or No.
            • If the element type is Multi-Select, enter a semicolon-separated string. For example, Ind | ; | Small.
            • If the element type is Date, Time, or Date/Time, enter a value in ISO format:
              • Date—2014-10-01T07:00:00.000Z (Wed Oct 01 2014 00:00:00 GMT-0700 (PDT)

              • Date/Time—1970-01-02T06:19:00.000Z (Tue Feb 17 2015 22:20:03 GMT-0800 (PST))

              • Time—2015-02-21T00:09:40.270Z (Thu Jan 01 1970 22:19:00 GMT-0800 (PST))

              • Date—2014-10-01T07:00:00.000Z (Wed Oct 01 2014 00:00:00 GMT-0700 (PDT)

              • Date/Time—1970-01-02T06:19:00.000Z (Tue Feb 17 2015 22:20:03 GMT-0800 (PST))

              • Time—2015-02-21T00:09:40.270Z (Thu Jan 01 1970 22:19:00 GMT-0800 (PST))

            • The right operand supports merge fields, for example Name = %contactLastName%.
          7. If you're using the designer on a managed package, click the Hide Conditional Elements checkbox to hide all of the conditional elements in the Omniscript. The conditional elements are marked with a yellow eye icon.

          Running Validation with onChange

          Omniscripts run validation when a user clicks out of a field by using the onBlur function.

          1. In the Setup properties, click Edit as JSON.
          2. Add the property "commitOnChange": true.
          3. Preview the behavior.
            Note
            Note

            In LWC Omniscripts, the onChange behavior runs after a half-second delay.

           
          Loading
          Salesforce Help | Article