Document toolboxDocument toolbox

ensureTableHasColumns

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

  1. Click + on the parent node.

  2. Enter Ensure Table has Columns operator in the search field and select the operator from the Results to open the operator form.

  3. In the Table drop-down, enter or select the table containing the data to run this operator on.

  4. In the Default Columns field, enter a comma-separated string of default field names.

  5. Click Run to view the result.

  6. Click Save to add the operator to the playbook.

  7. 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