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

    • Unable to enable tax checkboxes

      Hi Zoho Commerce Support, I'm writing to report an issue I'm having with the tax settings in my Zoho Commerce store. I've created several tax rates under Settings > Taxes, but all of them appear with the checkbox disabled. When I try to enable a checkbox,
    • Does Zoho Learn integrate with Zoho Connect,People,Workdrive,Project,Desk?

      Can we propose Zoho LEarn as a centralised Knowledge Portal tool that can get synched with the other Zoho products and serve as a central Knowledge repository?
    • Zoho Commerce - Enable Company Name and Tax Number collection for B2B orders in Global Edition

      Please enable Company Name and Tax Details option on checkout settings in Zoho Commerce Global Edition. It is still important to collect Company Name and Tax Number for B2B sales in many countries. My business is based in Ireland (in the EU) and I have
    • ZohoSign and ZohoBooks Integration/Workflow

      Hello All, We utilize ZohoSign for signatures on tax eFiles. We utilize Dynamic KBA. Additionally, we use ZohoBooks for invoicing for these services. Is there a way to accomplish the following: Send a copy of the Tax Return, Invoice and eFiles in one
    • Manage monthly tasks with projectsf

      Hi All I run a finance and operations team where we need both teams to complete monthly tasks to ensure we hit our deadlines. Can Zoho projects be used for this. There many finance focused tools but we have Zoho one so want to explore Thanks Will
    • Zoho Suite is very slow

      Since today Zoho is incredibly slow over all applications! What's going on?
    • Field Dependency Not Working on Detail Page in Zoho Desk

      Hi Support Team, I’ve created field dependencies between two fields in Zoho Desk, and they are working correctly on the Create and Edit layouts. However, on the Detail page, the fields are not displaying according to the dependencies I’ve set — they appear
    • Is anyone else having trouble saving a custom image in their email signature, or is it just me?

      When I try to save the image I get an error that says "Operation Failed" I opened a support ticket two weeks ago and received a response that it would be debugged, but it still isn’t working
    • Combine and hide invoice lines

      In quickbooks we are able to create a invoice line that combines and hides invoices lines below. eg. Brochure design         $1000 (total of lines below, the client can see this line) Graphic Design           $600 (hidden but entered to reporting and
    • Option to Disable Knowledge Base Section in Feedback Widget Popup Hello Zoho Desk Team

      Hello Zoho Desk Team, How are you? We are actively using Zoho Desk and would like to make more use of the Feedback Widget. One of the ways we implement it is through the popup option. At the moment, the popup always displays the Knowledge Base section,
    • Transaction Locking with the dynamic date

      Is it possible to dynamically update dates on transaction locking. We want to lock transaction x days from today
    • Zoho Devops

      We have a Zoho one account which we have integrated with an SAS educational product, sold on a subscription model, using webhooks and API calls. We make some use of custom fields and cross module lookups and relationships. We utilize CRM, Books and billing
    • Fuel up your sales with the Zoho SalesIQ + Bigin integration

      Hi everyone! We’re happy to bring you the all-new Zoho SalesIQ + Bigin integration. With this, every prospect from your website instantly becomes a contact in Bigin, complete with transcripts and follow-up tasks, so you never lose a lead again. Let's
    • Dealing with API responses where integers have more than 16 digits

      Hi there How do I deal with an api response contaning an int or float with more than 16 digits (before any decimal places for a float). I constantly receive the response "Unable to cast the 'BigInteger' value into a 'BIGINT' value because the input is
    • Add a 'Log a Call' link to three dot icon in Canvas

      Hi, There's a three dot element when creating a canvas called 'More'. I would like to modify this to add a link that says 'Log a Call' in order to quickly record the details of a cellphone call. I'd also like this to be a simple 'contact' selection and
    • Collaps Notes

      There are times when long/large notes are added to a record i.e. Accounts or Deals etc. Currently, the full note is displayed in the notes related list section. It would be great if by default only 5 to 10 rows of the note are displayed when the note
    • Introducing AI-powered Assessments & Zoho's native LLM, Zia

      We’ve shipped a cleaner, faster way to create assessments in Zoho Recruit. 🚀 Instead of manually building question banks or copying old templates, you can now generate ready-to-use assessments in just a few clicks, all tailored to the role you’re hiring
    • Ability to Reset Visitor Fields During an Active Chat Flow

      Hello Zoho SalesIQ Team, We hope you are doing well. We would like to propose a feature enhancement to Zoho SalesIQ regarding the management of visitor fields within Zobot flows. Use Case: Our bot asks the visitor to provide information about a 3rd person
    • The Social Wall: August 2025

      Hello everyone, As summer ends, Zoho Social is gearing up for some exciting, bigger updates lined up for the months ahead. While those are in the works, we rolled out a few handy feature updates in August to keep your social media management running smoothly.
    • External ID in Zoho CRM

      Hello everyone! We know that Zoho CRM allows you to integrate third-party apps and manipulate data through APIs. While you integrate a third-party application, you may want to store the third-party reference IDs in Zoho CRM's records. To meet this need
    • New in Zoho Chat : Search for contacts, files, links & conversations with the all new powerful 'Smart Search' bar.

      With the newly revamped 'Smart Search' bar in Zoho Chat, we have made your search for contacts, chats, files and links super quick and easy using Search Quantifiers.   Search for a contact or specific conversations using quantifiers, such as, from: @user_name - to find chats or channel conversations received from a specific user. to: @user_name - to find chats or channel conversations sent to a specific user. in: #channel_name - to find a particular instance in a channel. in: #chat_name - to find
    • Aggregating the First Value in the Group By of a dataset

      Hi I am trying to get the following Aggregate Formula to work in my chart, but cannot seem to get the right format. I have a series of data that I am running an include_groupby and want to SUM only a column in the first row of each group. So for example.
    • New in Cadences: Option to Resume or Restart follow-ups when re-enrolling records into a Cadence, and specify custom un-enrollment criteria

      Managing follow-ups effectively involves understanding the appropriate timing for reaching out, as well as knowing when to take a break and resume later, or deciding if it's necessary to start the follow-up process anew. With two significant enhancements
    • Is it possible for contacts to "Re-enter" a workflow in Zoho Campaign?

      We are currently working on a way to automatically add users to from one list to other lists based on specific criteria, but can't seem to find a native way of doing this so we are trying to use Workflows to do this. So, for example, if a user's status is set to "Active," then they should be added to the list "Active Users." If the same user's status is then set to "Paused," they should be added to the list "Paused Users" and removed from the list "Active Users." This works fine for the first go
    • Admin Control Over Profile Picture Visibility in Zoho One

      Hello Zoho Team, We hope you are doing well. Currently, as per Zoho’s design, each user can manage the visibility of their profile picture from their own Zoho Accounts page: accounts.zoho.com → Personal Information → Profile Picture → Profile Picture
    • How can I track which zoho users are actively using Zoho CRM

      I have several licenses of Zoho CRM. We now need to add a new user. I could purchase a new license, but before I do, I would like to see if any of our existing users are not actively using the license assigned to them. How can I determine the activity
    • Seriously - Create multiple contacts for leads, (With Company as lead) Zoho CRM

      In Zoho CRM, considering a comapny as a lead, you need us to allow addition of more than one contact. Currently the Lead Section is missing "Add contact" feature which is available in "Accounts". When you know that a particular lead can have multiple
    • Track Zoho Campaign and Workflow sales impact

      I am attempting to measure the performance of our marketing workflows and campaigns by comparing the date each campaign was sent to a contact with the purchase date of the contact. For example, if Contact A was sent Email A on 9/1 and made a purchase
    • Zoho / Outlook Calendar sync

      The current Marketplace -> Microsoft -> Meetings integration needs 2 changes. 1. The current language for the Two-Way sync option should be changed. It currently states, "Sync both your Zoho CRM Calendar and Office 365 Calendar meetings with each other."
    • Tables for Europe Datacenter customers?

      It's been over a year now for the launch of Zoho Tables - and still not available für EU DC customers. When will it be available?
    • What is a line break code for zoho?

      Hi, I am archiving data by adding values from a single line field from one form to a multi-line field in another form. So I need a code/function that starts a new line on that multi-line field so it does not just keep adding it on the same line. Example, doing something like this means that it will be on a same line. archive.field1 = archive.field1 + input.Field1 I need a code so the input.Field1 can just start on the next line. Instead of "value 1, 2,3,4,5" It will be: "1 2 3 4 etc.".  something
    • Automatic Project Owner change

      Is there a way to change Project Owner automatically once a specific Milestone in a project is marked as completed. Different Teams are working on projects in our Org, they have their own Milestones to complete and so we transfer the project from team
    • Button to add product to cart

      Is there a way to have a button on a page, that when clicked, will add Qty 1 of a product to the cart?
    • Problem with Submit Button Design

      I have made a template to apply to my forms and under the button controls, I have it set to "standard" and yet it's still filling the container. This is super frustrating and looks weird. Why do we not have full control over button size? How can I fix
    • Zoho CRM- Authorize your Microsoft Teams account issue

      Hi, I tried to link Zoho CRM with Teams and I got the following message: Clicking "Authorize now" sent me to the following page, Microsoft tried to start a session but, after 3 seconds the page closed and nothing happened. I get the same message each
    • Passing the CRM

      Hi, I am hoping someone can help. I have a zoho form that has a CRM lookup field. I was hoping to send this to my publicly to clients via a text message and the form then attaches the signed form back to the custom module. This work absolutely fine when
    • Is there a way to associate an email in ZOHO Main to a Vendor record in ZOHO CRM

      My situation is as below, I have a vendor in ZOHO CRM lets say "Vend A" and an associated contact, "Cont A" If Cont A sends me an email using the email I've registered in the contact record the standard OOTB email sync will work. But the vendor has some
    • Adding a developer for editing the client application with a single user license

      Hi, I want to know that I as a developer I developed one application and handed over to the customer who is using the application on a single user license. Now after6 months customer came back to me and needs some changes in the application. Can a customer
    • Kaizen #207 - Answering your Questions | Advanced Queries using COQL API

      Hi everyone, and welcome to another Kaizen week! As part of Kaizen #200 milestone, many of you shared topics you would like us to cover, and we have been addressing them one by one over the past few weeks. Today, we are picking up one of those requests
    • Présentation de SecureForms dans Zoho Vault

      Soyons francs : demander à quelqu’un de transmettre un mot de passe ou des informations sensibles n’est jamais une tâche facile. On attend, on relance, parfois de nombreuses fois. Et quand l’information arrive, elle se retrouve souvent dispersée dans
    • Next Page