Skip to main content

Manage JavaScript system columns

Calculated column procedure

Create a reusable calculated field on a system table, test it against collected data, and validate it before workflows depend on it.

Use a JavaScript system column when the same derived value should be available anywhere NIM uses that table. For deciding between a system-table column and a filter column, safe code patterns, and Vault queries, see Custom JavaScript columns.

Create a JavaScript system columnDirect link to Create a JavaScript system column

  1. Expand the system’s table list, open the relevant table, and select the Columns tab.
  2. Select Add.
  3. Enter a clear Column Name that describes the output, such as normalized_department.
  4. Enter the JavaScript calculation in the Code pane.
  5. Use the green-arrow control to insert a source-column variable at the cursor position when needed.
  6. Optionally use Insert a JavaScript Function to add supported hash functions, Vault queries, or variable queries.
  7. Select Test Script and check the result in Script Result Value.
  8. Select Save and Exit.

Work with column variablesDirect link to Work with column variables

NIM column variables use the format tableName['columnName']. For example:

return employees['employee_id'];

Use the insertion control when possible. It avoids a mismatch between the displayed column name and the value used in the script.

Test representative recordsTest a complete record and one with a blank or missing source value. Return a predictable fallback value rather than allowing an error to flow into filters, mappings, or jobs.

Validate the new columnDirect link to Validate the new column

  1. Collect and load the system.
  2. Inspect the table data to confirm the calculated values are present and formatted as expected.
  3. Test any filter, mapping, or name generator that will use the column before scheduling it.
warning

Changing a system JavaScript column changes its output everywhere the table is used. Check existing filters, mappings, and jobs before modifying a shared calculation.

Edit a JavaScript system columnDirect link to Edit a JavaScript system column

  1. Open the relevant system table and select the Columns tab.
  2. Select Edit Column for the calculated column.
  3. Update the name or code, then use Test Script before saving.
  4. Save the change, recollect the system, and validate all dependent workflows.

Remove a JavaScript system columnDirect link to Remove a JavaScript system column

  1. Review the filters, mappings, roles, and jobs that may reference the column.
  2. Open the relevant system table and select the Columns tab.
  3. Select Remove Column, confirm Yes, and save the table.
  4. Recollect the system and test dependent workflows.

Before you finishDirect link to Before you finish

  • Keep the original source columns available for troubleshooting.
  • Use a system-table calculation only when it is reusable and based on the table’s own data.
  • Keep business rules concise and document non-obvious defaults.
  • Use filter JavaScript columns for calculations that are specific to one filter or use data already combined in that filter.