Skip to main content

NIM

Vault queries

When you create Custom JavaScript columns, you can check if an object exists in the Vault using the custom JavaScript function vaultObjectExists(system,table,key).

This function checks if the keyed column in the given system and table contains a row that matches the specified key. It returns a Boolean value. See Keys.

In the below example, the employee_id column in the employees table of a File system using the HR500 test dataset has been assigned as the table's primary key. The following code checks if the column contains a row with an employee_id of 10023963. The row is found, so the function returns true.

return vaultObjectExists('hr500','employees','10023963');
2021-06-25_13-17-39.png

This function is particularly useful to perform operations in Filters that would otherwise be difficult or impossible. For example, when provisioning users into an Active Directory system, you may want to create users in a specific OU if it exists, but fall back to a default OU if not. You can use this function to generate a column that tests the existence of certain OUs, and subsequently, use that column in your filter logic.

Currently, it is not possible to retrieve objects from the vault. It is only possible to check if objects exist.

Note

Additionally, this function lets you query other systems in your filters without creating Inter-system relations.

However, this is a last resort. Only use a vault query when creating an inter-system relation is impractical or impossible. Too many vault queries can lead to a "spaghetti" configuration that is difficult to maintain.