Tip 31: How to make a field in a Zoho Creator form mandatory based on criteria

Tip 31: How to make a field in a Zoho Creator form mandatory based on criteria

Hi folks,

 

I'm sure most of you are familiar with the Mandatory property available in our form builder. It enables you to ensure that your users enter an input in a required field. If they don't enter an input in that field, they'll be unable to submit the form. All you need to do is select the required field and just enable (check the box) the Mandatory property that you'll find in the Field Properties pane.



Whenever a mandatory field is left empty during form submission, a default alert message will pop up and prevent form submission.

                                                         

This remains static for all users and doesn't override on any condition. However, there is a way to bypass this and allow a form to be submitted even without the mandatory field value. This tip will help you understand how to make a field mandatory based on a particular condition or criteria.

Let's take the example of an Employee Leave Form, which employees use to apply for leave. Regardless of the number of days employees plan to take off or have already taken, they need to add a record using the Employee Leave Form while applying for leave. While entering the details, they can choose from different leave types available. By default the five basic categories are: Sick Leave, Casual Leave, Compulsory Off, On Duty, and Others. The employees can choose Others if their reason doesn't fall in any of the above choices. However, if the employee selects the Others option and submits the form, the person approving the leave needs to know the reason to either approve or reject it. 

If you mark the Leave Type field as mandatory, this wouldn't work if the user chooses the Others option. Hence, we've come up with a workaround—marking a field mandatory based on a condition using Deluge. 

Let's go through it step by step.

Step 1: Create the form, with all the required fields

First, let's create a Leave Form to capture all the details. Here, we've used the following fields:
  •  Name (Name Field)
  •  Email (Email Field)
  •  Employee ID (Single Line field)
  •  Start Date (Date Field)
  •  End Date (Date field)
  •  Leave Type (Radio Button)
  •  Reason (Multi Line Field)
Please note that the Reason field is used to enable employees to enter the reason for their leave if they select the "Others" option in the Leave Type field.




Step 2: Hide the Reason field when the form loads

 

Whenever the employee selects Others in Leave Type , they need to fill in the reason for it in the Reason  field. However, we can hide the field otherwise and show it only when the employee selects Others. To do that, we can create a simple workflow on the "Created or Edited - Load of the Form" condition using the below script.



  1. hide Reason;


Step 3: Show the Reason field only when the employee selects the Others option

 

As mentioned earlier, if the user selects the Others option in the Leave Type field, then the Reason field needs to be shown. For that, create a workflow in "Created or Edited - User input of field" on the Leave Type field using the the below script.

  1. if(input.Leave_Type == "Others")
  2. {
  3.  show Reason;
  4. }
  5. else
  6. {
  7.  hide Reason;
  8. }


Step 4: Mark the required field as mandatory using Deluge

 

Here comes the important part of configuring the Reason field as mandatory whenever the user selects Others as the leave type. For this, we can use a simple if statement to validate the leave type and prompt them to enter the reason. If the users selects the Others option, they have to enter details in the Reason field as well.

 

If the Reason field is empty, then we can display an alert asking the user to fill in the reason for their leave. Create a workflow with "Created or Edited - Validation on form submission" and this part of the workflow will get triggered once the user clicks the Submit button of the form.

  1. if(input.Leave_Type == "Others" && input.Reason == "")
  2. {
  3. alert(Reason,"Kindly mention the reason for the leave");
  4. cancel submit;
  5. }
Check the below-image to see how the validation works in the live form and the alert gets displayed. On clicking the Submit button, a validation will run to check if the Reason field is left empty. If it is empty, it will prevent form submission and an alert message will be shown in the pop-up.



In order to notify the user which field has to be filled, we're using the Inline Alert. Once the user clicks the OK button in the above error pop-up, an alert with our customized message will be displayed below the respective field, as shown in the image below.


