Create and Manage Variables

Create and Manage Variables

1. What Does This Page Cover?

Learn how to create a variable to hold values that can be referenced and modified throughout your Creator application.

Learn more about variables and its significance before moving ahead.

2. Availability

  1. Variables are available for all plans of Creator.
  2. Super admin, Admins, and Developers can only create and manage variables while other users can access them.
  3. This feature is available across all data centers.

3. Creating Variables

A variable, once created, their values can be accessed and modified anywhere within your Creator application. This acts as a centralized approach to manage variables and their values to ensure consistency. Before creating a variable, make sure to understand all the relevant aspects of variables.
Note: It is not recommended to store sensitive data in variables as they are accessible by admins, super admins, and developers. Additionally, the values stored in variables may become accessible to live application users through script execution. Unlike the data stored in forms, user permissions cannot be configured for variables.

3.1. Variable Creation Flow


3.2. See How to Create a Variable


3.3. Steps to Create Variables

To create a variable:
  1. Go to the edit mode of your desired application to create variables and click Settings.
  2. Click Variables listed under Developer tools.

  3. Click the Add Variable button to create your first variable.

    A pane will open on the right, in which you need to provide the details, such as Group Name, Variable name, and Value.

  4. Enter a name for your variable in the Variable field.
  5. Note: 
    1. You can create a maximum of 20 variables per application.
    2. The Variable name can contain alphanumeric characters, and underscore, but it cannot  start with a number or underscore. Some examples of a valid variable names: interestRate, Branch24, email_id
    3. The Variable name must be less than 50 characters.
  6. Create a group to categorize your variables by clicking + Add Group and enter a group name. You can select a group from the dropdown if you've already created one. Alternatively, you can proceed without categorizing the variable in a group by leaving this field blank.
  7. Note:
    1. You cannot have two variables with the same name within the same group.
    2. You can create a maximum of 10 groups per application, and the group names must be unique.
    3. The Group Name must be less than 50 Characters.
    4. The Group Name can contain alphanumeric characters, and underscore, but it cannot start with a number or underscore. Some examples of a valid group names: interestRate, ZykerBranch, organization_info  
  8. Enter the value for your variable in the Defined Value field. The datatype of the variable will be auto-assigned based on the format of input value.
  9. Note: 
    1. The size of collection must be less than 2kB.                     
    2. You can only create up to four collections per application.

    1. Refer to the table below for sample values categorized by data type:

    2. Data Type


      Sample Values


      Number

      1
      Note: Only number values within the range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 are supported.


      Decimal


      1.0

      Note: The integral part of the decimal data type must not exceed 19 digits, and the fractional part cannot exceed 6 digits.


      Boolean


      true


      Text


      Hello World
      Note: The maximum limit for TEXT type variable is 255 characters. 


      Collection (List)


      ["Creator",6]

      Note:

      - DATE or DATE-TIME data type values are not supported inside a collection.

      - Collection size cannot be more than 2 KB


      Collection (Key-Value)


      {"Product" : "Creator", "Version" : 6}


      Note:

      - The key specified in the collection must be only TEXT.

      - DATE or DATE-TIME data type values are not supported inside a collection.

      - Collection size cannot be more than 2 KB


      Date


      '15-Aug-1947'

      Refer this help document to learn about other supported date formats.

      Note: Input date values can be in any supported date format. However, the format of the returned date value will be based on the application's date format settings.

    3. Note: If the value assigned to a variable does not match any of the specified data type formats, it will be considered as a TEXT data type.
  10. Click Create.
    1. Once added, you can view its defined value and current value as shown. You can use the search tab to search a variable with its name and filter tab to find the desired variable group.

Note: The defined value refers to the value assigned to the variable when it was created. On the other hand, the current value represents the real-time, last updated value of the variable after script executions within the application.

4. Create and Update Variables in Code View

Code View is a page that displays all the created variables in a formatted code format. This allows you to easily access and manage the variables created for that application. 
Note: You cannot rename or delete a variable or variable group in the code view
To create a variable in code view:
  1. Navigate to Variables under Developer Tools in your application settings. All variables that you have created will be listed here.

  2. Click Code View in the top-right corner, as shown.
    1. You will be shown the created variable in the code format. If you haven't created any variables previously, you will be presented with an empty Deluge editor.
    2. You can edit the values in the code directly or create a new variable by following the syntax given below.

      Creating a variable with group:
    3. thisapp.variables.<group_name>.<variable_name> = <value>;

    4. Creating a variable without group:
    5. thisapp.variables.<variable_name> = <value>;
  3. Click Save. A pop-up will be shown with the change summary to confirm the changes to be made. 
  4. Click Proceed in the pop up to save the changes made in the Code View.

5. Access and Modify Variables Using Deluge

Variables within the applications can be both accessed and modified using Deluge. Any modifications made to a variable's value through the Deluge script will be stored as the variable's current value. This current value dynamically updates in real-time to reflect the most recent modification triggered by script executions within the application, and this updated value propagates throughout the entire application.

