---
schema_version: "1"
id: 204ee3c2aed6d879ce03fd10c8780662a6f1af4f60123eec959ba2ee89c066c3
title: Set Data with Formulas and Functions (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_set_data_with_formulas_and_functions.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_set_data_with_formulas_and_functions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 441f1cd78ad1fee1414b92444107792b1f3f1d7f2f6e9cc1142a643a60ea4c8f
description: For the managed package runtime, generate dynamic values by evaluating data with Formulas and using functions to return specific values.
products:
  - Omnistudio
release: "264"
---
# 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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)
    
    Note
    
    There must be a space on either side of an operator for the operation to run correctly.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d257382e100">
                  <p style="margin-bottom:0;">Element Name</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d257382e106">
                  <p style="margin-bottom:0;">Example Value Formula Syntax</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Element Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d257382e100 ">
                  <p style="margin-bottom:0;">MergeValues</p>
                </td>

                <td data-label="Example Value Formula Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d257382e106 ">
                  <p style="margin-bottom:0;">= %GrossIncome% - %NetIncome%</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Element Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d257382e100 ">
                  <p style="margin-bottom:0;">MergeAndLiteralValues</p>
                </td>

                <td data-label="Example Value Formula Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d257382e106 ">
                  <p style="margin-bottom:0;">= %GrossIncome% - 5000</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Element Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d257382e100 ">
                  <p style="margin-bottom:0;">LiteralValues</p>
                </td>

                <td data-label="Example Value Formula Syntax" class="slds-cell-wrap" style="vertical-align:top;" headers="d257382e106 ">
                  <p style="margin-bottom:0;">= 2 - 2</p>
                </td>

              </tr>
            </tbody>
          </table>
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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/os_set_value_element_example_for_null_value.png)
    - 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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/os_set_values_example_null_expression.png)
7. Preview the Omniscript to ensure the operation performs correctly.

- **[Use a Formula Operator to Set Data with Formulas and Functions (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_formula_operator_set_data_with_formulas_and_functions_1.htm&release=264.0.0&type=5)**  
    For the managed package runtime, use a formula operator to generate dynamic values by evaluating data with Formulas and using functions to return specific values.