Configure page scripts | Zoho Creator Help

Configure page scripts

1. What does this page cover?

Learn how to add page variables, create page script and subsequently use them inside the pages component to populate dynamic values in the page elements upon loading your page.

2. Availability

  1. This feature is available in all the data centers.
  2. Page Scripts can be created in all the pricing plans of Creator.
  3. They can only be created by the super admin, admins, and developers, while other users can view them with in live mode with relevant permissions.

3. Creating Page Variables and Script

3.1 Page Script Creation Flow


3.2 See How To Configure


3.3 Steps to Create a Page Variable

Note: If you've created page parameters previously, they'll also be counted in the 50 variables limit as mentioned above. For example, lets assume you've created 60 parameters earlier. They'll be listed in the Page Variables tab and will continue to work as per the previous configuration. However, you'll not be able to create new page variables. You need to delete the parameters to accommodate the creation of new page variables.
  1. Navigate to the edit mode of your application.
  2. Select the required page from the accordion menu in the top-left corner, or from the page preview in the middle. You'll be taken to its Design page.
  3. Click on the device icon to navigate to the Design view of the device of your choice.
  4. Hover in the middle and click Open Page Builder.
  5. In the page builder, click the  icon at the top. The Page Variables tab will appear.

  6. Click Add Variable if you're creating a variable for the first time, or click the Add New button displayed at the top-right corner of the Page Variables tab.

  7. Name the variable, select an appropriate data type for the new variable, and click Add.

  8. The variable will be added and listed in the Variables tab.

  1. You can search for variables using the search bar at the top.
  2. You need to create the page variables in the Variables tab first i.e. You cannot create variables while writing a script.
  3. You can sort variables in ascending or descending order in two ways: by the date on which they were added or by their data type.

3.4 Steps to Create a Page Script

1. Navigate to the edit mode of your application.
2. Select the required page from the accordion menu in the top-left corner, or from the page preview in the middle. You'll be taken to its Design page.
3. Click on the device icon to navigate to the Design view of the device of your choice.
4. Hover in the middle and click the Open Page Builder button.
5. In the page builder, click the  icon at the top. The Page Script and Variables tab will appear.


6. Select the Script tab and enter the required script in the Deluge code editor. 
Note: Currently, you cannot perform write operations like adding or updating data using page scripts.

  1. empRec = Employee_LeaveDetails[Email == zoho.loginuserid];
  2. if(empRec.count() > 0)
  3. {
  4. img = empRec.Profile_Image;
  5. input.Image = "https://creatorexport.zoho.com" + zoho.appuri + "Employee_Details_Report/Image/image/" + img.getSuffix("fieldName/").getprefix("\"");
  6. input.Name = empRec.Name;
  7. input.CasualLeave = empRec.Casual_Leave;
  8. input.SickLeave = empRec.Sick_Leave;
  9. }
Note: Refer here to get the list of Deluge tasks that are currently not supported in the code editor for page script.
7. Click Refer Fields at the top-right of the editor to refer both variables and form fields across application. 

8. Click Save to save your script. 

3.5 Steps to Execute Page Script 

 After writing the page script, you can check if it is functioning as intended by giving any sample values for the variables.

  1. Save the script before executing it. Then click the Execute button on the bottom right corner of the Script tab.

  1. In the Execute pop-up that appears, enter the values for the defined page variables (ensuring that the date type matches the variable) if not assigned in the page script and click Submit.

  1. The script will be executed with the provided values, and the result will be displayed. If any error occurs, you can debug your page script by examining the output and correcting the script as needed. To debug the script, use the info task; its output values can be viewed under Log messages section.
    You can also click the Execute Again button if you want to execute the script again.

4. Limitations

  1. Currently, you can only create only one script (function) per page in your Creator application.
  2. You cannot call a script across pages inside Creator applications.
  3. If you had created page parameters previously, they cannot be edited (they would still continue to work according to their configuration). However, you can delete such parameters.
  4. You cannot call other custom functions inside the page script.
  5. The following Deluge tasks will not be listed while configuring the script for page script.
    1. Data Access
      1. Add records
      2. Update records
      3. Delete records
    2. Web Data
      1. postUrl
      2. openUrl
    3. Misc
      1. Send mail
    4. Sharing permissions
      1. Assign profile to app user
  1. Understand page script
  2. Understand pages

    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

                                                                                                          • Configure parameters for page elements

                                                                                                            Note: Page parameters are now improvized as page variables! All your existing page parameters have been moved to the Page Variables and Script tab at the top-right of the page builder. In this tab, you can continue to use these parameters as ...
                                                                                                          • Publish a page with job vacancies list and a form to apply for them

                                                                                                            Requirement Publish a page with components that can be accessed by the public users who don't have a Zoho Creator account. Use case In a Recruitment tracker application, there are 2 forms - Add Job Vacancy and Registration Form. Admins add job ...
                                                                                                          • Understand Page Builder

                                                                                                            1. What Does this Page Cover? Learn about the page builder and how you can customize your page and its elements according to your business needs. 2. Availability Pages can be created in all plans of Creator. Only the super admin, admins, and ...
                                                                                                          • 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 ...
                                                                                                          • Add widget to a page

                                                                                                            This help page is for users in Creator 6. If you are in the older version (Creator 5), click here. Know your Creator version. To add a widget to a page: Access the application to view and use the widget that you configured. Navigate to the Design ...
                                                                                                            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