Note: 
  1. Simultaneous modifications and access to a variable may not give expected results.
  2. The value of a variable updated through a Deluge script will be reflected in the current value only at the end of the script execution, even though the script executes using the modified value.
To access and utilize variables in your application, follow the syntax below:

For variables inside a group,
  1. //To access a variable
  2. thisapp.variables.<group_name>.<variable_name>;
  3. //To modify a variable
  4. thisapp.variables.<group_name>.<variable_name> = <value>;

For variables without group,
  1. //To access a variable
  2. thisapp.variables.<variable_name>;
  3. //To modify a variable
  4. thisapp.variables.<variable_name> = <value>;
Where:
  1. <group_name> is the TEXT that represents the name of the group to which the variable belongs.
  2. <variable_name> is the TEXT that represents the name of the variable in the specified group to access its value.
Example
Suppose you have a variable named Organization_Name with a a value Zylker Technologies within a group named Organization_Details, you can access its value using the script as follows:
  1. info thisapp.variables.Organization_Details.Organization_Name; // Returns Zylker Technologies

6. Variables in Different Environments

Variables can be created and managed only from the application settings in the development environment of the application. However, when the application is published from the development environment to subsequent environments, the current values of variables will not be carried forward. Instead, they will be replaced with their published defined values. The current values may differ in each environment depending on the script executions specific to the environment.
Note: In the environment settings, you can only view the defined value and current value of variables specific to that environment. To create or manage variables, you must access the application settings in the development environment.
Example: 
Consider a variable named 'Interest' with a defined value of '7.5' and a current value of '8.0' in the development environment. When the application is published to the stage environment, only the defined value of the variable is carried forward, and the current value by default is set as the defined value of '7.5'. Now, both the defined and current values of the 'Interest' variable will be '7.5' in the stage environment. The following table depicts the same for better understanding:

 

Variable

Development Environment

Stage Environment

Interest

Defined Value

Current Value

Defined Value

Current Value

7.5

8.0

7.5

7.5


Depending on script executions in the stage environment, the current value can change further in that environment. Let's say the current value in the stage environment now gets updated to '10.0' due to script execution. Now, when the defined value of the variable is updated to '8.5' in development environment and published again to stage environment, the current value '10.0'  is replaced with the updated defined value of '8.5'. The following table depicts the same for better understanding:

Variable

Development Environment
(On editing the values)

Stage Environment
(Existing values)

Stage Environment
(On republishing the application)

Interest

Defined Value

Current Value

Defined Value

Current Value

Defined Value

Current
Value

8.5

8.5

7.5

10.0

8.5

8.5


The same scenario applies to publishing the variable from the stage environment to the production environment
To view environment-specific variables and their values, navigate to the Variables section in the environment settings. Learn More

7. Manage Variables

Managing variables offers the following operations :
  1. View variable reference
  2. Edit variable
  3. Delete variable 
  4. Rename group
  5. Delete group

7.1. View Variable References

References contain a list of all the places within your application where the specific variable is being used. To view references:
  1. Navigate to Variables under Developer Tools in your application settings. All variables that you have created will be listed here.
  2. Click on the desired variable name you'd like to see references for.

  3. Click on the View Variable Reference hyperlink below the Variable field.
You will be shown the pop-up with the list of all places where the variables is used in your application.

7.2. Edit Variable

Editing the variable value will automatically update both the defined value and the current value. To edit the variable:
  1. Navigate to Variables under Developer Tools in your application settings. All variables that you have created will be listed here.
  2. Click on the variable name that you want to edit.

  3. On the next page, you will be shown the details of the variable. Click on the Variable field to modify the variable name and the Value field to update the variable's value.
  4. Note: 
    1. A variable cannot be moved from one group to another.
    2. You cannot assign a value with a different data type to the variable. In other words, the data type of the variable cannot be modified.

  5. Click Update.
    1. The changes will be saved immediately once you click Change in the confirmation popup that appears.
    2. For collection variable type modifications, such as changing from a list to a key-value structure or vice versa, a pop-up window will appear, displaying references to all the locations where the collection variable is used. You can review these references and click Change to save the changes.
Note: When removing a key from a key-value collection, replace the references with appropriate values. Similarly, when adding a key to a list-type collection, make sure to replace the references with key-value pairs. This precautionary step is essential to prevent potential errors in your application and maintain its functionality.

7.3. Delete Variable

To delete a variable:
  1. Navigate to Variables under Developer Tools in your application settings. All variables that you have created will be listed here.
  2. Hover over the variable that you want to delete and click the delete icon () that appears.
    1. If the variable is not used in your application, it will be deleted immediately once you click Delete in the confirmation popup that appears.
    2. Otherwise, a popup with references of all the places where you have used the variable will be displayed.
    3. You need to delete all the mentioned references in order to Proceed to Delete the variable.

7.4. Rename Group

