Using Custom Variables and Expressions in OMR [Information]

Last updated: October 12, 2026

Order Management Rules (OMR) let you reference specific data points when you define Conditions or Actions. In supported editors, standard fields and registered Location Custom Fields can be selected directly from Field. Use Custom Expressions when you need raw Host System data, an unregistered custom-field reference, a temporary variable, or another advanced reference that is not available for direct selection.

This article explains the structure, syntax, and compatibility of the data objects you can reference in OMR and clarifies when you should select a field directly instead of using Use Expression.

Before proceeding, review 📄 What's New in Order Management Rules (OMR) for Rule Sets in techSHIP [Guide] to understand the Rule Set workflow and Action editor.

Choosing Between Direct Fields and Expressions

When you configure a Condition or Action, check Field before creating an expression. Registered Location Custom Fields can appear directly in the selector, so you do not need to enter raw syntax for them.

Check Field first. If the standard field or registered Location Custom Field you need appears in Field, the recommended workflow is to select it directly.

To use the Expression feature within a Condition, follow the steps below. If configuring an Action, ensure you are using a Set Value context:

  1. Check Use Expression.

Use Expression only when needed. Enable Use Expression when you need an unregistered custom-field reference, raw Host System data, an advanced calculation or unsupported direct reference, or an existing legacy rule that already uses raw syntax.

  1. Enter the required reference in Expression.

Then complete the Condition or Action using the remaining controls, and then add or save the step as applicable.

Add to and Subtract from use supported fields selected directly from Field. An unregistered raw custom-field reference does not become a valid arithmetic target by enabling Use Expression.

Your Condition or Action now references the intended data source through either direct field selection or an expression. Next, review the data source classifications and compatibility information below before saving the parent rule.

For functions that process expression values, refer to 📄 Order Management Rules (OMR) Available Functions (Expressions) [Information].

Data Source Classifications

Before writing an expression, identify the source of the value you need. OMR references fall into the following practical classifications:

  • Native Objects: Standard, processed techSHIP data structures such as Order, Package, and Line.

  • Host System Raw Data: Data received from your Host System that is not exposed as a standard techSHIP field.

  • User-Defined Data: Values created or managed through rule execution or Location configuration, including Virtual Variables and Location Custom Fields. When a registered Location Custom Field is available in Field, select it directly instead of authoring a raw reference.

Native Objects in techSHIP

Native Objects represent standard entities available in techSHIP:

  • Order: The main shipment record containing billing, shipping, and Carrier information.

  • Package: Attributes associated with an individual box within the shipment.

  • Line: Specific SKU or Item information within the Order or Package context.

The Line object is supported only for the Actions and contexts where Line-level data is available.

Use standard dot notation to reference the source and field name.

Action

Condition

Definition

{Source.FieldName}

@([Source.FieldName])

Example

{Order.ShipToName}

@([Order.ShipToName])

Use the corresponding field dictionary when you need to identify an available native property:

Custom Objects

Use Custom Objects when you need values outside the standard techSHIP object model, including temporary rule variables, raw Host System data, and Location-specific custom-field references.

Virtual Variables (virtual)

Virtual Variables are temporary placeholders that let you store values during rule execution. They are not persisted as business data unless you later map their value to an appropriate field.

Scope

Action

Condition

Order

virtual:VariableName

@([CustomFields.VariableName])

Package

virtual:VariableName

@([PackageCustomFields.VariableName])

Line

virtual:VariableName

@([LineCustomFields.VariableName])

Examples of virtual references include:

Scope

Action

Condition

Order

virtual:Score

@([CustomFields.Score])

Package

virtual:MaxType

@([PackageCustomFields.MaxType])

Line

virtual:IsFixed

@([LineCustomFields.IsFixed])

Host System Raw Data (WmsData)

Use WmsData when you need to read Order-level data exactly as it was provided by your Host System, and use LineWmsData for the corresponding Line-level data.

Raw data availability depends on the connection type and the payload provided by your Host System. A field can become unavailable if the integration or incoming data changes.

Scope

Condition

Definition

Order

@([WmsData.RawFieldName])

Definition

Line

@([LineWmsData.RawFieldName])

Example

Order

@([WmsData.WMSCustomField1])

Example

Line

@([LineWmsData.WMSLineCustomField1])

Location Custom Fields (customfields)

If you need to create, edit, type, or understand the scope of a Location Custom Field, refer to 📄 Managing Location Custom Fields [Guide] before using the advanced references in this section.

When a registered Location Custom Field is available in a supported editor, select it directly from Field. The selector uses the field's friendly Display Name, while the saved rule reference uses its underlying Code.

For example, you may see customfields:Packing Materials in Field, while the stored reference resolves to a Code-based reference such as customfields:Materials.

Use the raw customfields:Code format only when you need the advanced or backward-compatible assignment path, such as an existing unregistered custom-field reference. The colon in customfields:Code is the canonical separator.

Purpose

Reference

Registered Location Custom Field

Select the field directly from Field

Advanced or legacy assignment reference

customfields:Code

Order raw-data read

@([WmsData.Code])

Line raw-data read

@([LineWmsData.Code])

Existing legacy references remain compatible. If an existing reference matches a registered Code, the editor can reopen it as the selected registered field. If the reference is still unregistered, it remains available through the existing Use Expression or raw-reference assignment path.

For ordinary Conditions on a registered Location Custom Field, select the field directly from Field, especially when the value may have been updated earlier in the same rule flow. A raw WmsData expression can follow different snapshot behavior.

Do not treat similarly named expression stores as interchangeable with Location Custom Fields:

  • WmsData reads Order-level additional Host System data.

  • LineWmsData reads Line-level additional data.

  • CustomFields, PackageCustomFields, and LineCustomFields are used by Virtual Variables and are distinct from registered Location Custom Fields.

  • Add to and Subtract from require supported direct numeric targets; an unregistered customfields:Code raw reference is not a valid substitute for a registered numeric field.

Syntax and Compatibility Matrix

Not every raw reference or expression object is available in every OMR editor. Use the following tables to identify the supported advanced syntax for each context.

Registered Location Custom Fields are intentionally not treated as raw syntax in these tables. When a registered field appears in Field, select it directly; use customfields:Code only for the applicable advanced or backward-compatible assignment path.

Expression syntax and capitalization must match the expected reference. Incorrect syntax can cause a rule to fail or a Condition to evaluate as false.

Rule Sets

For Rule Sets, use the following advanced-reference syntax where the corresponding object is supported.

Data Source

Scope

Action

Condition

techSHIP Object

Order

{Order.FieldName}

@([Order.FieldName])

techSHIP Object

Package

{Package.FieldName}

@([Shipment.FieldName])

techSHIP Object

Line

{Line.FieldName}

@([FieldName])

Location Custom Field — raw/legacy assignment

Order

customfields:Code

customfields:Code

Location Custom Field — raw/legacy assignment

Package

N/A

N/A

Location Custom Field — raw/legacy assignment

Line

customfields:Code

customfields:Code

Host System Raw Data

Order

customfields:FieldName

@([WmsData.FieldName])

Host System Raw Data

Package

N/A

N/A

Host System Raw Data

Line

customfields:FieldName

@([LineWmsData.FieldName])

Virtual Variable

Order

virtual:FieldName

@([CustomFields.FieldName])

Virtual Variable

Package

virtual:FieldName

@([PackageCustomFields.FieldName])

Virtual Variable

Line

virtual:FieldName

@([LineCustomFields.FieldName])

An N/A entry for raw syntax does not mean that every registered Location Custom Field is unavailable at that level. If the field is offered in Field, use the direct selector instead of attempting to reproduce it with raw syntax.

Clients and Client Templates

For Clients and Client Templates, preserve the supported raw-reference behavior below while preferring direct field selection whenever a registered Location Custom Field is offered.

Data Source

Scope

Action

Condition

techSHIP Object

Order

{Order.FieldName}

@([Order.FieldName])

techSHIP Object

Package

N/A

@([Shipment.FieldName])

techSHIP Object

Line

{Line.FieldName}

@([FieldName])

Location Custom Field — raw/legacy assignment

Order

customfields:Code

customfields:Code

Location Custom Field — raw/legacy assignment

Package

N/A

—

Location Custom Field — raw/legacy assignment

Line

customfields:Code

customfields:Code

Host System Raw Data

Order

customfields:FieldName

@([WmsData.FieldName])

Host System Raw Data

Package

N/A

N/A

Host System Raw Data

Line

customfields:FieldName

@([LineWmsData.FieldName])

Virtual Variable

Order

virtual:FieldName

@([CustomFields.FieldName])

Virtual Variable

Package

N/A

N/A

Virtual Variable

Line

virtual:FieldName

@([LineCustomFields.FieldName])

The new Rule Set Add to and Subtract from operations do not make unregistered raw custom-field references valid arithmetic targets in Client or Client Template OMRs.

Markup Profiles

For Markup Profiles, use expressions only for supported Condition sources. When a registered Location Custom Field is exposed directly in Field, select it there instead of replacing it with a raw expression.

Data Source

Scope

Condition

techSHIP Object

Order

@([Order.FieldName])

techSHIP Object

Package

N/A

techSHIP Object

Line

N/A

Host System Raw Data

Order

@([WmsData.FieldName])

Host System Raw Data

Package

N/A

Host System Raw Data

Line

N/A

Virtual Variable

Order

N/A

Virtual Variable

Package

N/A

Virtual Variable

Line

N/A

Use direct field selection whenever the value you need is registered and available in Field. Reserve Use Expression for raw, unregistered, advanced, or backward-compatible references that cannot be selected directly.