It seems you may be using English. Would you like to go to the international site? bika.ai
Guide
Basic
Automation Guide
Integration Guide
Open API
Template Guide
Cookbook
Reference
Automation Triggers
Automation Actions
Integrations
Node Resources
Database Views
Database Fields
Dashboard Widgets
Missions
Ai Wizard
Formula
Space
Release Notes
Videos
This function is a multi-branch selection function. It consists of an expression and multiple branches with return values. If the expression equals a branch value, the function outputs the corresponding return value.

【expression】is the expression whose result will be matched against each branch.
【pattern】is the branch, each representing a possible result of the expression. Each branch has a corresponding return value.
【result】is the return value. If the result of the expression matches a branch, the corresponding return value is output.
【default】is the default value. If the result does not match any branch, the function outputs the default value. If the default value is not provided, it returns an empty value.

For example, in the first example, {countries} references a column of data, and its output value could be thousands of country names. It is the expression in this function. "China" and "Chinese" are a branch and return value, respectively, indicating that if the output value of {countries} is "China", it returns "Chinese". "General English" is the default value, indicating that if the output value of {countries} does not match any branch, it returns "General English".

Switch

This function is a multi-branch selection function. It consists of an expression and multiple branches with return values. If the expression equals a branch value, the function outputs the corresponding return value. 【expression】is the expression whose result will be matched against each branch. 【pattern】is the branch, each representing a possible result of the expression. Each branch has a corresponding return value. 【result】is the return value. If the result of the expression matches a branch, the corresponding return value is output. 【default】is the default value. If the result does not match any branch, the function outputs the default value. If the default value is not provided, it returns an empty value. For example, in the first example, {countries} references a column of data, and its output value could be thousands of country names. It is the expression in this function. "China" and "Chinese" are a branch and return value, respectively, indicating that if the output value of {countries} is "China", it returns "Chinese". "General English" is the default value, indicating that if the output value of {countries} does not match any branch, it returns "General English".

Input formula

Select a field or function

Number

/assets/icons/formula/number.svg

Sum

/assets/icons/formula/number.svg

Average

/assets/icons/formula/number.svg

Max

/assets/icons/formula/number.svg

Min

/assets/icons/formula/number.svg

Round

/assets/icons/formula/number.svg

Round Up

/assets/icons/formula/number.svg

Round Down

/assets/icons/formula/number.svg

Ceiling

/assets/icons/formula/number.svg

Floor

/assets/icons/formula/number.svg

Even

/assets/icons/formula/number.svg

Odd

/assets/icons/formula/number.svg

Int

/assets/icons/formula/number.svg

Abs

/assets/icons/formula/number.svg

Sqrt

/assets/icons/formula/number.svg

Mod

/assets/icons/formula/number.svg

Power

/assets/icons/formula/number.svg

Exp

/assets/icons/formula/number.svg

Log

/assets/icons/formula/number.svg

Value

Text

/assets/icons/formula/text.svg

Concatenate

/assets/icons/formula/text.svg

Find

/assets/icons/formula/text.svg

Search

/assets/icons/formula/text.svg

Mid

/assets/icons/formula/text.svg

Replace

/assets/icons/formula/text.svg

Substitute

/assets/icons/formula/text.svg

Len

/assets/icons/formula/text.svg

Left

/assets/icons/formula/text.svg

Right

/assets/icons/formula/text.svg

Lower

/assets/icons/formula/text.svg

Upper

/assets/icons/formula/text.svg

Rept

/assets/icons/formula/text.svg

T

/assets/icons/formula/text.svg

Trim

/assets/icons/formula/text.svg

Encode URL Component

Logic

/assets/icons/formula/logic.svg

If

/assets/icons/formula/logic.svg

Switch

/assets/icons/formula/logic.svg

True

/assets/icons/formula/logic.svg

False

/assets/icons/formula/logic.svg

And

/assets/icons/formula/boolean.svg

Or

/assets/icons/formula/boolean.svg

Xor

/assets/icons/formula/boolean.svg

Blank

/assets/icons/formula/boolean.svg

Error

/assets/icons/formula/boolean.svg

Is Error

/assets/icons/formula/boolean.svg

Not

Date

/assets/icons/formula/date.svg

Today

/assets/icons/formula/date.svg

Now

/assets/icons/formula/date.svg

To Now

/assets/icons/formula/date.svg

From Now

/assets/icons/formula/date.svg

Date Add

/assets/icons/formula/date.svg

Datetime Diff

/assets/icons/formula/date.svg

Workday

/assets/icons/formula/number.svg

Workday Diff

/assets/icons/formula/boolean.svg

Is After

/assets/icons/formula/boolean.svg

Is Before

/assets/icons/formula/boolean.svg

Is Same

/assets/icons/formula/text.svg

Datetime Format

/assets/icons/formula/date.svg

Datetime Parse

/assets/icons/formula/text.svg

Datestr

/assets/icons/formula/text.svg

Timestr

/assets/icons/formula/number.svg

Year

/assets/icons/formula/number.svg

Month

/assets/icons/formula/number.svg

Weekday

/assets/icons/formula/number.svg

Weeknum

/assets/icons/formula/number.svg

Day

/assets/icons/formula/number.svg

Hour

/assets/icons/formula/number.svg

Minute

/assets/icons/formula/number.svg

Second

/assets/icons/formula/date.svg

Set Locale

/assets/icons/formula/date.svg

Set Timezone

/assets/icons/formula/date.svg

Created Time

/assets/icons/formula/date.svg

Last Modified Time

Array

/assets/icons/formula/array.svg

Array Compact

/assets/icons/formula/array.svg

Array Unique

/assets/icons/formula/array.svg

Array Join

/assets/icons/formula/array.svg

Array Flatten

/assets/icons/formula/array.svg

Count

/assets/icons/formula/array.svg

CountA

/assets/icons/formula/array.svg

CountIf

/assets/icons/formula/array.svg

CountAll

Object

/assets/icons/formula/array.svg

Record ID

SWITCH

This function is a multi-branch selection function. It consists of an expression and multiple branches with return values. If the expression equals a branch value, the function outputs the corresponding return value. 【expression】is the expression whose result will be matched against each branch. 【pattern】is the branch, each representing a possible result of the expression. Each branch has a corresponding return value. 【result】is the return value. If the result of the expression matches a branch, the corresponding return value is output. 【default】is the default value. If the result does not match any branch, the function outputs the default value. If the default value is not provided, it returns an empty value. For example, in the first example, {countries} references a column of data, and its output value could be thousands of country names. It is the expression in this function. "China" and "Chinese" are a branch and return value, respectively, indicating that if the output value of {countries} is "China", it returns "Chinese". "General English" is the default value, indicating that if the output value of {countries} does not match any branch, it returns "General English".

Usage

SWITCH(expression, value1, result1, [value2, result2, ...], default)

Example

SWITCH(1, 1, "one", 2, "two", "many") =>one
bika cta

Recommend Reading