Custom Validation for Blueprint to Enforce Mandatory File Uploads and File Extension C

Custom Validation for Blueprint to Enforce Mandatory File Uploads and File Extension C



Welcome to another exciting Kaizen post on Client Script!

Have you ever wanted more control over what gets uploaded to a File or Image field in Zoho CRM, like restricting file types, validating file names, or showing a custom error before an inappropriate file gets saved? 

Client Script now supports File Upload and Image Upload fields, giving you greater control over file validation and user experience.

In today's post, let's see how to make a file upload field mandatory in a Blueprint using Client Script, a solution to the question raised in our community forum.

In this Kaizen post,


  1. Use Case
  2. Solution
  3. Supported ZDKs
  4. Summary
  5. Related Links


1. Use Case

In the Deals module, Zylker Logistics uses a Blueprint with the transition "Needs Analysis" to "Deal Accepted" or "Deal Rejected". Sales agents were clicking this transition without uploading the Order Confirmation file, which caused downstream OCR automation to fail and forced the ops team to manually chase missing documents later. To fix this, the admin wants to check whether the Order Confirmation field has a file attached whenever a user tries to perform the transition. If no file is attached, the transition should be blocked and an error message should prompt the user to upload the file first. Additionally, if a file is attached, it should be a PDF only. This way, a Deal can only move to next transition once a valid PDF confirmation document has actually been uploaded.




2. Solution

This use case can be solved using Client Script. All you have to do is create a Client Script with the "beforeTransition" event for the Deals module. 
  1. Go to Setup > Developer Space > Client Script. Click +New Script . Specify the details to create a script and click Next.

  1. Enter the following script and click Save.

  1. // Check if the current blueprint transition being triggered is "Deal Accepted" or "Deal Rejected"
  2. if (transition.name == "Deal Accepted" || transition.name == "Deal Rejected") {

  3.     // Get the value of the Test field (file upload field)
  4.     var objectArray = ZDK.Page.getField('Test').getValue();

  5.     // Log the field value to console for debugging purposes
  6.     log(objectArray);

  7.     // Check if the field is empty - covers empty string, null, and empty array cases
  8.     if ((objectArray == '' || objectArray == null || objectArray == '[]')) {

  9.         // Show an error message to the user if no file is attached
  10.         ZDK.Client.showMessage("Upload a **valid Proposal Document PDF** to proceed", error)

  11.         // Stop/block the blueprint transition since validation failed
  12.         return false;

  13.     }
  14.     else {

  15.         // If a file is attached, get the name of the first uploaded file
  16.         var fileName = objectArray[0].File_Name;
  17.         log(fileName);

  18.         // Extract the file extension from the file name and convert it to lowercase
  19.         var extension = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
  20.       
  21.  // Check if the uploaded file's extension is not "pdf"
  22.         if (extension != "pdf") {

  23.             // Show an error message asking the user to upload a valid PDF file
  24.             ZDK.Client.showMessage("The Proposal Document field accepts **only PDF files**. Please select a **.pdf file** and try again.", error);

  25.             // Stop/block the blueprint transition since the file is not a PDF
  26.             return false;
  27.         }
  28.     }
  29. }

This script runs before the "Deal Accepted" or "Deal Rejected" blueprint transition. It checks whether the Proposal Document field has a file attached. If the field is empty, it shows an error and blocks the transition. If a file is attached, it checks the file's extension. If the extension isn't "pdf", it shows an error and blocks the transition; otherwise, the transition proceeds normally.

Notes
Note:
The value of a File Upload field is an array of objects, even when only a single file is uploaded. Therefore, access the required file object (for example, objectArray[0]) before retrieving its properties, such as File_Name

  1. Here is how the Client Script works when no file is uploaded to the Proposal Document field.




  1. Here is how the Client Script works when a GIF file is uploaded to the Proposal Document field.



  1. If a valid PDF file is uploaded, the transition goes through smoothly without any issues.



3. Supported ZDKs

For File Upload and Image Upload fields, as of now only the following ZDKs are currently supported:

getValue() – Retrieves the file details currently populated in the File Upload or Image Upload field.
setValue() – Sets or updates the value of the File Upload or Image Upload field.

4. Summary

