feat(core): Expression function $ifEmpty (#7660)

Github issue / Community forum post (link here to close automatically):

---------

Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
Michael Kret
2023-11-13 13:28:41 +02:00
committed by GitHub
parent 14035e1244
commit 1c7225ebdb
7 changed files with 54 additions and 3 deletions

View File

@@ -328,6 +328,7 @@ export class I18nClass {
rootVars: Record<string, string | undefined> = {
$binary: this.baseText('codeNodeEditor.completer.binary'),
$execution: this.baseText('codeNodeEditor.completer.$execution'),
$ifEmpty: this.baseText('codeNodeEditor.completer.$ifEmpty'),
$input: this.baseText('codeNodeEditor.completer.$input'),
$jmespath: this.baseText('codeNodeEditor.completer.$jmespath'),
$json: this.baseText('codeNodeEditor.completer.json'),

View File

@@ -168,6 +168,7 @@
"codeNodeEditor.completer.$execution.customData.get()": "Get custom data set in the current execution. <a href=\"https://docs.n8n.io/workflows/executions/custom-executions-data/\" target=\"_blank\">Learn More</a>",
"codeNodeEditor.completer.$execution.customData.setAll()": "Set multiple custom data key/value pairs with an object for the current execution. <a href=\"https://docs.n8n.io/workflows/executions/custom-executions-data/\" target=\"_blank\">Learn More</a>",
"codeNodeEditor.completer.$execution.customData.getAll()": "Get all custom data for the current execution. <a href=\"https://docs.n8n.io/workflows/executions/custom-executions-data/\" target=\"_blank\">Learn More</a>",
"codeNodeEditor.completer.$ifEmpty": "Checks whether the first parameter is empty, and if so returns the second parameter. Otherwise returns the first parameter. The following count as empty: null/undefined values, empty strings, empty arrays, objects with no keys.",
"codeNodeEditor.completer.$input": "This nodes input data",
"codeNodeEditor.completer.$input.all": "@:_reusableBaseText.codeNodeEditor.completer.all",
"codeNodeEditor.completer.$input.first": "@:_reusableBaseText.codeNodeEditor.completer.first",