We hope you try out this tip out for when you need to make a field mandatory based on conditions. We'll get back to you soon with another useful tip!


    • Recent Topics

    • Can’t Send Outgoing Mail

      Hello, one of the email addresses on my account had its outgoing mail privileges blocked. This was due to some bot signups on my website, causing my email to send a bunch of undeliverable emails. I have corrected this issue on my website. Please restore
    • zoho webmail keeps opening an empty tab when on log in/vist webmail

      as the the title says, whenever i log in or visit the page in a new tab, zoho webmail with open a new tab, but it errors out (see attachment). how do you stop it from doing this?
    • Sending possible. Receiving not possible.

      We are not receiving mail in our company email. Could you please solve this. It has been recurring and I want it to be resolved once and for all. Please help.
    • Efficient way to get a list of records like Notes under Leads that changed in last N minutes

      Hi, I am writing a process to consume the Zoho Leads and put it in an internal system. For Leads, Accounts and Contacts, the getRepords with lastModifiedTime works great as I can call the API to get only the updated records say in last 30 minutes. However
    • IMAP Connection Issue – "Disconnect called before connection setup" (Zoho + Freshdesk Integration)

      Hello, Since April 25, 2025, we are facing a critical issue with our Zoho Mail integration with Freshdesk. Incoming emails are no longer being received in Freshdesk. Freshdesk Support has confirmed that their system is trying to connect to our Zoho mailbox,
    • Fetching a missing Folder, now creates it

      Hello, I'm using Zoho Flow to fetch a folder within a Team Folder. If the folder is missing (folder ID is null), I trigger a Create Folder. Now in 2025, when I fetch a missing folder, a folder is created right away with the "name + full date" and a Folder
    • Is the "schedule 10 mass emails/module" limit a per user or per organization limit?

      For scheduling emails out of Zoho CRM, there is a 10 scheduled mass emails per module limit according to Zoho documentation (https://help.zoho.com/portal/en/kb/crm/faqs/emails/articles/how-to-schedule-mass-emails-in-zoho-crm). Is this limit per user or
    • How Would I get data from a network drive to be feed into creator program.

      What's the easiest and cleanest solution for this?
    • Using Zoho One to manage two (or more) businesses

      We are one company that operates two business, a scenario that Zoho One doesn't really seem to handle very well, and one which I can't imagine is at all unique to us! (It is basically designed to facilitate branding and use for one business only per subscription).
    • Give Permission for User test in Development/Staging modes

      Hi Everyone, I am using Zoho Creator C6. Where there are development and staging modes. Is it possible to give special / temporary permission for users to test directly in development and staging? Or do you have any other ideas? Thank you very much.
    • Merging 2 tickets

      Hi I understand how to merge 2 tickets already but find the process quite cumbersome. It is not always simple to perform a search that causes the 2 tickets in question to show up on the Ticket Screen, and this is the only place a merge can be performed. Doing a search for the customer or contact linked to the ticket displays all of their tickets which could be hundreds to sort through, you could do a custom search that only shows open tickets but doing that every time is also time consuming. Not
    • Cannnot find criteria tab

      We need to be able to segment contacts based on an account view or field. The online help shows a screen with three options: Under Sync Details there is All Contacts; Custom view; Criteria.  The latter is missing from my screen.  I need it. I also want to know if I delete contacts from campaigns, will they still remain in CRM? 
    • Dial Charts in Analytics using field values for colored ranges

      Hey all! It would be supremely helpful if we could use field values for ranges in Analytics for dial charts. We currently display an analytics report to our sales team showing how close they are to reaching the next tier for commission payouts. We update
    • A couple of minor enhancements to Workflows

      Last updated on September 17, 2024: These enhancements were initially available for early access, and we've now enabled them for all users. We are elated to announce a couple of enhancements to custom functions in our Workflows! Say hello to: "Source"
    • South Africa Tax Edition is now Available!

      Managing taxes just got easier for field service businesses in South Africa! With Zoho FSM's new South Africa tax edition, field service businesses operating in South Africa can now effortlessly stay compliant with local tax regulations. Easily manage
    • How to overcome Zoho Deluge's time limit?

      I have built a function according to the following scheme: pages = {1,2,3,4,5,6,7,8,9,10}; for each page in pages { entriesPerPage = zoho.crm.getRecords("Accounts",page,200); for each entry in entriesPerPage { … } } Unfortunately, we have too many entries
    • Introducing ICR in Zoho CRM: Transform your printed text into digital data

      From writing on papyrus in the ancient times to creating a humble record in your CRM, the world may have evolved with how it used to record data, but data entry as such has not been simplified. It is still a repetitive and arduous chore on which businesses
    • How to Add Custom Sections in the Product Page?

      Hi Zoho team, I’m currently using the Tranquil theme on Zoho Commerce and I have a question regarding the product page layout. Right now, under each product, I can see expandable sections like Product Details and Specifications. I’d like to add two additional
    • Bulk user onboarding for Cliq Channels in a jiffy

      As developers, we frequently switch between coding, debugging, and optimizing tasks. The last thing we want is to be burdened by manual user management. Adding users one by one to a channel is tedious and prone to errors, taking up more time than we could
    • Weekly Tips: Secure your attachment downloads with Zoho Mail

      Safety is one of our main concerns, whether it’s about device security or online protection. We use tools like fingerprint scanners, facial recognition, and two-factor authentication to keep our devices and email accounts secure. We use methods like OTP
    • Issues with Dashboard Filter and KPI in Zoho Analytics (CAGR)

      Hi everyone, I'm trying to build a CAGR (Compound Annual Growth Rate) KPI in Zoho Analytics, but I'm running into some issues with filter synchronization. Here's the scenario: I created two test reports: One that filters results from 2021 to 2025. Another
    • Adding Product Photos through Import or In Bulk

      I am about to add about 1000 products in the CRM. I am shocked that there is no way to add product photos through the Import feature. I'll be spending days adding product photos.... Very dissapointing. Anyone know of a work around to add product photos
    • Announcing Multi-language Support in Zoho FSM

      Zoho FSM now speaks your language. The much-awaited multi-language support is now available in Zoho FSM. The following languages are supported in Zoho FSM: Dutch (Nederlands) English - United Kingdom English - United States French (français) French -
    • How to sync Zoho CRM Quotes with Zoho Books/Finance Estimates or Quotes

      Hi everyone, We’re building quotes in the Zoho CRM Quotes module because of its strong CPQ features and better communication options (multiple contacts, email customization, etc.). However, these don’t sync directly with Zoho Books/Finance for invoicing.
    • Quiz of the Day on Dashboard

      Hi team, Is it possible to enter a feature for enabling a widget as a quiz for the day. This widget can have one question popping up daily from the list of some pre-fed questions and the employees need to either type a response or can select from a multiple-choice
    • Email content strategy

      This is basically a couple of questions about the best practices when it comes to the use of colors as part of the message sent through the email campaign. 1 - Is there a guide or recommendation as to what are the best colors for text/background associated
    • Canvas Button Vanished

      I have a button that has mysteriously vanished. It shows in the canvas builder but then is no where to be found in the actual record and before you ask, yes I have tried to access through incognito mode and same issue.
    • Multiple Tabs in the Dashboard

      Hi team, Can we enable an option to add multiple tabs in a dashboard? This will help to group the content to be displayed to employees and make it more usable and user-friendly intranet space.
    • In the Pivot table in the value section i want to the actual value instead of sum or count

      I am creating Early/late Check and check out in pivot report based on Zoho analytics I need the data to include: Employee Name Late Entry, Early Entry, Early Exit, Late Exit, First In, Last Out, and Total Hours.
    • Introducing Assemblies and Kits in Zoho Inventory

      Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
    • IMAP as a source option in Dashboards

      Hi Team Can I request IMAP be added as a source option for running a report or creating a KPI in dashboards. I have selected all options and my IMAP linked emails are not showing, I can only check these by going to emails in a contact. Thankyou Josh
    • In Zoho people Check in report the date want come as Colum how i can achive that in zoho people or analytics

      In Zoho people Check in report the date want come as Colum. How i can achive that in zoho people or analytics
    • Canvas responsive preview in different browser window causes re-authentication/verification

      I'm trying to design a view in Canvas. I am testing in a tab with a desktop view, and another tab (on my same desktop/IP) with a responsive view of an iphone. Every time I refresh, it boots me out of the previously used tab. If I forget to refresh the
    • Import subform entries conveniently in CRM

      Dear All,   Subforms have always been crucial for associating additional data with CRM records. You can easily associate line items with parent records and keep track of various details related to your records. We're pleased to announce that we've introduced
    • Canvas: how can I edit theme?

      This says "Theme Colours", and I would like to edit theme colors (and styles ala CSS). How can I edit these "Theme Colours"? I'm a software developer, so just point me in a direction where I can alter code if needed.
    • Cómo convencer a tu manager para venir a Zoholics 2025

      ¿No estás seguro de si a tu manager le convence que asistas a Zoholics 2025? ¡No te preocupes! Aquí te damos algunos argumentos clave que te ayudarán a convencer a tu manager de que participar en este evento es una inversión tanto para ti como para la
    • HTML Email in Zoho Books

      Is it possible to create custom html email template in zoho books. 
    • Using IMAP configuration for shared email inboxes

      Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
    • Can you please let us know how we can use Zoho for multi store?

      Hello Team, Can you please let us know how we can use Zoho for multi store because when we connect our plugin to Zoho and we create a product and then on another store when we create product with same name then product already exist error occurs, so how
    • Contracts Management

      Hello, We are implementing Zoho FSM for our field service operations and, one of the features we are lacking is Service Contract Management. I was told that such feature might be in the pipeline but an estimated launch date for this is not available at
    • Next Page