Error handling in forms | Zoho Creator Academy

Handle the error when an incorrect value is inputted by user

Requirement

Handle errors that occur when user enters an incorrect value. 

Use case

A company uses Zoho Recruit to maintain interview and candidate details. To let their candidates know their status, the company uses a Zoho Creator form. The candidates can enter their IDs and view their statuses. Also, the error that occurs when a candidate enters an incorrect ID is handled and a custom message is displayed. 

Steps to follow

In this tutorial, the Candidate Status Without Error Handling form was created only for demonstration purpose. You may refrain from creating this form and skip steps 10 and 11 if needed.

1. Create a form with the following details.

Form

Form Link Name

Field Type

Field Name

Field Link Name

Candidate Status

Candidate_Status

 

Single Line

Candidate ID

 

Candidate_ID

Single Line

Status

Status


Let’s now create 2 identical forms to demonstrate how the use case works with and without error handling.

2. Create two stateless forms by duplicating the Candidate Status form and name them as Candidate Status With Error Handling and Candidate Status Without Error Handling.
Note: Stateless form’s field values cannot be accessed on submit of the form since data will not be stored in Zoho Creator. Therefore in this tutorial, the status will be fetched from Zoho Creator on user input of Candidate ID field. 
Let’s now remove the default buttons since they are not required for our use case.

3. Navigate to Form Properties and delete the Submit and Reset buttons from both the stateless forms. 



Disable the Status field of Candidate Status - With Error Handling form so it cannot be modified by the candidates.

4. Create a workflow with the following details.



5. In the Deluge editor, save the following script to disable the Status field.
  1. disable Status;
Disable the Status field of the Candidate Status - Without Error Handling form so it cannot be modified by the candidates.

6. Create a workflow with the following details.



7. In the Deluge editor, save the following script to disable the Status field.
  1. disable Status;
8. Create a connection with the following details. This connection will be used in step 10 and 12 to fetch candidate data from Zoho Recruit.



9. Now create another workflow with the following details to populate the Status field with values fetched from Zoho Recruit. This workflow includes error handling.



10. In the Deluge editor, save the following script to fetch data from Zoho Recruit based on the supplied record ID. The code is written within a try catch block to display a custom message if an error occurs.
  1. try 
  2. {
  3. // Fetches record from Zoho Recruit based on the record ID
  4. res = invokeurl
  5. [
  6. url :"https://recruit.zoho.com/recruit/v2/Candidates/" + input.Candidate_ID
  7. type :GET
  8. connection:"recruit_oauth_connection"
  9. ];
  10. // Extracts status from the fetched record
  11. input.Status = res.get("data").get(0).get("Candidate_Status");
  12. }
  13. catch (e)
  14. {
  15. // Displays a custom alert if an incorrect candidate ID is supplied
  16. alert "The entered candidate ID seems to be incorrect. Please verify. For further queries, reach us at support@zylker.com.";
  17. }
Note: Steps 10 and 11 are the repetition of steps 8 and 9 but without error handling. This is included in this tutorial to demonstrate how the use case works if error handling is not implemented.
11.  Create another workflow with the following details to populate the Status field with values fetched from Zoho Recruit. This workflow doesn't include error handling.

 

12. In the Deluge editor, save the following script to fetch data from Zoho Recruit based on the record ID supplied. 
  1. res = invokeurl
  2. [
  3. url :"https://recruit.zoho.com/recruit/v2/Candidates/" + input.Candidate_ID
  4. type :GET
  5. connection:"recruit_oauth_connection"
  6. ];
  7. input.Status = res.get("data").get(0).get("Candidate_Status");
13. Publish the Candidate Status With Error Handling form and share the permalink with the candidates. This allows the candidates to access the form without a Zoho Creator account.

See how it works 



  1. Zoho Recruit API 
  2. Duplicate a form
  3. InvokeUrl task
  4. Alert task
  5. Publish a form

    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

                                                                                                          • Update an existing record using stateless forms

                                                                                                            Requirement   Use details specified in a stateless form to modify records in the main form. Use Case   In an order management system, a customer has placed an order and wants to cancel it. The administrators allow for cancellation by accepting the ...
                                                                                                          • FAQ: Stateless Form

                                                                                                            This page covers essential insights on Zoho Creator, including stateless form creation, optimized workflows linked to submissions, and the seamless process of creating forms without reports. What are stateless forms in Zoho Creator? Stateless forms ...
                                                                                                          • FAQs: Form Buttons

                                                                                                            This page covers about the functionality, customization, and optimization of form buttons in Zoho Creator, answering key questions and providing insights for enhancing user experience. What are form buttons in Zoho Creator? Form buttons in Zoho ...
                                                                                                          • FAQs: Form Drafts

                                                                                                            This page covers everything you need to know about managing form drafts in Zoho Creator, from configuration and access to troubleshooting integration issues and ensuring data privacy. What are form drafts and how are they useful? Drafts allow users ...
                                                                                                          • FAQs: Restrict Form Entries

                                                                                                            This page covers everything from customizing form messages to implementing Geo-fencing, empowering you with effective strategies for managing entries and enhancing security. Restrict Form Entries includes Enable Captcha, Allow one entry per user, ...
                                                                                                            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