When you rename a group, the new group name will be applied to the variables and their references within the group throughout the application. To rename a variable group:
  1. Navigate to Variables under Developer Tools in your application settings. All variables that you have created will be listed here.
  2. Hover over the desired group name that you want to change and click the edit icon ().

  3. Enter the new group name in the pop-up and click Rename.

7.5. Delete Group

To delete a variable group:
  1. Navigate to Variables under Developer Tools in your application settings. All variables that you have created will be listed here.
  2. Hover over the desired group name that you want to delete and click the delete icon ().

    1. If the variables in that group is not used in your application, it will be deleted immediately once you click Delete in the confirmation popup that appears. 
    2. Otherwise, a popup with the list of all variables with references will be displayed.
    3. You need to delete all the mentioned variables and its references individually in order to Proceed to Delete the variable group.

8. Points to Note

  1. Variable names within a group must be unique.
  2. The data type of the variable remains constant once it is created and it cannot be changed. For the collection data type, the value can be changed from list to key-value format and vice versa.
  3. When changing the key-value type collection into a list-type collection, replace the references with appropriate values. Similarly, when changing a list-type collection to key-value type collection, make sure to replace the references with key-value pairs. This precautionary step is essential to prevent potential errors in your application and maintain its functionality.

9. Limitations

  1. It is not possible to create a sandbox with C5 application, if it contains variables.
  2. Variables are not available for applications within the C5 sandbox and developer zone.
  3. A maximum of 10 groups can be created per application.
  4. A maximum of 20 variables can be created per application, irrespective of the number of groups. Among the 20 variables, only a maximum of four variables can be of the collection data type.
  5. The size of each collection variable must not exceed 2 KB.
  6. A variable cannot be moved from one group to another.
  7. System variables can be only assigned to a variable through a Deluge script.
  8. Renaming or deleting a variable or variable group is currently not supported in code view.
  9. A maximum of 500 variable assignments can be performed via a Deluge script per day.
  10. Simultaneous modifications and access to a variable through scripts may not give expected results.
  11. Value of variables cannot be modified through scripts in the following workflow actions:
    1. Form on load
    2. Form on validate
    3. User input of a field
    4. Subform - Addition of row
    5. Subform - Deletion of row
    6. Subform - User input of a field
    7. Stateless form - button actions
    8. Page script
  12. Note: If a function involving variable modification is invoked within these actions, it will not be executed.
  1. Understand Variables


    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION





                          Quick Links Workflow Automation Data Collection
                          Web Forms Enterprise Begin Data Collection
                          Interactive Forms Workplace Data Collection App
                          CRM Forms Customer Service Accessible Forms
                          Digital Forms Marketing Forms for Small Business
                          HTML Forms Education Forms for Enterprise
                          Contact Forms E-commerce Forms for any business
                          Lead Generation Forms Healthcare Forms for Startups
                          Wordpress Forms Customer onboarding Order Forms for Small Business
                          No Code Forms Construction RSVP tool for holidays
                          Free Forms Travel
                          Prefill Forms Non-Profit

                          Intake Forms Legal
                          Mobile App
                          Form Designer HR
                          Mobile Forms
                          Card Forms Food Offline Forms
                          Assign Forms Photography
                          Mobile Forms Features
                          Translate Forms Real Estate Kiosk in Mobile Forms
                          Electronic Forms

                          Notification Emails for Forms Alternatives Security & Compliance
                          Holiday Forms Google Forms alternative  GDPR
                          Form to PDF Jotform alternative HIPAA Forms
                          Email Forms
                          Encrypted Forms
                          Embeddable Forms
                          Secure Forms
                          Drag and Drop form builder
                          WCAG


                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Understand Variables

                                                                                                                What Does This Page Cover? Learn about variables that hold values that can be referred to and modified throughout your Creator application. Availability Variables are available for all plans of Creator. Only super admin, admins, and developers can ...
                                                                                                              • Create and Manage Pages

                                                                                                                1. What Does This Page Cover? Learn the steps to build intuitive pages and to perform various actions, including managing your page's properties, renaming, duplicating, and deleting a page. 2. Availability Pages can be created in all plans of ...
                                                                                                              • Create and Manage Batch Workflows

                                                                                                                1. What Does This Page Cover? Learn how you can efficiently split your larger tasks into smaller batches and process them at off-peak hours using batch workflows. Before you proceed to create a batch workflow, check this page to understand about ...
                                                                                                              • Page script and variables

                                                                                                                1. What does this page cover? Learn about page scripts, their creation and subsequent usage inside the pages component to populate dynamic values in your page elements, thereby minimizing the need for multiple snippets in your page. 2. Availability ...
                                                                                                              • Create and manage node.js functions

                                                                                                                A function is a set of statements that is invoked in an application to perform a certain action or yield a desired result based on the logic in the code. Node.js is a cross-platform, open-source JavaScript runtime environment. Introducing Node.js ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources