Formulas

Formula fields in Seal enable you to perform calculations across an entity's fields.

Use the @ symbol in the formula input to see the fields and properties (eg. CREATED_BY) available to use in the formula expression.

Formula expressions can include the following fields:

  • Number

  • Text

  • Select

  • Time & date

  • Reference

  • Checkbox

  • Formula

What can I compute with formula fields?

Seal's formula fields cover a wide range of functionality, from simple calculations to complex computing.

The underlying library handling the calculations is Math.js. See the table below for examples of common operators and how to use them in your formulas.

For a full list, please refer to the Math.js library, or speak to our team.

Formula Language
Data type
Description

+ / *

Number

Addition, subtraction, division, multiplication

==

Number

Equal to

!=

Number

Not equal to

concat( @number, @field) E.g. concat( string( @quantity), string( @unit) )

Mixed

Concatenate multiple fields in a formula expression. Convert the field to a string using string() if the field types are different.

lookup( @referenceField , "Field name") lookup( @referenceField , "Property")

Entity

Looking up a field in another entity via a reference field. Note that the field name you want to look up must be in quotation marks, e.g. "String".

You can look up a multi-value field via a single-value reference — all values will be displayed.

dateAdd( @dateField, number, "unit") E.g. dateAdd( @dateField, 2, "years")

Date

Function to add time periods to date fields. Supported units: 'days', 'months', 'years'

convertToDatetimeField( @datetimeField) E.g. convertToDatetimeField(@datetimeField1 - @datetimeField2)

Time & date

Function to convert a unix timestamp to a Time & date field.

formatDatetime(@datetimeField, "format string", "timezone")

E.g.

formatDatetime(@datetimeField, "yyyy-MM-dd HH:mm", "America/New_York")

OR formatDatetime(@dateField, "format string") E.g. formatDatetime(@dateField, "MM-dd-yyyy")

Time & date/Date

Function to format a Time & date or Date field into a string.

Date fields do not have the additional timezone section whereas Time & date fields must have it.

The format string must adhere to the rules set out in adjusting format

Refer to the Timezone supportsection for more information about the timezone string.

? E.g. (@Field > 3 ? "Large" : "Small"

Mixed

if statements (conditional logic)

Formulas calculate in real time, so you can instantly verify the expression returns your desired result.

Error messages are show in red text in the formula preview box.

Warning messages are shown in yellow below the preview box.

Timezone support

Our platform provides flexible timezone handling by supporting three types of identifiers:

  • IANA names

  • Timezone abbreviations

  • Fixed-offset Etc/GMT codes

IANA Timezone Names

Using a standard IANA name pins a location to a specific region, the platform will automatically handle changes for Daylight Saving Time, so timestamps are always correct for that location throughout the year.

For a complete list, you can visit this comprehensive list of tz database time zones.

Common Timezone Codes

Here is a reference list of some commonly used IANA timezone names

IANA Timezone Name
UTC Offset (Standard)
UTC Offset (Daylight Savings)

Pacific/Honolulu

-10:00

-10:00

America/Anchorage

-09:00

-08:00

America/Los_Angeles

-08:00

-07:00

America/Vancouver

-08:00

-07:00

America/Denver

-07:00

-06:00

America/Edmonton

-07:00

-06:00

America/Phoenix

-07:00

-07:00

America/Chicago

-06:00

-05:00

America/Regina

-06:00

-06:00

America/Winnipeg

-06:00

-05:00

America/Halifax

-04:00

-03:00

America/St_Johns

-03:30

-02:30

America/Fortaleza

-03:00

-03:00

Europe/London

+00:00

+01:00

Africa/Lagos

+01:00

+01:00

Europe/Brussels

+01:00

+02:00

Europe/Athens

+02:00

+03:00

Asia/Istanbul

+03:00

+03:00

Asia/Dubai

+04:00

+04:00

Asia/Kolkata

+05:30

+05:30

Asia/Bangkok

+07:00

+07:00

Asia/Manila

+08:00

+08:00

Asia/Shanghai

+08:00

+08:00

Asia/Singapore

+08:00

+08:00

Asia/Seoul

+09:00

+09:00

Fixed UTC Offset Timezones

If you require a timezone with a static UTC offset that does not change during the year, you can use either a timezone abbreviation or an Etc/GMT code.

Common Timezone Abbreviations
Abbreviation
Name
UTC Offset

SST

Samoa Standard Time

-11:00

HST

Hawaii Standard Time

-10:00

AKST

Alaska Standard Time

-09:00

HDT

Hawaii Daylight Time

-09:00

AKDT

Alaska Daylight Time

-08:00

MST

Mountain Standard Time

-07:00

PDT

Pacific Daylight Time

-07:00

CST

Central Standard Time

-06:00

MDT

Mountain Daylight Time

-06:00

CDT

Central Daylight Time

-05:00

EST

Eastern Standard Time

-05:00

AST

Atlantic Standard Time

-04:00

EDT

Eastern Daylight Time

-04:00

NST

Newfoundland Standard Time

-03:30

ADT

Atlantic Daylight Time

-03:00

NDT

Newfoundland Daylight Time

-02:30

GMT

Greenwich Mean Time

+00:00

UTC

Coordinated Universal Time

+00:00

WET

Western European Time

+00:00

BST

British Summer Time

+01:00

CET

Central European Time

+01:00

IST

Irish Standard Time

+01:00

WAT

West Africa Time

+01:00

WEST

Western European Summer Time

+01:00

CAT

Central Africa Time

+02:00

CEST

Central European Summer Time

+02:00

EET

Eastern European Time

+02:00

SAST

South Africa Standard Time

+02:00

EAT

East Africa Time

+03:00

EEST

Eastern European Summer Time

+03:00

IDT

Israel Daylight Time

+03:00

PKT

Pakistan Standard Time

+05:00

WIB

Western Indonesian Time

+07:00

AWST

Australian Western Standard Time

+08:00

HKT

Hong Kong Time

+08:00

PST

Philippine Standard Time

+08:00

WITA

Central Indonesian Time

+08:00

JST

Japan Standard Time

+09:00

KST

Korea Standard Time

+09:00

WIT

Eastern Indonesian Time

+09:00

ACST

Australian Central Standard Time

+09:30

AEST

Australian Eastern Standard Time

+10:00

ChST

Chamorro Standard Time

+10:00

ACDT

Australian Central Daylight Time

+10:30

AEDT

Australian Eastern Daylight Time

+11:00

NZST

New Zealand Standard Time

+12:00

NZDT

New Zealand Daylight Time

13:00

The Etc/GMT format is a more explicit way to define a fixed offset.

Important Note: The Etc/GMT notation uses a POSIX-style sign, which is the reverse of what is commonly expected.

  • Etc/GMT-X corresponds to UTC+X. For example, Etc/GMT-10 is 10 hours ahead of UTC.

  • Etc/GMT+X corresponds to UTC-X. For example, Etc/GMT+5 is 5 hours behind UTC.

Last updated