System Variables

System Variables

This guide will help you with the following:
1. Date Variables 
  1. zoho.currentdate 
  2. zoho.currenttime 
2. String Variables 
  1. zoho.loginuserid 
  2. zoho.adminuserid 

Date Variables

zoho.currentdate

Returns the current date in the format as specified in the Application Settings dialog.
  1. info    "zoho.currentdate "+zoho.currentdate;

zoho.currenttime

Returns the current date along with the time value.
  1. info    "zoho.currenttime "+zoho.currenttime;

Example 1:
To get the current date and time and input it into a field upon success,
  1. Create a Date-Time field, for example, named TimeStamp
  2. In the onAdd ->on Success section and on Edit ->on Success sections of your Form, add the following script code, where zoho.currentime is the Deluge system variable which returns the current time. The current time will be updated in the field named TimeStamp. You can also disable  the field so that it is not edited by users.
  1. input.TimeStamp = zoho.currenttime;
Every record in every table (form) has two fields (Added Time and Last Modified Time) that ZOHO Creator automatically updates when ever a Form is clicked on the Submit or Update Buttons, so you could elect to show these fields in your List View. Refer the topic Display username and time  for more information.
  

String Variables

zoho.loginuserid

Email id of the logged in user is available as Zoho variables in all the applications created using Zoho Creator. The variable zoho.loginuserid can be used in scripting to write logic based on the user viewing your application. For example: You can have an application in Creator where you have data related to all your customers but you can make sure that each customer is able to view only those records that belong to him, based on their logged in emailid.
The table given below lists the zoho variables and value returned by the variables in a private and public application.

Example 1:
In the following sample code, userid field will display the current login email id of the user.
  1. userid
  2. (
  3. type = formula
  4. value = zoho.loginuserid
  5. )
Example 2:
In a leave application, users will submit their leave in the leave form. When a user logs in, he will see only the leave details belonging to him.
  1. list "My Leave Details"s
  2. {
  3. show all rows from emp_leave_form [Employee_email == zoho.loginuserid]
  4. (
  5. Employee_email as "Employee email"
  6. Leave_type as "Leave type"
  7. From_Date as "From Date"
  8. To_Date as "To Date"
  9. Reason
  10. )
  11. filters
  12. (
  13. Leave_type
  14. From_Date
  15. )
  16. }

Code Explanation:
[Employee_email == zoho.loginuserid] - The filter to display only the leave details of the current user
where,
- 'Employee_email' is a field in the form emp_leave_form
- 'zoho.emaild' is the deluge variable.
  

zoho.adminuserid

The variable zoho.adminuserid returns the emailid of the application owner. It can be used in scripting to write logic based on the user viewing your application. For example, you can make sure that certain views can be accessed only by the admin user (application owner) by adding the following criteria to your view:
show all rows from <form_name> [<email_field_name>l == zoho.adminuserid]

    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








                                    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

                                                                                                      • System Variables

                                                                                                        System variables are a special class of predefined variables, which are already defined by the system, and values are assigned by the system it self. These variables are read-only. They contain values that cannot or should not be changed by the ...
                                                                                                      • Variables

                                                                                                        Overview A variable is the address of a temporary value in the computer memory. Every time we declare a variable with a value, it gets stored in a certain address in RAM. And the variable name is the usual way to refer to the stored value. How is a ...
                                                                                                      • Developing Third-party Integrations - Custom Variables

                                                                                                        The guide will help you with the following: Create a custom variable The Variable VariableMap Example Create a Read-only custom variable Create a Hidden custom variable Custom variables are global variables that store information in your CRM. These ...
                                                                                                      • Integrating with third-party applications

                                                                                                        Each industry comes with a unique set of problems to solve. To accommodate this diversity within the business world, we've created the Zoho Developer console, which allows you to integrate almost any third-party application with your CRM ...
                                                                                                      • Building a Real Estate CRM

                                                                                                        Zoho Developer Console allows developers to transform your CRM into an industry specific CRM solution. A real estate CRM needs to manage comprehensive and comparative details about properties, offer ease in handling Buyer and Client data and provide ...
                                                                                                        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