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

    • Email Templates - Is There a Ticket Placeholder for Billing Entity ID

      Was looking to add Billing Entity ID as a placeholder in a ZoHo email template. https://help.zoho.com/portal/en/kb/desk/customization/templates/articles/creating-and-managing-email-templates#Guide_to_Placeholders e.g. the placeholder for Account would
    • Integration with Woocommerce

      Hi, Do you have plan to make integration with other e-commerce platforms, for example Woocommerce / Shopify / Magento ?  Thanks. 
    • Expense Entry Error When Trying To Save (Related To Taxes)

      Hey folks, I've been trying to enter my first few expense entries in Zoho Books and I'm faced with the following error. "You cannot perform tax related operations when you are not registered for tax." But I have my HST/GST enabled and the tax rates are
    • Se puede mover un Cliente de un modulo a otro personalizado

      Hola, tengo una duda que me gustaría resolver: Actualmente trabajo con dos módulos: Seguimiento de Venta y Cierre de Ventas . Mi objetivo es que, cuando desde el módulo de Seguimiento se marca una venta como "Venta Efectiva" , el cliente sea movido al
    • Creating a whatsapp channel in instant messaging in zoho desk - error Oops, something went wrong. Please try again later.

      Creating a whatsapp channel in instant messaging in zoho desk - error Oops, something went wrong. Please try again later.
    • Open a popup window from inside Record A and stay on the record after saving Record B

      Hello community, Perhaps you can help me with the following topic. I have a form A with a decision box. When this decision box is checked, a form B pops up. Once Form B is saved, I need to stay on Form A to continue entering data. I've observed the following
    • Export Data & Attachments

      Hi, I am wondering whether it is possible to create an export of all data in creator, including attachments, for either backup purposes, or migration purposes. Thanks.
    • Apply partial payments to invoices from the Banking Module

      We need this! Why is this not possible?
    • Zoho Desk: Q1 2025 | What's New

      Hello everyone, Our first release for the year 2025 is here! Check out the Release Notes for more details The diverse capability of AI and its avatars has been the center of attention lately, and we've made some significant strides in this area. We now
    • Feature Request Improve parent-child relationship visibility

      Hi team, The Parent-Child ticket feature is great, but I've struggled to see the relationship between tickets when using ticket list views. It would be a great quality of life enhancement for users if child tickets were nested under parent tickets in
    • What is Resolution Time in Business Hours

      HI, What is the formula used to find the total time spent by an agent on a particular ticket? How is Resolution Time in Business Hours calculated in Zohodesk? As we need to find out the time spent on the ticket's solution by an agent we seek your assistance
    • 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
    • need a third party to fix email authentication dns records

      at my wit's end - zoho began giving me spf, dmarc, dkim errors two weeks ago fussed with it since and now it seems dkim is the only problem and when i added the dkim record with the key from zoho mail it still wont work tired of this, need someone who
    • How do i move multiple tickets to a different department?

      Hello, i have several tickets that have been assigned to the wrong department.  I am talking about hundreds of automatically generated ones that come from a separate system. How can i select them all at once to move them to another department in one go? I can select them in "unsassigned open tickets view" but i can't find a "move to another department" option. I also can't seem to assign multiple tickets to the same agent in that same view. Could somebody advice?
    • Zoho Books Sandbox environment

      Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
    • Add Button on Tickets

      is there a way I could add another button on the ticket aside of "closed ticket" only. Like I want to add another button "Send & Pending", "Pending for Response" like that.
    • Enhancements in Canvas

      Dear All, Greetings! Canvas lets you design the record details page to suit your brand or business preferences. We are glad to introduce the following enhancements to uplift your design experience. Reusable Components Style Presets Let's go! Reusable
    • Currency fields and decimal places in CRM email templates

      Hi, How do I get more than the standard 2 decimal places showing in a Currency field, on an email template? In the Layout for my Currency field, it is set to 6 decimal places. I want to show up to 6 places in the email template (unrounded). See attached
    • Include Secondary Contacts (CCs) on Workflow Alerts

      Hi There, We use the Supervise Rules and Workflow Alerts to send automated messages to contacts in Zoho Desk. Most often, we are sending the ticket contact (our client) a reminder that we are waiting on their reply to our most recent message. The problem
    • Zoho Desk blank page

      1. Click Access zoho desk on https://www.zoho.com/desk/ 2. It redirects to https://desk.zoho.com/agent?action=CreatePortal and the page is blank. Edge browser Version 131.0.2903.112 (Official build) (arm64) on MacOS
    • Adding a lead by sending email message

      Hello, Our Zoho Mail is integrated with Zoho CRM (we have Enterprise) and we can add new leads to CRM right from the web interface/panel of Zoho Mail using buttons at the bottom right corner of the screen. This is very handy. We add leads on a regular basis.    I was wondering though if it's possible to add a lead to CRM by simply forwarding an email message to a certain e-mail address. For example, in Evernote one can add a new note by sending an email message (with certain parameters) to a custom
    • Ask the Experts 19: Live Expert Panel Discussion - Inside Zoho Desk Spring Release 2025

      Hello again! Have you ever needed quick insights into key indicators to help manage and streamline specific operations? Have you started using AI to enhance your customer service in Zoho Desk? From configuring simple bots using Guided Conversations to
    • Ability to select Vendor Credits when creating Vendor Payments

      When making vendor payments there should be the option to select open vendor credits, this way the payment shows what bills and credits are being used for the payment Right now the vendor credits must be applied to the bills prior creating a payment,
    • Need the ability to have read only fields on a form.

      There needs to be functionality in Creator that allows a field on a form to be read only. Most screen building software applications have this capability. I know you can hide certain fields from specific users and that you can also make the whole form read only but that's not the functionality I need. I want to be able to create a form where certain fields are editable and other are for display purposes only (read only). For example if the form was displaying information on an item that the user
    • No Sales Returns on SO's with Dropped Shipped items + Inventory Items

      We have encountered an issue in Zoho related to sales orders that include both dropshipped items and inventory items. Specifically, it is currently not possible to create sales returns for the company’s own inventory items from these sales orders. This
    • Show both Vendor and Customers in contact statement

      Dear Sir, some companies like us working with companies as Vendor and Customers too !!! it mean we send invoice and also receive bill from them , so we need our all amount in one place , but in contact statement , is separate it as Vendor and Customer, 
    • Filter a report for a specific bank and a specific transaction type (interest income)

      I am trying to run a report - any report - on a specific bank account for the interest income. I do not see it as an option. I can see the Bank Account under Account in the Filters, and I can see the Interest Income under Account in the Filters But I
    • ZMA v2 : Unable to delete a trigger from existing journey with several triggers

      I have multiple triggers on a single journey and need to delete one. However there isn't the function to do so, no delete icon or settings bar, no right click options of any kind. Every change I make affects all triggers ... How can I remove one of these
    • How to track the source of form submissions using referrer names in Zoho Forms?

      Ever wondered where your users are accessing your form links from? By tracking the origin of your form entries—whether it's from social media, email campaigns, direct links, or embedded on your website—you can identify which channels are driving the most
    • Snapchat

      Are there any plans to add Snapchat to Zoho Social or is there any API that we can use to integrate into Zoho.
    • Showing meeting acceptances in CRM that originated from Outlook

      Hello Zoho Team, We send meeting invitations from Zoho CRM. Many of our recipients use Outlook and therefore use the RSVP buttons from Outlook to respond. They rarely, if ever, use the RSVP buttons from the Zoho invitation. Unfortunately, the meeting
    • Widget JS SDK to Upload a photo to a record in a Module

      Good day,  I would really appreciate it if someone can assist me. I have written a widget, to be used in a Custom Module in CRM.  My goal: I want to upload a photo from my computer and display it in die "upload image" field. I am using the JS SDK: https://help.zwidgets.com/help/v1.1/index.html
    • Easy way to create task from call

      In Bigin I would like to have easy way of creating the tast directly from the call. Now after the call I need to enter company record and create task there. There must be some easier and more user friendly way to create new task after the call!
    • Zoho Creator Deluge - dynamically change fields depending on user input of field1 or field2

      Hi everyone and happy holidays! Hope that someone will help me figure out a solution to my problem… In my form there are currency, formulas and lookup fields. I’m well aware, that formulas fields if marked visible on form, cannot be hidden anywhere (like
    • Linkedin: when Zoho Social is going serious with it?

      Hi, it's been said in the past that Linkedin related features in Zoho Social were well behind those of other social networks because of limitations imposed by the platform. Now that we see around my tools (take taplio.com) frankly outpacing ZSocial on
    • Push notifications to portal users

      Hi all, it is possible to send push notifications to portal users?
    • Page - Gauge - Target Values

      Is there a way to make the Target and Maximum values say a formula or query?  For example, total sales for the month = 109 and I want to make my gauge today's percentage.
    • Check Validation Rules all fields on Quick Edit on Record Details Page

      I've added validation rules for some fields in a module — let’s say 3 out of 6 fields have rules. On the Edit Page, if any of those fields have an error, I can’t save the form — which is good. But on the Details Page, I can still quick edit other fields
    • Call transcrition working for ringcentral?

      I don't see anything about what telephony providers can be used. The Zoho support person A said that RingCentral isn't supported. Zoho support person B said that it works, just make sure the call recording link works. Excellent instructions here: Call
    • Unified customer portal login

      As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
    • Next Page