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.
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.
- if(input.Leave_Type == "Others")
- {
- show Reason;
- }
- else
- {
- hide Reason;
- }
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.
- if(input.Leave_Type == "Others" && input.Reason == "")
- {
- alert(Reason,"Kindly mention the reason for the leave");
- cancel submit;
- }
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
Bigin iOS app update - Introducing Card Scanner and initiating WhatsApp conversations using pre-approved templates.
Hello everyone! In the latest iOS (v1.11.3) version of the Bigin app, we have introduced the following features: Card Scanner Initiating WhatsApp conversations. Card Scanner: Our new Card Scanner feature extracts contact information from business cards.
Introducing card scanner in Bigin Android app
Hello everyone! We are excited to introduce the card scanner feature on the latest Android version(1.7.26) of the Bigin app as well. Card scanner extracts contact information from business cards and allows you to save them as contacts in Bigin. You can
Full RTL and Hebrew Translation Support for Zoho Creator User Portal (Including All System Pages, Templates, and MFA Screens)
Dear Zoho Creator Team, We kindly request comprehensive support for right-to-left (RTL) languages, particularly Hebrew, across the entire Zoho Creator user portal. This includes system-generated pages, templates, and multi-factor authentication (MFA)
Auto assign account owner
hi, i need to auto assign leads and accounts to an owner by rules. i have created all the territories i need, and all territories have their owner. but when i want to auto assign a new or an existing account to a user by the rules of territories, only
ZUG real estate virtual meetup 2025: Sign documents, collect payments, and automate workflows with Zoho Sign
Hi there! Are you in real estate and looking for a secure, compliant way to manage all your paperwork? In such a fast-paced industry, timing, compliance, and client trust are everything. Handling paperwork has always been a challenge, whether you're finalizing
OCR (Optical Character Recognition), automatisation des PDF et autres améliorations de Zoho RPA
Zoho RPA est une plateforme d'automatisation des processus robotiques conçue pour accélérer et simplifier vos workflows. Elle permet de connecter facilement vos applications cloud à vos systèmes existants, même ceux qui ne disposent pas d’API, afin d’automatiser
Multi-Select lookup field has reached its maximum??
Hi there, I want to create a multi-select lookup field in a module but I can't select the model I want the relationship to be with from the list. From the help page on this I see that you can only create a max of 2 relationships per module? Is that true?
📢 Boost Your CRM Communication with HelloSend – Now on Zoho Marketplace!
We’re excited to introduce HelloSend, a powerful communication extension for Zoho CRM that brings SMS, WhatsApp, and Voice Calling directly into your CRM workspace. Whether you're in sales, support, or service delivery, HelloSend helps you connect with
Automation#24: Auto-Update custom field from Accounts to Tickets
Hello Everyone! Welcome back to the Community Learning Series! This episode dives into how Zylker Techfix streamlines account-related ticket references. Previously, employees had to manually check account details to retrieve specific customer information,
Support Mixed Visibility Settings in Knowledge Base Categories
Hello Zoho Desk Team, We hope you're all doing well. We’d like to submit a feature request regarding visibility settings in the Knowledge Base module. 🎯 Current Limitation As of today, when a category is set to a specific visibility level (e.g., Public),
Removing To or CC Addresses from Desk Ticket
I was hoping i could find a way to remove unnecessary email addresses from tickets submitted via email. For example, a customer may email the support address AND others who are in the helpdesk notification group, in either the TO or CC address. This results
Product Updates in Zoho Workplace applications | May 2025
Hello Workplace Community, Let’s take a look at the new features and enhancements that went live across all Workplace applications this May. Zoho Mail Increased Preset Limit for Reminder and Snooze Options Preset limits for the Reminder and Snooze options
Zoho Books | Product updates | June 2025
Hello Users, We’ve rolled out new features and enhancements in Zoho Books, from the option to record advances for purchase orders to dynamic lookup fields, all designed to help you stay on top of your finances with ease. Introducing Change Comparators
Announcing Kiosk 1.1 - Customize screen titles, configure new fields & actions, use values from your Kiosk to update fields, and more.
Hello all We are back again with more enhancements to Kiosk. So what's new? Enhancements made to the Components Add titles for your Kiosk screens and adjust its width to suit your viewing preferences. Three new fields can be added to your screen: Percentage,
Global Sets for Multi-Select pick lists
When is this feature coming to Zoho CRM? It would be very useful now we have got used to having it for the normal pick lists.
INVOICE DONT HAVE AN INCOME ACCOUNT FIELD TO POST TRANSACTIONS
INVOICE DON'T HAVE AN INCOME ACCOUNT LIKE THE EXPENSE ACCOUNT FIELD IN THE EXPENSE MODULE. PLEASE CAN YOU TELL ME WHAT TO DO TO ADD THIS FIELD AND FUNCTION TO POST IT TO THE RIGHT INCOME ACCOUNT. THANK YOU VERY MUCH
Outlook 365 ('classic') won't connect to Zoho email
New computer, fresh install of Office desktop. On the old computer Outlook was working fine with Zoho, retrieving/sending mail, etc. On the new one I can't connect the accounts in Outlook--Outlook just keeps popping up the box asking for a password. All
login email
Never logged into email says last log in never loged into
Client Script Operate Timeout
Hi Zoho, I have set a client script that use for ( i =1; length < i , i++) to fetch all of the product in order I have an order have 30+ products, seems this script will be stopped when it is checking rough 10 + products because of timeout (may be). May
Error AS101 when adding new email alias
Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
Installment plans
Hi I am looking for a way to allow my customer to make equal monthly payments. For instance if I create an invoice for customer Y for $1000 I want to allow them to make equal monthly payments for the next 6 months. I need those payments to be auto charged
Create a draft in reply to an email via Emails API
Hi, I’d like to use the outgoing webhook to automatically create a draft reply to incoming mail. How can I use the Emails API to create a draft reply that is linked to an existing email thread? I couldn’t find the relevant method in the documentation.
Search Mail with URL parameters
Is it possible to search Zoho Mail by passing URL params like we can in Gmail? eg. mail.google.com/mail/u/0/#search/from:(jane@doe.com)
Is this a valid email from Zoho or a scam?
Hi, I received an email advising me to update MX records for Zoho mail. Is it legitimate? Thanks, Nelson. Dear Admin, You may know that your domain (eg, yourcompany.com) has an MX record that points to an email server configured to process email for your domain. We have noticed that some of our customers have used Zoho IP address (instead of DNS server name) in their MX records to specify the mail server. This is NOT recommended practice. Vendors will sometimes change IP addresses for number of valid
Tip 14: How to iterate a set of Deluge code a specific number of times.
Hello folks, As you might already know, recursive functions are used to perform a particular action a specific number of times. We had explained this in detail in our Tip #2. Similarly, there is another way in which you can iterate a set of Deluge code 'n' number of times. All you need to do is to create a List and use the For each index task to iterate it for a specific number of times. Here are a few use cases where this would be useful to you: To create 'n' number of duplicate records for
Need Help Fetching Latest Conversion Rate by Date
Hi Team, I’m currently working on building a Balance Sheet in Zoho Analytics across different entities, with a common base currency of USD. I receive USD conversion values on a daily basis, and my requirement is to always capture the most recent available
Enhance Zoho One Conditional Assignment to Fully Reassign App Settings When Changing Departments
Hi Zoho Team, We’d like to submit a feature request regarding the current behavior of Zoho One’s conditional assignment logic when moving a user between departments. 🔧 Current Limitation As it stands, Zoho One’s conditional assignment does not remove
Multiselect lookup in subform
It would be SO SO useful if subforms could support a multiselect look up field! Is this in the works??
Category to Alert
Hi I am looking for help on how to solve an issue. We use the Category field for all items. We also use Composite Items. We would like to create an email alert when a Sales Order is created, however it would need to look at the Item to identify the category
How do I enter phone extensions?
How do I add a phone extension correctly so that when I dial the main number it will pause and dial the extension of the contact I want to talk to Greg
Validation Rule (Date)
Hi There, Can any anyone help me with the validation rule? I'm trying to fire a rule whereby the End Date cannot be before Start Date. Any takers? Manoj Nair
How do I modify the the incoming/current call popup? I can modify other call pages but not that one.
I want to modify the incoming and active call popup on the crm to include customer relevant information, such as purchase history or length of relationship. Under modules and fields, I don't seem to see active call as a choice to modify, only the main
Beyond Email: #3 Organize effortlessly with Bookmarks
With her team’s details now neatly saved under Contacts, Sarah is feeling more settled in Zoho Mail. As she begins exploring her new workspace, she remembers the collection of useful links she has saved on her browser—project trackers, client portals,
[Important announcement] Zoho Writer will mandate DKIM configuration for automation users
Hi all, Effective Dec. 31, 2024, configuring DKIM for From addresses will be mandatory to send emails via Zoho Writer. DKIM configuration allows recipient email servers to identify your emails as valid and not spam. Emails sent from domains without DKIM
Notification based on created/updated sales order that contain certain line items.
Hi, I am finding the workflows within Books somewhat difficult to setup, so I am thinking that a custom function may be the best way to go about this. I want to be able to send a notification to a team member that any sales order that has been created
Conditional Layouts On Multi Select Field
How we can use Conditional Layouts On Multi Select Field field? Please help.
Drawings in forms
I do a lot of drawings during my consultations and I’d like to add body maps or stencils that I can draw on in different colours and add explanations etc. I need to be able to erase mistakes etc. Ideally in a form that I can prepopulate with client details and a few questions/ client signature and then save as a form. is this currently possible? if not, is it in the pipeline? thanks, Dennis
Choice-based Field Rules on Global Lists
Hi, The new Choice-based Field Rules should also be able to work with Global Lists not just local lists. Thanks Dan
How can I populate dropdown data with information from another source or app?
I want to maintain a list of items in another app (say in excel or another database) and sync those as items in a drop down menu, instead of copy pasting to import. Is this kind of a feature available?
Workplace - Zoholics Europe Customer Awards
Dear Zoho Mail Community! 📣 We're excited to announce that at this year's Zoholics events across Europe, we're holding customer awards for the first time ever! Workplace - Zoholics Europe Customer Awards This is your chance to shout about the amazing
Next Page