Ensure that the playbook output always includes the specified columns. Any additional columns in the input table are also presented in the output.
Operator Usage in Easy Mode
- Click + on the parent node.
- Enter Ensure Table has Columns operator in the search field and select the operator from the Results to open the operator form.
- In the Table drop-down, enter or select the table containing the data to run this operator on.
- In the Default Columns field, enter a comma-separated string of default field names.
- Click Run to view the result.
- Click Save to add the operator to the playbook.
- Click Cancel to discard the operator form.
Usage Details
LQL Command
ensureTableHasColumns(table, fieldnames)
Input
table
: Name of the table.
fieldnames
: Comma-separated list of fieldnames, such as "f1", f2", f3", and "f4".
Output
Produces fields that are provided in the fieldnames
argument. If the fields in the fieldnames
argument are present in the table this operator will output those columns. If the fields are not present, the operator will create empty columns with the fieldnames.
Example
Assume the input table has columns f1, and f2.
LQL
ensureTableHasColumns(table, "f1, f2, f3") -- adds f3 empty column ensureTableHasColumns(table, "f1, f2, f3, f4") -- adds f3, f4 empty columns