---
schema_version: "1"
id: 63d52d76e5a8cb4c377e2453fc0091ad490914c6babd240980d3483cb842653a
title: Create Formula Fields in an Omniscript (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_create_formula_fields_in_an_omniscript.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_create_formula_fields_in_an_omniscript.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e0b3dd67842c23fbb05d1937882a13513d4b0d04cd4b00970f10e9b20a9fb46d
description: For the managed package runtime, create expressions to set calculated values and evaluate data across multiple fields using a Formula or Aggregate element. For example, if you are accepting information for a qualifying life event you may want to create a formula that determines if the date entered for the qualifying life event is within thirty days of today's date.
products:
  - Omnistudio
release: "264"
---
# Create Formula Fields in an Omniscript (Managed Package)

For the managed package runtime, create expressions to set calculated values and evaluate data across multiple fields using a Formula or Aggregate element. For example, if you are accepting information for a qualifying life event you may want to create a formula that determines if the date entered for the qualifying life event is within thirty days of today's date.

![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).

For a list of available functions, see [Omniscript Functions (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_omniscript_functions.htm&release=264.0.0&type=5 "For the managed package runtime, you can add functions to the Aggregate and Formula elements in Omniscripts.").

Formula and Aggregate elements support the following constants and types:

- Omniscript elements and JSON nodes, passed in as merge fields—for example, %Element1% or %JSONnode1%
- Numbers and integers—for example, 5 + 3.145
- String literals wrapped in quotes—for example, ' "ABC" + "DEF" '
- Booleans—for example, true || false
- Arrays—for example, "\[1,2, 3, 4, 5\]"
- Dates—for example, 2/3/24
    
    Formulas with a **Data Type** of Date are interpreted according to the **Date Format**, using the [Day.js](https://opencollective.com/dayjs) library. To prevent a date from being interpreted, set the **Data Type** to Text.
- Null

- **[Supported Formula Operators (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_supported_formula_operators.htm&release=264.0.0&type=5)**  
    For the managed package runtime, formula fields in Omniscript support the following operators:
- **[Omniscript Functions (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_omniscript_functions.htm&release=264.0.0&type=5)**  
    For the managed package runtime, you can add functions to the Aggregate and Formula elements in Omniscripts.
- **[Create a Formula or Aggregate in an Omniscript (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_create_a_formula_or_aggregate_in_an_omniscript.htm&release=264.0.0&type=5)**  
    For the managed package runtime, run functions against element data with the Formula and Aggregate elements.