Set Data with Formulas and Functions (Managed Package)

For the managed package runtime, generate dynamic values by evaluating data with Formulas and using functions to return specific values.

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

  1. Add a Set Values action to the Omniscript.
  2. In the Set Values Properties, click Add New Element Value.
  3. In the Element Value Map, in the Element Name field, enter the new JSON node name.
  4. To put a formula in the Value field, check Use Expression For Value to open the formula editor.
  5. Add static values, or dynamic values using merge fields, and add an operator.
    Note
    Note

    There must be a space on either side of an operator for the operation to run correctly.

    Element Name

    Example Value Formula Syntax

    MergeValues

    = %GrossIncome% - %NetIncome%

    MergeAndLiteralValues

    = %GrossIncome% - 5000

    LiteralValues

    = 2 - 2

  6. To assign a null value in JSON or to check for null values in a data field, use $Vlocity.NULL. Use $Vlocity.NULL in these scenarios:
    • Unset a field value: To remove a value in a field by setting it to null. Use $Vlocity.NULL to make sure that the value is explicitly recognized as null by the system. For example:
      Set null value for an element
    • Conditionally check for null: Use $Vlocity.NULL in formulas to detect when a field is null. You can then trigger certain actions accordingly. For example:
      Set values with a condition to check for null value
  7. Preview the Omniscript to ensure the operation performs correctly.