Episode IV:Handling User Inputs in custom functions

Episode IV:Handling User Inputs in custom functions

Hi Everyone,

We've been exploring custom functions which help in performing advanced automation tasks. Custom functions enable you to achieve possibilities based on your organization's requirements. Custom functions require user inputs that allow the function to operate specifically for your organization based on the data provided.

The User Inputs section

Zoho Desk team provides you custom functions in a uniform code format. We have the "user inputs section" at the beginning of most of our custom functions.
The code below demonstrates what the User Inputs section looks like in custom functions. The User inputs section lets you feed in customized inputs based on your organization/portal.
  1. // ----<<<< User Inputs format>>>>----
  2. logs = Map();
  3. deskUrl = "https://desk.zoho.com";  //Replace .com the domain based on your DC
  4. Orgid = "***********" //replace with org ID
  5. cfApiName = "cf_field_name";// replace with the API name of the custom field
  6. departmentId = ***********;// Replace *********** with your department Id
  7. templateId = "enter_the_email_template_id";
  8.  
  9. from_email = "enter_the_from_email_address";
  10. // ----<<<< Code Section >>>>----
  11.  
  12. logs.insert("templateId":templateId);
  13. if(templateId != "")
  14. {
  15. // info templateId;
 
Here's how you can add your portal-based inputs to the custom function:
  1. // ----<<<< User Inputs with data >>>>----
  2. logs = Map()
  3. deskUrl = "https://desk.zoho.au";  //DC is au
  4. Orgid = "10000000x7" //replace with the complete org ID
  5. cfApiName = "cf_country_name";// replaced with the API name of the field Country name.
  6. departmentId = 29x0x0x0x0x0x9;// Replace *********** with your department Id
  7. templateId = "1x3x00xx9x8xxx0x0x";
  8. from_email = "1x4x00xx1x0xxx0x0x";
  9. // ----<<<< Code Section >>>>----
  10. logs.insert("templateId":templateId);
  11. if(templateId != "")
  12. {
  13. // info templateId;

What makes the 'User Inputs' section valuable in custom functions?

Some developers prefer to include user inputs directly within the code in every line.  However, using the dedicated User Inputs section offers several advantages: it keeps your code clean, enhances efficiency, and separates hard-coded values from the logic, making your custom function more manageable and easier to maintain.
In the User Inputs section, you’ll need to replace the sample values or placeholders with actual data. This is necessary because the Arguments option in the Custom Function script provides access to only a limited set of field values. In most cases, inputs such as Org ID, ticket ID, and API names must be entered in the User Inputs section to ensure the function runs correctly and is tailored to your organization/portal.

User Inputs: where to get the required values?

This section explores how to fetch the user inputs required for specific parameters.  These inputs play a key role in helping you code custom functions tailored to your needs. In most cases, they include IDs related to your organization, tickets, custom views, departments, holiday lists, and more; each referring to a unique record ID within the Zoho Desk platform.

1. Zoho Desk Domain

Many user inputs begin with "replace .com based on the your DC".
The easy way to find your DC(data center) or location is from the browser's URL. Login to your Zoho account via this link, your DC is present after accounts. zoho.
For example : deskURL = "https://desk.zoho.com";
If your DC is IN, replace .com with in in the deskURL like this "https://desk.zoho.in"Based on your DC : eu/au/in, replace .com with the respective DC alone.


2. Org ID

To get the Org ID of your Zoho Desk portal, go to Setup >> APIs under Developer Space. You will find the Org ID under the API Plan details.

3. Ticket ID

To get the ticket ID, go to Tickets >> open the ticket for which you want the ticket ID. In the browser's URL, you will find an 18-digit number  after the "/tickets/details/" section, which is the ticket ID of the particular opened ticket.



4. Contact ID

To fetch the contact ID, go to Customers and choose the contact for which you wish to find the Contact ID. In the browser's URL, you will find an 18-digit number at the end of the URL after the "/contacts/details/" section. This is the contact ID for the selected contact.



5. Account ID

To get the Account ID, click on Customers in your Zoho Desk portal, then click on Account on the bottom left of the window. Click on the account for which you want the account ID. Once the account is displayed, the 18-digit number at the end of the browser's URL after "/accounts/details/" is the Account ID for the selected account.


6. Agent ID

To fetch the Agent ID, go to Setup (S) >> User Management >> Agents. You can search the Agent using the Search space on the top left. Select the Agent for detailed view. The 18 digit number in the browser URL at the end after the "/user-control/agents/" is the Agent ID of the selected ID.


7.  Department ID

Navigate to Setup >> Organization >> Departments >> select the department for which you want to fetch the ID. The URL in the browser has the department ID after the "/general/departments/" section.


8. Help Center ID

To fetch the ID of the Help Center, go to Setup >> Channels >> Help Center >> select the Help Center for which you want to fetch the Help Center ID, then click Customization. Now the browser URL will have the 18-digit number between #setup/channels/  <Help Center ID> and /hcCustomize.


9. ID of Business hours

To get the ID for a business hour configured, go to Setup >> Organization >> Business Hours. Select the Business hour to view the Business hour page. The browser's URL will have the business hour ID after "/businesshours/edit/" section.


10. ID of a Holiday list

To get the ID of the Holiday Lists configured, go to Setup >> Organization >> Holiday Lists. Click on the Edit button in the Holiday list to view the Holiday list page. You will find the Holiday list ID next to "/holidaylist/edit/" in the browser URL.


11. Email template ID

Navigate to Setup >> Customization >> Email Templates. Click on the Email template for which you need the ID. Once you've selected the Email template, you can locate the Email template ID in the URL of the email template page. It is found after the "/emailtemplates/edit/" section.
 

12. Custom field API name

When custom functions are triggered based on  a specific field or a custom field created, they require the field's API name to be included in the user inputs.
To fetch the API names, go to Setup >> Customization >> Layouts and Fields >> Field list. You will find the API name for the respective Field Name in the Fields list. 

13. Custom view ID

Some custom functions operate based on a custom view you've created. To execute the custom function based on the custom view within your portal, you'll need the custom view ID.
To fetch the ID of the Custom View, select the Module where you created the Custom View >> Views >> choose the custom view, right click on the page and select inspect. Click on Network in the Inspect tab. Click clear to clear the Network tab. Click Save on the custom view. In the Network console, the first 16 digit number you see is the Custom view ID. Click on the ID to view the headers, you can confirm the ID here.
To fetch the Custom View ID:
  1. Navigate to the module where the custom view was created.
  2. Go to Views and select the desired custom view. Click Edit on the custom view.
  3. Right-click on the page and select Inspect to open the developer tools. Click the Network tab.Click on Click Clear to empty the Network logs.
  4. Now, click Save on the Custom View. In the Network console, look for the first 16-digit number—this is the Custom View ID.
  5. Click on that entry to view the Headers, where you can confirm the ID.
 
With this episode, we bring the custom function series to a close.

Here are the links to visit the previous episodes:

We’d love to hear how these inputs have helped you! If there are any topics you'd like us to focus on, share them in the comments below.
Until the next post, see you soon!
Lydia | Zoho Desk


      • Sticky Posts

      • Register for Zoho Desk Beta Community

        With the start of the year, we have decided to take a small step in making the life of our customers a little easier. We now have easy access to all our upcoming features and a faster way to request for beta access. We open betas for some of our features
      • Share your Zoho Desk story with us!

        Tell us how you use Zoho Desk for your business and inspire others with your story. Be it a simple workflow rule that helps you navigate complex processes or a macro that saves your team a lot of time; share it here and help the community learn and grow with shared knowledge. 
      • Tip #1: Learn to pick the right channels

        Mail, live chat, telephony, social media, web forms—there are so many support channels out there. Trying to pick the right channels to offer your customers can get pretty confusing. Emails are most useful when the customer wants to put things on record. However, escalated or complicated issues should not be resolved over email because it's slow and impersonal.  When you need immediate responses, live chat is more suitable. It's also quick and convenient, so it's the go-to channel for small issues. 
      • Welcome to Zoho Desk Community - Say hello here!

        Hello everyone! Though we have been here for a while, it’s time to formally establish the Zoho Desk Community; we’re really happy to have you all here! This can be the place where you take a moment to introduce yourself to the rest of the community. We’d love to hear all about you, what you do, what company or industry you work for, how you use Zoho Desk and anything else that you will like to share! Here’s a little about me. I am Chinmayee. I have been associated with Zoho since 2014. I joined here
      • Webinar 1: Blueprint for Customer Service

        With the launch of a host of new features in Zoho Desk, we thought it’ll be great to have a few webinars to help our customers make the most of them. We’re starting off with our most talked about feature, Blueprint in Zoho Desk. You can register for the Blueprint webinar here: The webinar will be delivered by our in-house product experts. This is a good opportunity to ask questions to our experts and understand how Blueprint can help you automate your service processes. We look forward to seeing

        • Recent Topics

        • API name for all fields in Zoho Project (Standard or custom)

          Hi! I struggle to find easily all API name of all field in Zoho Project to build my API rest with other services. We can find them very fast in CRM but not in PRoject.   Could you share a function to get the list of all API Name of any field of an App
        • Elevate your CX delivery using CommandCenter 2.0: Simplified builder; seamless orchestration

          Most businesses want to create memorable customer experiences—but they often find it hard to keep them smooth, especially as they grow. To achieve a state of flow across their processes, teams often stitch together a series of automations using Workflow
        • Zoho Assist not rendering NinjaTrader chart properly

          Hi everyone. Just installed and testing Zoho Assist. I want to display my laptop' screen (Windows 11) on a monitor connected to my Mac mini. The laptop is running a stock trading program called NinjaTrader. Basically, when running, this program displays
        • Involved account types are not applicable when create journals

          { "journal_date": "2016-01-31", "reference_number": "20160131", "notes": "SimplePay Payroll", "line_items": [{ "account_id": "538624000000035003", "description": "Net Pay", "amount": 26690.09, "debit_or_credit": "credit" }, { "account_id": "538624000000000403", "description": "Gross", "amount": 32000, "debit_or_credit": "debit" }, { "account_id": "538624000000000427", "description": "CPP", "amount": 1295.64, "debit_or_credit": "debit" }, { "account_id": "538624000000000376", "description":
        • Adding Social Media Buttons to Basic Campaigns

          Hi, I'm quote new to using Zoho Campaigns and I can't work out how to add Social Media Buttons into my basic campaign? In MailChimp there's a button that brings the icons into your campaign for you. I've tried adding the social media icons as 'buttons' in Zoho but it's not looking great. Can anyone help? Thanks!
        • Dropshipping Address - Does Not Show on Invoice Correctly

          When a dropshipping address is used for a customer, the correct ship-to address does not seem to show on the Invoice. It shows correctly on the Sales Order, Shipment Order, and Package, just not the Invoice. This is a problem, because the company being
        • Best way to schedule bill payments to vendors

          I've integrated Forte so that I can convert POs to bills and make payments to my vendors all through Books. Is there a way to schedule the bill payments as some of my vendors are net 30, net 60 and even net 90 days. If I can't get this to work, I'll have
        • Link(s) between Notes

          Hello Everyone, It would be great if links could be created between notes. Let's say we have 5 Notes A, B, C , D, E. I would like to be able to link Note A to Note B but not in other way, so no link appears in Note B linking to Note A. An so on, linking
        • Regex in Zoho Mail custom filters is not supported - but it works!

          I recently asked Zoho for help using regex in Zoho Mail custom filters and was told it was NOT supported. This was surprising (and frustrating) as regex in Zoho Mail certainly works, although it does have some quirks* To encourage others, here are 3 regex
        • Feature Request: Assign Documents to Already Entered Bills, Expenses, Invoices, etc.

          Hi Zoho Team, We are regular users of the Documents module in Zoho Books and appreciate its ability to keep financial records well-organized. However, we’ve noticed a limitation: There is no way to attach a document from the "Documents > Files" section
        • I don't see any WITHDRAWL transaction at all

          Hi I manually imported my bank statement to Zoho books today and I am a complete newbie. I have been reading the knowledgebase but unable to fix this. I only see "Uncategorized 91 DEPOSIT transactions". I don't see any WITHDRAWL transaction at all. Also,
        • Shared inbox unable to see replies

          Hi we are a small company me and someone else, we have a shared inbox for our sale@ and contact@ however we have this issue where by if i reply to an email or the other person reply to the email, it does not show it to them and therefore we end up replying
        • Zoho Books | Product updates | August 2025

          Hello users, We’ve rolled out new features and enhancements in Zoho Books. From the right sidebar where you can manage all your widgets, to integrating Zoho Payments feeds in Zoho Books, explore the updates designed to enhance your bookkeeping experience.
        • Kaizen #136 - Zoho CRM Widgets using ReactJS

          Hey there! Welcome back to yet another insightful post in our Kaizen series! In this post, let's explore how to use ReactJS for Zoho CRM widgets. We will utilize the sample widget from one of our previous posts - Geocoding Leads' Addresses in ZOHO CRM
        • 404 error at checkout

          Our customers are getting a 404 error at checkout. Anyone else with the same problem?
        • FONT Sizing in Notebook

          Hi Kishore - What is the status of adding font sizing to the application? I have several things that I have pasted directly into Notebook and the fonts are HUGE! I would like the ability to highlight them and reduce the font to a legible size. Nothing
        • Can managers Upload documents to their direct rapports?

          Admin employees have the ability to upload documents to employees' files; however, managers do not have add/manage button - is it possible for managers to upload their direct reports' documents, such as absence documents or 121 documents. Is there something
        • Leave balance display for next year

          Is there a way to not have a rollover or not limit the leave balance depending on the date. For example an employee has 10 days leave balance and wants to apply for January leave in December. They cant because the rollover doesnt show the leave balance
        • Please add an “Auto-Apply Unused Credits” toggle

          Hello — please add a simple org-level option to automatically apply unused credits (credit notes, excess payments, retainers) to new invoices and/or bills. An ON/OFF toggle with choices “invoices”, “bills”, or “both” would save lots of manual work for
        • Zoho Books not working/loading

          Hi! I haven't been able to access/load Zoho Books for the past hours. I get a time out (and it is not due to my internet connection). Could you please check this asap? Thank you!
        • Custom Fields with Data Types for Expense and Payments Received in Zoho Books

          Hi all, We are glad to present to you, the option to create Custom Fields for the Expense and Payments received modules in Zoho Books. This also comes with an icing on top of it - Yes, the custom fields can now be created with different data types. Types like Text, Number, Decimal, Amount, Auto Number and Check Box are supported as of now. Rush to the gear icon at the top right corner, select 'More Settings', choose 'Preferences' in the left pane. Click the Expense/Payment preferences where you can
        • [Webinar] Automate sales and presales workflows with Writer

          Sales involves sharing a wide range of documents with customers across the presales, sales, and post-sales stages: NDAs, quotes, invoices, sales orders, and delivery paperwork. Generating and managing these documents manually slows down the overall sales
        • Zoho Cliq - Incident alert (Server outage - IN DC) | August 28

          We've received server down alerts and are currently investigating the issue (IN DC) to find the root cause. Our team is actively working to restore normal operations at the earliest. Status: Under investigation Start time: 09:44:21 AM IST Affected location:
        • Claude + MCP Server + Zoho CRM Integration – AI-Powered Sales Automation

          Hello Zoho Community 👋 I’m excited to share a recent integration we’ve worked on at OfficehubTech: ✅ Claude + MCP Server + Zoho CRM This integration connects Zoho CRM with Claude AI through our custom MCP Server, enabling intelligent AI-driven responses
        • How can I see content of system generated mails from zBooks?

          System generated mails for offers or invices appear in the mail tab of the designated customer. How can I view the content? It also doesn't appear in zMail sent folder.
        • Limitations on editing a message in Cliq

          Hi I've checked the documentations and there's no mention of how many times a message can be edited. When trying with code, I get various numbers such as ~1000 edits or so. Please mention if there's a limit on how many times one can change a message via
        • Problem with reports due to "Connected" items change - Yes this IS a problem

          Now that the change has been made to use "connected" items I can no longer run the reporting I need in CRM. I should be able to start with Deals as the parent, connect down to the Account (Account_Name) on the deal as the child, then to any child items
        • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

          Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
        • Narrative 10: Assignment Rules - Streamlining Ticket Management

          Behind the scenes of a successful ticketing system: BTS Series Narrative 10: Assignment Rules - Streamlining Ticket Management In the complex world of customer support, a flood of incoming tickets can hit the help desk in seconds. Businesses must do more
        • Free webinar! Digitize recruitment and onboarding with Zoho Sign and Zoho Recruit

          Hello, Tired of being buried in onboarding paperwork? With the integration between Zoho Sign and Zoho Recruit, a powerful applicant tracking system, you can digitize and streamline the entire recruitment and onboarding process, all from one platform.
        • Custom form - Duplicate Value Present

          I am new to Zoho People. I create a new form on Zoho People quite simple. A date (by default the current date) and a radio button with 3 options (Yes, No, Not applicable) I defined the date as ‘No duplicate’ as only one entry by date is allowed. I added:
        • Zoho API connection issues

          Hi, Today at around 1930 GMT our application started experiencing intermittent timeouts from the Zoho API. These intermittent timeouts are not enabling our app to work properly. The API connection was working just fine before. HTTPSConnectionPool(host='www.zohoapis.com',
        • Query Regarding our Partnership between AIC-JKLU and Zoho

          Dear Zoho Team, I am writing to raise a concern on behalf of AIC-JKLU, one of Zoho’s incubator partners. Recently, our startups have been facing difficulties while trying to get themselves onboarded on Zoho through our dedicated partner link. Unfortunately,
        • Getting events in the future

          Hi I am trying to get events in the future by calling this API Endpoint https://www.zohoapis.eu/crm/v8/Events?fields=Event_Title,Created_By,Created_Time,Start_DateTime But that gives me all events in the database. How do I make a query that returns all
        • Created Date/Invalid Fields

          Since Saturday we have suddenly had issues with our webhooks and data retrieval from CRM. Specifically how Created Date is handled. It appears there was some sort of change within CRM that broke a lot of our code that has been in place for several years.
        • Problem for EU users connecting Zoho CRM through Google Ads for Enhanced conversions

          Has anyone else experienced this problem when trying to connect Zoho CRM through Google Ads interface to setup enhanced conversions? Did you guys get it fixed somehow? The Problem: The current Google Ads integration is hardcoded to use Zoho's US authentication
        • integration zoho form - drive

          I integrated my form with Google Drive. The report of user submissions from the Google Form becomes a Google Sheets table. When I used Google Forms for the same task, the summary sheet adapted to the form. For example, if I added a new field to the form,
        • Revenue Management: #9 Revenue Recognition in Media & Publishing

          Media & Publishing industry has evolved in recent times. It offers subscriptions, bundles digital and print access, runs sponsored content, and sometimes even sells ad spaces. If you run a media or publishing business, you will always get into a situation
        • Zoho CRM Community Digest - July 2025 | Part 2:

          Hello, Everyone! We’re closing out July with a can’t-miss highlight: Zoholics Europe 2025! Happening from September to October, it’s your chance to level up your CRM skills, covering everything from automation and CPQ to dashboards and advanced workflows.
        • How can I trigger a flow action only once while updating contact?

          Hi, we have a trigger to merge&mail file when the field YYY is filled out. For this acion I used "Create or update module entry". But unfortunately we get tens of email on a day with this merged file, because the contact is being regularly updated. The
        • Next Page