Server Variables in Qntrl Efficient Script Automation | Qntrl Online Help

Server Variables

Server Variable is a feature for storing values, such as text, numbers, email addresses, or any other data, and reusing values across your scripts, making your scripts more efficient and easier to manage. If you need to update these values, you can do it in the server variable, and this change will be reflected across multiple parts of your script or application.
 
For example, if you have a commonly used email address in multiple scripts, create a server variable called "vendor_email" to store it. Then, in any script that requires this email address instead of typing it out, just call the "vendor_email" variable, and it will dynamically retrieves the email address. If the vendor's email changes, update it in the server variable, and all your scripts will automatically use the new email address, saving time and ensuring data consistency.
 
Server variables come in two scopes, each with specific accessibility:
  • Global: When set as 'Global', you enable its use in all scripts, making it accessible from anywhere in your code.
  • Script: Setting the scope as 'Script' limits its use to specific scripts, restricting its accessibility to only those parts of your code.

Create a Server Variable   

  1. Navigate to (settings) >> CodeX >> click Server Variables in the menu.
  2. Click the New Variable button.
  3. Provide the following details:
    • Name : Enter a name for the variable.
    • Description : Provide a description for the variable.
    • Scope : Choose a scope type for the variable.
      • Global - The variable can be used in all scripts
        • Value: Enter a value for the variable.
      • Script - The variable can be used only in specific scripts.
        • Script: Select the scripts where you want to use the variable.
        • Script Values : Enter values for the script variables.
  1. Click Save.

 

Notes

You can add a maximum of 10 script variables and 25 global variables.


 

Edit or Delete a Server Variable   

To edit server variable details:
  1. Navigate to (settings) >> Scripts >> click Server Variables in the menu.

  2. Click on the variable you want to edit/Delete.

    1. Select Edit to modify the variable's value or other settings.

    2. Select the Delete to remove the variable. 

            

 

Notes
Deleted server variable can no longer be used in the CodeX script.


Enable or Disable Server Variables   

When a server variable is disabled, it cannot be used in the codex script.
  1. Navigate to (settings) >> CodeX >> click Server Variables in the menu.
  2. In Active column, toggle the button to enable or disable the required server variables.
      



    • Related Articles

    • Create and Configure a CodeX Script

      Prerequisite Prior to creating a codex, it is essential to establish a board since the configured codex scripts can be activated within that Board when specific conditions arise. Add a Script To add a new script, follow the below steps: Navigate to ...
    • Summary

      Overview CodeX, a robust scripting feature within the Qntrl platform, empowers you to automate tasks, manipulate data, and integrate workflows/applications. By running JavaScript code in a standalone server environment, CodeX allows you to execute ...
    • Script Modules

      Script Modules offers creating reusable, ready-made templates for your business logic compatible with ES6 modules. When you need that specific logic in another script, you don't have to write or copy-paste the code again. You can easily include the ...
    • Parameters in CodeX Script

      In the CodeX script, you can perform CRUD (Create, Read, Update, Delete) operations on the Parameters in Qntrl through the SDK. Instead of defining a URL or other values directly in your CodeX script, you can define them in ConfigStore and reference ...
    • Qntrl 3.0: new updates and migration

      Latest additions and enhancements We recently released a new version of Qntrl: 3.0. This version has a fresh interface with simplified navigation and seamless performance. We’ve tried to incorporate as many feedback and suggestions as possible in our ...

    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.