Manage Client Scripts | Online Help | Qntrl

Manage Client Scripts

Client Scripts are used to incorporate additional validations to business data while they are recorded in Qntrl. In client scripts, you can code using JavaScript and run the code on the end-user’s browser while they are creating a new card or updating an existing card in Qntrl.

Business use cases

Client Scripts can be used to,
  1. Perform mathematical calculations and validations on field data
  2. Auto-populate fields based on end-user input
  3. Fetch data from third party applications or websites
  4. Track delays and capture causes for delay
  5. Display field values based on users, roles, and profiles
  6. Carry out validations on field data entered by end-user
  7. Throw alerts and messages for field validations
 

When are client scripts executed?

Client Scripts are executed based on one of the following triggers:
  1. On loading a page (onLoad)
  2. On submitting a page (onSubmit)
  3. On changing a field value (onChange)
Only one execution trigger can be associated with a client script. 

Add client script 

  1. Navigate to  and select Client Scripts under Customization  in the menu (or)
  2. Navigate to board specific business rules using quick access settings. Learn more.
  3. Click New Script .
  4. Enter the script details on the right panel.
    1. Script Name: Enter a name for the script.
    2. Form: Select a form for which the script must be executed.
    3. Execution Location: Select one or more locations in which the script must be executed.
      1. Add new Card: This refers to the page which appears when Add Card button is clicked.
      2. Card details: This refers to the page that appears when a card name is clicked.
      3. Transition: This refers to the page that appears when the transition is performed.
    4. Execution Trigger: Select a condition upon which the script’s execution must be triggered.
      1. onLoad- Select this option to execute the script when a page loads.
      2. onSubmit- Select this option to execute the script when a page is saved or published.
      3. onChange- Select this option to execute the script when a page is updated. On selecting this, a Field dropdown is displayed in the right panel, where you can choose the fields whose update must trigger the script.
  5. Code your script using the editor on the left.
    1. Click the ? icon at the top-right corner of the editor to use fields of the selected form.
  6. Click Save as Draft if you do not want the script to be executed right away.
  7. Otherwise, click Publish to activate the script. 


Set execution order of scripts

When more than one client script is created for a single form, the order in which the scripts must be executed can be predefined.
  1. Navigate to   and select  Client Scripts  under  Customization  in the menu (or)
  2. Navigate to board specific business rules using quick access settings. Learn more.
  3. Click Set Execution Order.
  4. Select a Form  and Execution Trigger from the dropdown.
  5. Enter numbers to indicate the Execution Order corresponding to each script.
  6. Click Save


Filter scripts based on forms

Client scripts can be filtered and viewed based on Forms. To filter scripts,
  1. Navigate to   and select  Client Scripts  under  Customization  in the menu (or)
  2. Navigate to board specific business rules using quick access settings. Learn more.
  3. Click  near All Forms  column and select a form from the dropdown. 


Only scripts from the selected form will be listed.

Enable or disable scripts

All published client scripts will be enabled by default. However, scripts can also be disabled to stop its execution temporarily. 
  1. Navigate to   and select  Client Scripts  under  Customization  in the menu (or)
  2. Navigate to board specific business rules using quick access settings. Learn more.
  3. Toggle the button under the Active column to NO or YES to disable or enable the corresponding script. 


Disabled script will not be executed until it is enabled again. 

Delete script

If you no longer require a client script, it can be deleted. To delete a script, 
  1. Navigate to   and select  Client Scripts  under  Customization  in the menu (or)
  2. Navigate to board specific business rules using quick access settings. Learn more.
  3. Hover over a script name and click  button.
  4. Select Delete from the pop-up.
  5. Confirm your action.  


Deleted scripts cannot be recovered. 


    • Related Articles

    • Business case 2: Use client scripts to auto-populate fields based on user input

      While designing forms, we would sometimes require to display different sets of fields for different user responses. Such automatic field population can be handled using client scripts. Business Scenario Helen creates a sign-up form for her product ...
    • Business case 3: Use client scripts to fetch data from third party applications or websites

      While designing forms, we might sometimes want to display data from other websites or applications like stock rates, flight status, freight details, weather updates, and so on. To fetch such information from third party websites or applications and ...
    • Business case 1: Use client scripts to perform mathematical calculations and validations on data

      While designing forms to replicate finance related documents like purchase order, invoice, or reimbursement bills, our workflows might require the calculation of total cost or sum of expenses incurred. To automate such mathematical calculations and ...
    • Manage Tables

      Tables help you store reference data in a tabular format within Qntrl . You can store data vital to support your business processes here. Also, the data in tables can be listed in cards using Table Lookup . For example, Zylker-- a manufacturing ...
    • Data Backup

      A complete backup of your organization’s data can be obtained using Data Backup. This helps you maintain a personal copy of the organization’s information. Access Privilege Data Backup can be initiated only by the Organization Owner. To take a backup ...

    You are currently viewing the help articles of Qntrl 3.0. If you are still using our older version and require guidance with it, Click here.