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,
-
Perform mathematical calculations and validations on field data
- Auto-populate fields based on end-user input
-
Fetch data from third party applications or websites
- Track delays and capture causes for delay
-
Display field values based on users, roles, and profiles
- Carry out validations on field data entered by end-user
-
Throw alerts and messages for field validations
When are client scripts executed?
Client Scripts are executed based on one of the following triggers:
-
On loading a page (onLoad)
-
On submitting a page (onSubmit)
-
On changing a field value (onChange)
Only one execution trigger can be associated with a client script.
Add client script
-
Navigate to
and select
Client Scripts
under
Customization
in the menu (or)
- Navigate to board specific business rules using quick access settings. Learn more.
-
Click
New Script
.
-
Enter the script details on the right panel.
-
Script Name: Enter a name for the script.
-
Form: Select a form for which the script must be executed.
-
Execution Location: Select one or more locations in which the script must be executed.
-
Add new Card: This refers to the page which appears when Add Card button is clicked.
-
Card details: This refers to the page that appears when a card name is clicked.
- Transition: This refers to the page that appears when the transition is performed.
-
Execution Trigger: Select a condition upon which the script’s execution must be triggered.
-
onLoad- Select this option to execute the script when a page loads.
-
onSubmit- Select this option to execute the script when a page is saved or published.
-
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.
-
Code your script using the editor on the left.
-
Click the
?
icon at the top-right corner of the editor to use fields of the selected form.
-
Click
Save as Draft
if you do not want the script to be executed right away.
-
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.
-
Navigate to
and select
Client Scripts
under Customization in the menu (or)
- Navigate to board specific business rules using quick access settings. Learn more.
- Click
Set Execution Order.
-
Select a
Form
and
Execution
Trigger
from the dropdown.
-
Enter numbers to indicate the
Execution
Order
corresponding to each script.
-
Click
Save
.
Client scripts can be filtered and viewed based on Forms. To filter scripts,
-
Navigate to
and select
Client Scripts
under Customization in the menu (or)
- Navigate to board specific business rules using quick access settings. Learn more.
-
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.
-
Navigate to
and select
Client Scripts
under Customization in the menu (or)
- Navigate to board specific business rules using quick access settings. Learn more.
-
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,
-
Navigate to
and select
Client Scripts
under Customization in the menu (or)
- Navigate to board specific business rules using quick access settings. Learn more.
-
Hover over a script name and click
button.
-
Select
Delete
from the pop-up.
-
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 ...