In this Kaizen post, we discussed:
  1. How to validate a file's extension and stop a Blueprint transition based on it.
  2. How to check whether a file has been uploaded using Client Script.
  3. ZDKs that can be used for File Upload and Image Upload fields.




    • Sticky Posts

    • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

      We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
    • Kaizen #256 - Build an Arrival Readiness Web Tab in Zoho CRM

      Hi everyone! Welcome back to the Kaizen series! In the post, we discuss a use case in hospitality industry: how an Arrival Readiness web tab widget can be used to let reception staff identify and resolve issues before arrival of guests. Use case In the
    • Kaizen #198: Using Client Script for Custom Validation in Blueprint

      Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
    • Kaizen #226: Using ZRC in Client Script

      Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this
    • Kaizen #222 - Client Script Support for Notes Related List

      Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how
      • Recent Topics

      • Check out in Meetings

        Why there is no check out in Meetings of Zoho CRM, very difficult to track
      • Admin Logging in as another User

        How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Latest Update (27th April 2026): With the early
      • How do I get to "Admin Panel"

        I just started a Cliq account. I am the sole administrator. As I read the documentation, I keep seeing reference to an "Admin Panel". I see no way to access this from my Cliq account. How do I access this panel?
      • 【初開催! オンライン】Zoho Campaigns メール配信の基礎・活用勉強会を開催します! 10/15 参加無料

        ユーザーの皆さま、こんにちは。 Zoho コミュニティグループの中野です。 Zoho ユーザーコミュニティ初となる、メールマーケティングをテーマにしたオンライン勉強会を開催します! ▶︎イベント詳細・参加登録はこちら 今回取り上げるサービスは「Zoho Campaigns」です。 「Zoho CRMとZoho Campaignsのどちらからメールを配信すればよいか分からない」 「一斉配信はできるようになったけれど、現在のリスト管理や設定が正しいか不安」 「メールを送るだけで終わり、配信後の改善につなげられていない」
      • Cliq iOS can't see shared screen

        Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
      • Introducing Smart Fields in Zoho Forms

        Hello form builders! We are excited to introduce Smart Fields in Zoho Forms - a faster way to add calculations to your forms without writing formulas. Instead of creating multiple fields and configuring complex calculations yourself, you can now drag
      • Checkbox not displaying correctly in subform

        Greetings: I have shared my app (wv) with support.  I am having problems with a checkbox field not displaying correctly in a subform.  The main form is called volunteers and the subform is called volunteers_subform.  The field in question is called roles. When you access the subform by itself the checkbox lookup displays as checkboxes.  But when you view it in the main volunteers form, it displays as a multi-select dropdown instead.   I have attached jpegs showing the difference.   Any thoughts?
      • Unbundle feature for composite items

        We receive composite items from our vendors and sell them either individually or create other composite items out of them. So, there is a lot of bundling and unbundling involved with our composite items. Previously, this feature was supported in form
      • The reason I switched away from Zoho Notebook

        My main reason for switching to Zoho was driven by three core principles: moving away from US-based products, keeping my data within India as much as possible, and supporting Indian companies. With that intent, I’ve been actively de-Googling my digital
      • Lookups and Custom Modules

        I created a Custom Module that I'm calling "Item Purchasing Group". This module will store information for groups of Items that must be purchased together (including minimum overall quantities and/or values, etc.). This will have a one-to-many relationship
      • Valid characters for use in email addresses using Zoho's apps/APIs

        We have found an issue with the + sign character in zoho subs - we are allowed to create a customer with an email address that has a plus sign but the API doesn't allow the + so the billing portal is not created. We are going to prevent users from using
      • Expand Zoho Analytics Spatial Capabitlities

        Dear Analytics team Thanks for the great product - I'm a big fan on Analytics and the monthly release highlights is one of my favourite emails to receive. I'd like to request expansion and improvement of Zoho Analytics spatial data capabilities, namely:
      • Automate customer follow-ups with Sequences in Bigin

        Greetings, We hope you're all doing well! We're happy to announce a new feature that we've added to Bigin. Following up with every lead at the right time can be challenging, especially when your team is managing multiple conversations across emails, calls,
      • Dashboards for Customers

        Is it possible to build dashboards for each customers in the community for their tickets?
      • Displaying only unread tickets in ticket view

        Hello, I was wondering if someone might be able to help me with this one. We use filters to display our ticket list, typically using a saved filter which displays the tickets which are overdue or due today. What I'd really like is another filter that
      • Adding Custom Status Options in Work Order Action Menu

        Hello FSM Team, We would like to inquire if it is possible to add more custom options in the Work Order action/status dropdown (e.g., Cancel, Terminate, Non-Billable, Void, etc.). Currently, the available options are limited, and we are unable to customize
      • Can we have an automated TDS Receivable Recon with Form 26AS of Income Tax Portal ?

        Can we have an automated TDS Receivable Recon with Form 26AS of Income Tax Portal ?
      • Tag Limi?

        is there any way to create more than 20 tags? 
      • prefill_data for Creator + Merge & Sign

        Hello, Is there an option to use prefill_data for signer fields from creator? I see the option for CRM but it will not work with creator? I have tried passing the value in the signer data, and that also does not work. Alternatively, is there a way to
      • Delug script

        I have been looking at auto-update a amount (home currency) field from another module. Zoho native multicurrency was used in the other module (we have 4 here). Custom script was input with no error, but the field was not updated on trigger. Script as
      • Can I Build a Gaming Website Using Zoho? Need a Quick Roadmap

        Hi Dear Members, I want to create a gaming website using Zoho. Is it possible? My goal is to build a sleek, unique, easy-to-navigate, and fast-loading website for a gaming project. I want the site to look professional, user-friendly, and optimized for
      • Remove Due Date from Statements

        Is it possible to remove the Due Date on the Invoice transation line on statements? I have figured work arounds to get the Invoice detail on the Statement but cannot work out haw to simplify the stament by removing the "- due on xx/xx/2026" - it really
      • What Should an Agent-Native Project Workspace Look Like

        AI is moving beyond assistants that simply answer questions. With tools like MCP, agents can now interact directly with project data and perform actions. That makes me wonder: what should an agent-native project workspace actually look like? For me, it
      • unable to join meeting due to speaker issue

        unable to join meeting due to speaker issue
      • How to add formatting in zoho.cliq.postToUser(...) message?

        In a CRM Deluge function, I'm trying to use the message formatting guidelines given here: https://www.zoho.com/deluge/help/cliq/posting-to-zoho-cliq.html#message-formats My message is: message: #Title text. The result in Cliq is: #Title text. (no large
      • Marketing Tip #50: Sell digital products and use them to grow your store

        Physical products need packaging, shipping, and stock management. Digital products need none of that. Once created, they can be sold an unlimited number of times, delivered instantly, and never go out of stock. What counts as a digital product? A digital
      • Turn off Mobile Optimize

        Hello is it possible to stop the automatic mobile optimization of my site as it looks much better on a mobile in full site format rather than mobile format. Thanks
      • How to select from pricebook when creating a salesorder or quote

        I am creating a sales order and when selecting the Products I do not see any where to select from pricebooks. How do i associate this to my orders?
      • API - Available Stock Definitions

        Okay, Zoho team... your copywriters fell down on the job for this one :) I think these warrant a bit more explanation as to what they include and what they don't.
      • Cross-application Deluge calls fail when application link name starts with a number

        I encountered an issue when calling a custom function in another Zoho Creator application within the same account. The target application’s URL/application link name began with a number, similar to: 27_example_application The following cross-application
      • Transformez vos webinaires en opérations automatisées

        Organiser un webinaire, c’est bien plus que passer en direct. Il faut gérer les inscriptions, suivre les participants, envoyer les enregistrements, mettre à jour le CRM… et s’assurer que chaque étape se déroule au bon moment. L’automatisation des workflows
      • Marketing Tip #1: Optimize item titles for SEO

        Your item title is the first thing both Google and shoppers notice. Instead of a generic “Leather Bag,” go for something detailed like “Handcrafted Leather Laptop Bag – Durable & Stylish.” This helps your items rank better in search results and instantly
      • How can I filter inactive/disable agent tickets?

        Hello, We have an user-agent that left the company and we inactive/disabled his agent. So, now I can no longer filter or search tickets that he is the current owner, or even create a rule to reassign tickets to another person when the ticket is reopen.
      • 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?
      • Add Reauthentication Option for Zoho Bug Tracker Integration in Zoho Desk

        Hello Zoho Desk Team, We hope you're doing well. We would like to request an enhancement to the Zoho Bug Tracker integration within Zoho Desk. Current Limitation: At the moment, there is no option to reauthenticate the Zoho Bug Tracker integration in
      • Create Package From A Picklist

        Dear Zoho, Can it be made possible to create a package from a picklist? The reason our company makes a picklist is for that to become a package Our sales orders have 600-1000 items I hope that makes it clear that it's hard to delete 990 items when we
      • Migrating from Zoho Checkout to Zoho Billing

        I have an active Zoho Checkout account where I'm charging customers for subscriptions. Now I'm looking to upgrade and only use Zoho BIlling, in which my account in on read only mode at the moment. I can see is also tracking the customers and its payments.
      • Step up your lead generation game with online forms

        Hello fellow form builders,   Generating leads for your sales team gets easier when you integrate your CRM with online forms. To help show you how to use forms as part of your lead generation strategy, we have exclusive tips and tricks on how to collect, update and prioritize lead information in Zoho CRM based on form responses.  1. Create new leads If CRM software is designed to help you handle your business easily, that means getting data into it should also be easy. Check out the article on how
      • API - Bank Accounts | Reconciliation Discrepancy

        Unless I'm reading it wrong, the documentation for the Bank Reconciliations API is inconsistent with itself. https://www.zoho.com/books/api/v3/bank-accounts/#create-a-bank-reconciliation The text definition says that the transaction_id should be a string,
      • another little issue

        So to get over showing prices with VAT we used the price lists and made the prices inclusive. The problem is now on the items it wants to show the orginal retail value which makes no sense. Ideas please
      • Next Page