Syntax
DEFAULT(value, fallback1, fallback2, ...)
Usage examples
Example 1
Input | 1 { 2 "my_action": { 3 "message": [] 4 } 5 } |
Formula | DEFAULT(my_action.message, "fallback") |
Output | "fallback" |
Example 2
Input | 1 { 2 "my_action": { 3 "message": [ 4 1 5 ] 6 } 7 } |
Formula | DEFAULT(my_action.message, "fallback") |
Output | 1 [ 2 1 3 ] |
Example 3
Input | 1 { 2 "my_action": { 3 "message": "" 4 } 5 } |
Formula | DEFAULT(my_action.message, "fallback") |
Output | "fallback" |
Example 4
Input | 1 { 2 "my_action": { 3 "message": "hello world" 4 } 5 } |
Formula | DEFAULT(my_action.message, "fallback") |
Output | "hello world" |
Example 5
Input | 1 { 2 "my_action": { 3 "message": "hello world" 4 } 5 } |
Formula | DEFAULT(my_action.does_not_exist, "fallback") |
Output | "fallback" |
Example 6
Input | 1 { 2 "my_action": { 3 "message": false 4 } 5 } |
Formula | DEFAULT(my_action.message, "fallback") |
Output | "fallback" |
Example 7
Input | 1 { 2 "my_action": { 3 "message": [], 4 "fallback": "" 5 } 6 } |
Formula | DEFAULT(my_action.message, my_action.fallback, "fallback") |
Output | "fallback" |