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
Sum
Average
Max
Min
Round
Round Up
Round Down
Ceiling
Floor
Even
Odd
Int
Abs
Sqrt
Mod
Power
Exp
Log
Value
Text
Concatenate
Find
Search
Mid
Replace
Substitute
Len
Left
Right
Lower
Upper
Rept
T
Trim
Encode URL Component
Logic
If
Switch
True
False
And
Or
Xor
Blank
Error
Is Error
Not
Date
Today
Now
To Now
From Now
Date Add
Datetime Diff
Workday
Workday Diff
Is After
Is Before
Is Same
Datetime Format
Datetime Parse
Datestr
Timestr
Year
Month
Weekday
Weeknum
Day
Hour
Minute
Second
Set Locale
Set Timezone
Created Time
Last Modified Time
Array
Array Compact
Array Unique
Array Join
Array Flatten
Count
CountA
CountIf
CountAll
Object
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

Recommend Reading
- Data Automation with Bika.ai: Unlocking New Potential for Feishu Scheduled Notifications in Sending daily stand-up notifications
- AI Batch Image Recognition: Airtable Alternative to Integrate with design tools
- Revolutionize Video Quality Enhancement with Bika.ai's AI Automation
- AI Data Automation with Bika.ai: Unlocking New Potential for Project Manager with Design project pipeline
- Airtable Alternative for Quantitative Analyst: Automated Stock Data Retrieval (JavaScript)