Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Applying Rules

You can set visibility or validation rules for page header actions, page tabs, sections within a detail page, and fields. Access the rule engine from the Page Listing, Object Layout Listing, or directly from other applications like CLM that support Conga Advantage Platform. This section explains how to add rules to actions, sections of the record detail page, fields of the record detail page, and tabs.

Behavior

  • You can save a record without entering a value for a mandatory field if the field is hidden due to visibility rules applied to the field, section, or tab where it is located.

  • When a page-level validation message is used, it does not stop you from saving the record. The message may appear again after you click Save, because the data is refreshed and the rules are re-evaluated. To prevent users from saving until required data is entered, use a field-level validation message instead. For example, If the Currency field is left blank, a page-level message appears when you click Save. Since page-level messages do not block the save action, the message appears again after the data refreshes.

Example: Configure validation rules for contracts such as:

  • If a user enters a currency value, they must select a currency type, or the system displays an error message.
  • For contracts with the "MSA" agreement type, display the "Additional Information" section.
  • If the contract number is not provided, display an error message in the contract number field.
  • Display or hide actions and custom actions on the UI based on defined rule criteria.

Adding a Rule

You need Edit permission to edit layouts. For more, see Managing Roles and Permission Groups.
  1. Log in to the Conga Advantage Platform as an admin user.
  2. Click the App Launcher () icon in the top-left corner, then Apps > CX Studio.
  3. You can access the rule engine in the following ways:
    • While updating a Wizard layout: Wizard Layouts, click the More () icon, then Edit.
    • While updating an object layout: Object Layouts, click the More icon, then Edit.
    • Editing a page from RLP or a supported application (e.g., CLM): Open the page and click the Edit Page button in the top right corner.
    The properties pop-up appears with two tabs: Details and Rules.
  4. To add a rule to an action, click the PageHeader pane. To add a rule to a section or field of the record detail page, click the Record Detail View pane. If there are multiple tabs on the detail page, select the tab you want, and then select the section or field.
  5. Go to Properties window and click the Rules tab.
  6. Click Add Rule. The New Rule window lets you define rule conditions and actions using JSON format.
    Note:

    You can either define the rule's conditions and actions in JSON or leave these fields blank, save the rule, and define the criteria using the Advanced Rule Editor UI later.



    Field

    Description

    Name

    Enter the rule's name.

    Description

    Enter a description for the rule you want to define.

    Rule Condition JSON and Rule Action JSON

    Insert the rule condition and action criteria in JSON format.

    Rule Condition JSON

    Rule Action JSON

    Example: Adding a rule to the page header button

    To restrict access to the "customcode" button to administrators, add the following rule condition and action criteria in JSON format:

    {
      "criteria": [
        {
          "componentId": "cos-page-header",
          "validation": {
            "condition": "CustomCondition",
            "validationFunc": "function (payload) {\n  const userRole = payload.userInfo?.Role;\n return (userRole?.Name ?? '') === 'Admin';\n}"
          }
        }
      ],
      "logicalExpression": ""
    }
    {
      "valid": [
        {
          "ruleFunc": "function (payload) {\nconst props = {};\nprops.items =        \tpayload.element.actionBar.actions.map(\n(item) => {\nif (item.key === 'customcode') {\n                item.hidden = true;\n}\n return item;\n}\n);\nreturn props;\n}"
        }
      ],
      "invalid": [
        {
          "ruleFunc": "function (payload) {\nconst props = {};\nprops.items = payload.element.actionBar.actions.map(\n(item) => {\nif (item.key === 'testaction_1') {\n                item.hidden = true;\n}\nreturn item;\n        }\n    );\n    return props;\n}"
        }
      ]
    }

    Example: Show or hide section on the record details page.

    Hide the Key Dates section on the record details page only for NDA or MSA agreement record types. Display this section for all other agreement record types.

    {
      "criteria": [
        {
          "componentId": "RecordType",
          "componentProperty": "value",
          "validation": {
            "logicalOperator": "=",
            "comparisonValue": "NDA",
            "condition": "ValueMatchesStaticCondition"
          }
        },
        {
          "componentId": "RecordType",
          "componentProperty": "value",
          "validation": {
            "logicalOperator": "=",
            "comparisonValue": "MSA",
            "condition": "ValueMatchesStaticCondition"
          }
        }
      ],
      "logicalExpression": "1 OR 2"
    }
    {
      "valid": [
        {
          "dependentComponentId": "section-key_dates",
          "property": "hidden",
          "value": true
        }
      ],
      "invalid": [
        {
          "dependentComponentId": "section-key_dates",
          "property": "hidden",
          "value": false
        }
      ]
    }

    Example: Show or Hide tab in the multi tab detail page.

    Consider a layout with two tabs: Main Details and Terms & Renewals. Define the rule criteria as follows:
    • If the contract name in the Main Details tab is "Conga," the Terms & Renewals tab is hidden.
    • If the contract name is anything other than "Conga," the Terms & Renewals tab is visible.
    Note:

    To implement the same rule using the UI Editor, see Controlling Tab Visibility using Rule Editor UI.

    {
      "criteria": [
        {
          "componentId": "Name",
          "componentProperty": "value",
          "validation": {
            "logicalOperator": "=",
            "comparisonValue": "Conga",
            "condition": "ValueMatchesStaticCondition"
          },
          "type": "Field",
          "id": "ui-rule-criteria-1724651467104363089216487876"
        }
      ],
      "logicalExpression": "( 1 )"
    }
    {
      "valid": [
        {
          "dependentComponentId": "tab-2",
          "property": "hidden",
          "value": true,
          "dependentParentId": "agreement_tabs"
        }
      ],
      "invalid": [
        {
          "dependentComponentId": "tab-2",
          "property": "hidden",
          "value": false,
          "dependentParentId": "agreement_tabs"
        }
      ]
    }
  7. Click Save.
    A rule entry is created.
  8. Note:

    When setting conditions for visibility rules, you are not restricted to fields on the current tab. You can also reference fields from other tabs and use object fields that are not included in the page layout.

    To define rule criteria from the UI, click Advanced Rule Edit.


    The Rules window appears.
  9. All defined rules are listed in Rule drop-down. Select the rule you will work on.

    Field

    Description

    Execute when page loads

    Enable this toggle to apply the defined rule criteria when the page loads.

    IF

    Click Add Criteria and then select the Field Criteria option to create or manage condition criteria for fields. You can also select User Criteria to define conditions based on logged-in user information or Organization Criteria to define conditions using organization-level information.

    • Field: Field drop-down options are populated based on the selected object. Select the field you want to set as the condition criterion.
    • Operator: You must select the logical operator from the picklist. This forms the relationship between the field and its value.
    • Value: The value field changes based on the selected operator options. Enter or select the value for the specified field.

    Example: Multiple Criteria

    {
        "criteria": [
            {
                "componentId": "Name",
                "componentProperty": "value",
                "validation": {
                    "logicalOperator": "!=",
                    "comparisonValue": "Test",
                    "condition": "ValueMatchesStaticCondition"
                }
            },
            {
                "componentId": "StatusCategory",
                "componentProperty": "value",
                "validation": {
                    "logicalOperator": "=",
                    "comparisonValue": "Request",
                    "condition": "ValueMatchesStaticCondition"
                }
            },
            {
                "componentId": "RecordType",
                "componentProperty": "value",
                "validation": {
                    "logicalOperator": "=",
                    "comparisonValue": "Corporate",
                    "condition": "ValueMatchesStaticCondition"
                }
            },
            {
                "componentId": "AgreementNumber",
                "componentProperty": "value",
                "validation": {
                    "logicalOperator": "=",
                    "comparisonValue": "123",
                    "condition": "ValueMatchesStaticCondition"
                }
            }
        ],

    Filter Expression: By default, the application uses AND logic for all criteria. However, you can modify this to create nested logical expressions, like 1 AND 2 AND (3 OR 4).

    Then

    Click Add Action to create or manage an action that executes when the condition criteria are met.

    Add Else action

    Enable this toggle to set up an Else action that follows the Then action. The Else panel becomes available when you enable this option.

    Else

    Click Add Action to create or manage an action that executes when the condition criteria are not met.

    Delete ()

    Removes expression.

  10. Find the new rule under the Rules tab. Toggle the switch at the end of the rule name to activate it.
  11. To edit, delete or clone the rule, click the More () icon at the end of the rule and select an appropriate option.
  12. Click Publish to apply the rule to the page.