Add a Condition Trigger

This feature is available only in Enterprise Edition.

To add scripted logic to the VPM row condition, follow the steps below:

  1. If necessary, create a VPM as explained in Create a New VPM.

  2. Select the Conditions tab at the bottom.

    dataModel77

  3. Select the Trigger sub-tab.

    dataModel78

  4. Enter the desired trigger script in the text box at the bottom. The trigger script should use standard JavaScript syntax, and should return the modified list of conditions (e.g., in string condition, in the last statement of the script).

    Example 1. Condition trigger script
    if(condition.length > 0) {
      condition += " and ";
    }
    condition += "sa.customers.state = 'CA'";
    condition;

    The following parameters are available for use in the script:

    Condition Trigger Script Parameters
    user

    The current user name

    roles

    Array of roles associated with this user

    groups

    Array of groups associated with this user

    parameter

    Dashboard or Worksheet parameters

    tables

    List of tables in the query

    columns

    Array of columns included in the query

    condition

    String containing the condition defined on the Conditions sub-tab in the VPM

  5. Press the ‘Save’ button save to save the VPM.