Hello everyone!
Welcome back to the Kaizen series!
Many organizations manage workforce data such as employee designations, contact details, salary bands, and joining dates in an HRMS backed by Microsoft SQL Server, while their sales teams work in Zoho CRM. When a deal needs an assigned pre-sales engineer or a CSM hand off, reps must leave CRM, open the HR portal, and manually look up the right person.
This post shows how to use the Queries feature in Zoho CRM to connect to a Microsoft SQL Server database, fetch employee records with a parameterized SQL query, and display them directly on a Deal Canvas without leaving CRM. We will cover source creation, SSL and Read-Only configuration, writing the query, serializing the response, and a brief overview of how the same query can be reused across Canvas, Custom Related List, and Kiosk.
Prerequisites
- Zoho CRM Enterprise or Ultimate edition (SQL sources require Enterprise or above)
- A running Microsoft SQL Server instance with a database user that has SELECT privileges on the EMPLOYEE table
- The SQL Server instance must be reachable from Zoho CRM either publicly or Zoho CRM IP ranges must be whitelisted in the firewall rules
- The SQL Server hostname must be added to Trusted Domains in Zoho CRM (Setup > Developer Hub > Trusted Domains) if using a DNS hostname
- Developer role or System Administrator access in Zoho CRM
- A custom "Employee ID" field (Single Line) on the relevant CRM module (e.g., Deals or Contacts) to store the external employee reference if passing a single employee ID as a variable. Not required if the query fetches the full list (no variable).
Use Case
Sales reps at a professional services firm need to assign internal team members (solutions engineers, CSMs) to deals, but employee contact and designation data lives only in a Microsoft SQL Server HRMS requiring a manual lookup outside CRM every time.
Solution
Connect Zoho CRM Queries to the HRMS database. A parameterized SELECT on the EMPLOYEE table filtered by {{EMP_ID}}, resolved from a custom field on the Deal record, fetches the assigned employee's profile and displays it on the Deal Canvas in real time.
Follow the steps to implement this solution.
Step 1: Whitelist Zoho CRM IPs in SQL Server Firewall
Before creating the source in Zoho CRM, ensure the SQL Server instance can accept inbound connections from Zoho CRM's servers.
- The SQL Server instance must be accessible over the internet on port 1433 (SQL Server default).
- Zoho CRM's IP ranges must be whitelisted in the firewall rules governing the SQL Server. Refer to the Zoho CRM IP Whitelist guide for the full list of IP ranges for your data center.
- Ensure SQL Server Browser service is running and TCP/IP is enabled in SQL Server Configuration Manager.
- If the SQL Server uses a DNS hostname, also add it to Setup > Developer Hub > Trusted Domains in Zoho CRM.
Step 2: Create a Dedicated Read-Only SQL Server Login
On your SQL Server instance, create a login with the minimum permissions needed.
Do not use 'sa' (SQL Server's built-in System Administrator login) or any admin account. 'System Administrator login has unrestricted access to all databases and server settings.
Step 3: Add Microsoft SQL Server as a Database Source
- In Zoho CRM, go to Setup > Developer Hub > Queries.
- Click the Sources tab.
- Click Add Source.
- From the list of source types, select Database.
- From the available database options, choose MicrosoftSQL.
- Fill in the source configuration as shown in the following image.

Step 4: Configure Advanced Settings
Expand the Advanced configuration section before saving.
Use SSL
Enable the Use SSL toggle. This action,
- Encrypts the connection between Zoho CRM and SQL Server using TLS.
- When a DNS hostname is used, the system also validates the server certificate and hostname match before establishing the connection.
- SQL Server supports SSL/TLS natively. Ensure the SQL Server instance has a valid TLS certificate configured or that the certificate is trusted by the host.
Note
- The SSL setting is IMMUTABLE after the source is successfully created. If your SSL configuration needs to change, you must delete and recreate the source.
- If you add the hostname to Trusted Domains, the system bypasses certificate and hostname verification. Only add genuinely trusted hosts.
Read Only
Enable the Read Only toggle. This action,
- Restricts this source to only SELECT operations at the Zoho CRM level.
- Blocks INSERT, UPDATE, and DELETE queries even if the zoho_crm_reader SQL login is later granted write permissions at the database level.
Since this source is used purely to display employee information in CRM views, you must enable Read-Only.
You can change this setting after the source is created, unlike SSL.
Time Zone
Set Time Zone to match the time zone of your SQL Server instance (e.g., UTC, or the server's local time zone).
The DATE_OF_JOIN and MODIFIED_ON columns are stored as DATETIME in SQL Server (without time zone information). Setting the correct source time zone allows Zoho CRM to convert these values to each viewing user's local time zone for accurate display.
Example: If the server stores MODIFIED_ON = 2026-04-15T18:30:00 in IST, a user in UTC will see 2026-04-15 13:00.
Connection Timeout
Set Connection timeout to 10 seconds. This action defines how long Zoho CRM waits for the SQL Server to accept the connection before giving up.
10 seconds accommodates typical network latency while preventing the CRM UI from hanging indefinitely during server downtime or network issues.
Click Validate and Save.
Zoho CRM tests the connection. On success, the source is saved and available for queries.
Step 5: Create the Query
- Go to Setup > Developer Hub > Queries.
- Click Create Query.
- In the dialog box enter the name of the query.
- Click Next.
- Under Configuration, click Change and select the source we added.
- Click Done.

Step 6: Write the SQL Query
In the query editor, enter the following query.
SELECT EMP_ID,EMP_FIRST_NAME,EMP_LAST_NAME,EMP_GENDER,EMP_EMAIL,EMP_PHONE,EMP_DESIGNATION,EMP_SALARY,DATE_OF_JOIN,MODIFIED_ON FROM EMPLOYEE WHERE EMP_ID = {{EMP_ID}} ORDER BY EMP_FIRST_NAME |
Zoho CRM automatically detects {{EMP_ID}} as a query variable. At runtime, the value of the "Employee ID" custom field on the Deal record is passed to this variable.
Step 7: Execute and Validate the Query
- Click Execute Query.
- Enter a valid employee ID from your SQL Server database.
- Click Next.
- Review the raw response.
- Review the Schema panel and verify CRM Field Type mapping.

Step 8: Add a Serializer
The serializer combines the first and last name, formats dates, and computes the employee's tenure.
- Click Add Serializer.
Enter the following JavaScript.
return result.map(record => { // Compute tenure in years from DATE_OF_JOIN const joinDate = new Date(record.DATE_OF_JOIN); const today = new Date(); const tenureYears = Math.floor( (today - joinDate) / (1000 * 60 * 60 * 24 * 365) );
return { emp_id: record.EMP_ID, full_name: record.EMP_FIRST_NAME + " " + record.EMP_LAST_NAME, gender: record.EMP_GENDER, email: record.EMP_EMAIL, phone: record.EMP_PHONE, designation: record.EMP_DESIGNATION, date_of_join: record.DATE_OF_JOIN ? String(record.DATE_OF_JOIN).split("T")[0] : "N/A", tenure: tenureYears + (tenureYears === 1 ? " year" : " years"), last_modified: record.MODIFIED_ON ? String(record.MODIFIED_ON).split("T")[0] + " " + String(record.MODIFIED_ON).split("T")[1].slice(0, 5) : "N/A" }; }); |
This serializer:
- Combines EMP_FIRST_NAME and EMP_LAST_NAME into a single full_name field
- Computes tenure in years from DATE_OF_JOIN to today, a derived field not stored in the database
- Formats date_of_join as YYYY-MM-DD (strips the time component)
- Formats last_modified as YYYY-MM-DD HH:MM.
Click Execute Query again to preview the serialized output.
Click Save to save the query.
Conclusion
The Queries feature in Zoho CRM makes it straightforward to surface employee records from an external Microsoft SQL Server HRMS directly within CRM without any middleware, scheduled sync, or manual copy-paste. The advanced configuration options (SSL, Read-Only, Time Zone, Connection Timeout) ensure the connection is secure, non-destructive, and accurate across time zones.
With a single parameterized query and a lightweight serializer, sales reps can see the full profile of an assigned employee such as designation, contact info, tenure etc., right on the Deal Canvas when they need it most. The same query can be reused across multiple CRM UI components for different team workflows.
This approach is best suited when:
- The employee data is authoritative in an external HRMS and should not be duplicated into CRM fields.
- Real-time accuracy matters (recently onboarded or transferred employees are immediately visible).
- The organization wants to avoid building and maintaining a custom sync integration.
Associating the query with CRM's UI components
You can associate a query with multiple UI components such as Canvas, Kiosk, Custom Related Lists based on the workflow.
Canvas List View
Associate the query with the Canvas List View of the Deals (or Contacts) module.
Map {{EMP_ID}} to the "Employee ID" custom field on the record. When a sales rep opens a Deal, the assigned employee's full profile, including name, designation, phone, email, tenure etc., appears as an "Assigned Employee" panel on the canvas. Refer to our Kaizen post for associating a query with Canvas List View.
Kiosk
Associate the query with a Kiosk Decision component to build an internal lookup screen, say a self-service screen, where a sales rep types an Employee ID, and the Kiosk fetches and displays that employee's profile from the HRMS. The Decision component evaluates the query response (e.g., checking if EMP_DESIGNATION matches a required role) and branches the Kiosk flow accordingly.
Map {{EMP_ID}} to a Kiosk input variable collected in a preceding Screen component.
Custom Related List
Use a modified version of the query (filtered by ACCOUNT_ID instead of EMP_ID) to display a related list of all employees assigned to a given account on the Account record. This is useful when multiple internal team members like solutions engineers, CSMs, support contacts, are mapped to an account in the HRMS.
Map {{ACCOUNT_ID}} to the Account record's identifier during association, and the related list will show all employees assigned to that account, updated automatically as the HRMS changes.
For step-by-step instructions on associating a query with a Custom Related List, refer to this Kaizen post.
We hope you found this post useful.
Cheers!
=================================================================================
Recent Topics
#20 Your Business Shouldn't Stop Just Because You Do
Imagine you are on a well-deserved vacation. Your clients are expecting invoices at the beginning of the month, recurring customers are due for billing, and payments are still coming in. Do you carry your laptop everywhere, hoping you don't miss a billing
Marketing Tip #26: Optimize product images for SEO
Product images can do more than make your store look good. They can also help customers discover your products through search. Since search engines can’t "see" images, they rely on text signals to understand what an image is about. Two small actions make
Automation Series: Mandatory Time Logging Before Task Closure
In a project, when users work on multiple tasks simultaneously, they track time in different ways, either by starting a timer or by adding a time log. Sometimes users may forget to add time, which can lead to discrepancies in the timesheet. When timesheets
Is there a way to show contact emails in the Account?
I know I can see the emails I have sent and received on a Contact detail view, but I want to be able to see all the emails that have been sent and received between all an Accounts Contacts on the Account Detail view. That way when I see the Account detail
Zoho CRM gets a new email compose and lot more
Dear Customers, [UPDATE October 21, 2021: We have started opening these features to some of the customers already. And, it will be available to all the customers before November 2nd Week, 2021. Sorry for the delay caused] [UPDATE February 21, 2022:
CRM gets location smart with the all new Map View: visualize records, locate records within any radius, and more
Hello all, We've introduced a new way to work with location data in Zoho CRM: the Map View. Instead of scrolling through endless lists, your records now appear as pins on a map. Built on top of the all-new address field and powered by Mappls (MapMyIndia),
Introducing document visibility in Zoho Sign
Hello! Complex document workflows often involve multiple stakeholders with different roles. Sending a separate envelope to every person is time consuming and can lead to administrative bottlenecks. With Zoho Sign's document visibility feature, you can
Sent email stuck on processing
My sent emails are stuck on processing, whats going on?
[Webinar] What's new in Zoho Analytics: Q2 2026
Hey data lovers! Our What's New webinar series is bringing you another lineup of exciting features and product enhancements from the past quarter, all designed to help you get more out of your analytics. Get an inside look at new data connectors, Zoho
Alterar número de telefone para receber o código OTP
Boa tarde! Como posso alterar o número de telefone da minha conta para aceder ao meu email corporativo? Estou tentando logar, mas não consigo, pois está sendo enviado o código OTP para o número antigo, preciso aceder urgente meu email, porque e de trabalho.
CRM x WorkDrive: We're rolling out the WorkDrive-powered file storage experience for existing users
Release plan: Gradual rollout to customers without file storage add-ons, in this order: 1. Standalone CRM 2. CRM Plus and Zoho One DCs: All | Editions: All Available now for: - Standalone CRM accounts in Free and Standard editions without file storage
Request to Increase URL Field Character Limit
Hi Arthi, Hope you are doing well. I'm trying to save a URL in the Work Order (WO) module using the URL field, but I receive the following error message: "Please enter a valid Repair File. Maximum 450 characters are allowed." The issue is that the URL
How to change column headings in pivot table?
Hi, Is there a way to rename the column headers of a pivot table? Now some the columns are named with value labels: 'SUM of .....'. We would like to rename those headers. As of now we couldn't find any direct solution to adjust the headers, besides copying and reformat. We want to avoid these extra steps. Best, Tiemen
Undelivered Mail
I suspect that there are recipient's servers that blocks my emails. I receive the following email from mailer-daemon@mail.zoho.eu : A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. pantelis.sarantos@unipakhellas.gr,
Email not loading on PC
Hello, my email opens on but it doesn’t load on PC. I don’t have other issues with the email, all the configurations are ok and I face with following issue in the photo. It says “ mail.zoho.com refused to connect” I will be very thankful if anyone can
Why are bounce/error emails being sent to info@ instead of contact@?
I have my Zoho Mail and WordPress site configured so that normal website emails should go to contact@hybridbatteryservice.com. However, I keep receiving technical bounce/error emails and delivery failure notifications at info@hybridbatteryservice.com
Do Not Disturb status not respected when Cliq bar is enabled across Zoho apps
Hi Zoho Cliq team, I want to report what appears to be a bug with how the Do Not Disturb status interacts with the embedded Cliq bar in other Zoho apps. **Issue:** When my Cliq status is set to Do Not Disturb, I continue to receive notification tones
Zoho Webinar Summer Broadcast 2026
What if your webinar platform could connect directly with your business tools, automate routine tasks, trigger actions across your workflows, and support every stage of your webinar lifecycle? That’s the question we’ve been answering so far this year.
Invalid request when trying to access Mail
When I click on the red button to access Zoho Mail at https://mail.zoho.com/zm/, I get a big yellow warning triangle with "invlid request, The input passed is invalid or the URL is invoked without valid parameters. Please check your input and try ag
Whats the average response time for ticket submitted?
I submitted a request to unblock my mail accounts. They seem to be blocked for outgoing mail, and I have been waiting for days to have this fixed with no reply. I have submitted 2 tickets and an email. My work has to completely stop. I pay for the service
All new Address Field in Zoho CRM: maintain structured and accurate address inputs
Availability Update: 29 September 2025: It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition exclusively for IN DC users. 2 March 2026: Available to users in all DCs except US and EU DC. 24
Is there any way to have Dataprep ingest RSS?
As stated by the title. Does the Zoho environment offer tools that I can use to, directly or using workarounds, have Dataprep ingest an RSS feed? Thanks
Introducing Color Coding of Picklist Values
Dear Everyone, Greetings!! Zoho CRM is uplifting the user experience. Recently, we had some notable aesthetic improvements in CRM like Kanban View UI enhancement, New List view UI enhancement, color coding of tags, and color coding of picklists in meetings.
Important updates to your Widget JS APIs
Hello everyone, Greetings from Zoho Creator! This is an urgent notice for developers and Partners who use widgets in their Zoho Creator applications. We previously announced an update to the CDN URLs used for loading the Widget JS API, with a deadline
Deluge sendmail in Zoho Desk schedule can't send email from a verified email address
I am trying to add a scheduled action with ZDesk using a Deluge function that sends a weekly email to specific ticket client contacts I've already verified the email address for use in ZDesk, but sendmail won't allow it in its "from:" clause. I've attached
Mailbox delegation “Send As” error
I believe there may be an issue with mailbox delegation. When I create a delegation from the Admin Console, it works correctly if I select Read permissions. However, if I select Send As permission for the delegated user, I immediately receive the following
Restrict Zoho Cliq Webinars and Announcements to Admins Only
Hi Zoho Team, We hope you're doing well. We would like to raise a feature request regarding in-app announcements in Zoho Cliq, such as the recent webinar popup about the Cliq Developer Platform: While these announcements are useful, they are not always
how do i get mail.mydomain.com to point to zoho mail web-mail?
I have started using zohomail, and am loving it. With my previous provider, I used to go to mail.mydomain.com, and it would take me to my webmail. I am not able to find the mapping for zoho's webmail to map to it. It is difficult to go to webmail with
Number of decimal places
Hi Latha, I have added the following three fields to the Company module. Currently, these fields only allow a maximum of 2 decimal places. However, for some of our requirements, we need to enter values with up to 10 decimal places. Could you please help
zoho imap connection stopped working 05/28 12pm EST
Hi, beginning Thursday, 5/28, ~12 pm est imap to siteground stopped working. When I tried to reconnect the account, connection was failing with the following message: Unable to connect SMTP server:gvam1107.siteground.biz, Port: 587. I did notice that
User Name in Zoho Cliq Not Updating Across Apps?
We updated the name of a user in Zoho. (From Sue to Taylor) Her name has not been updated in Cliq on all apps. When in Zoho One, if I go to Cliq directly, it is correct, but if I am in another app, and the Cliq bar pops up on the bottom, it will be the
Service currently unavailable
The Zoho Mail Webmail is working, the Mail Admin Console is not: "Our service is temporarily unavailable, please try after sometime." How long must I wait to retry? edit: To add to this, the Webmail is not working 100% - I can open mail in the inbox,
Service currently unavailable
Service currently unavailable It is not possible to access email; the entire Zohoworkplace platform is down
User Permission Log
Our external auditors are asking for a way to view changes made to user permissions (basically, a user permission change log). Is this feature built into Creator?
E-mail down
We cannot get into our email inboxes, are you affected by a Microsoft update issue? How long do you think as to restoration?
ZOHO MAIL SERVICE NOT WORKING
Hello i've a problem my zoho mail account says a display with this text "our service is temporally unavaible"
ايميل مجانى
Can I create a free email account on Zahoo?
Sign up for email for a domain
Hi - I thought I had signed up for a domain of <domain>.com, but only see the email of @zohomail.com . How do I get the <domain.com> domain linked to my email?
Feature Request: Include Creator-applicable Deluge updates in the Creator Release Notes
I'd like to put forward a suggestion about how Deluge updates are surfaced to Zoho Creator developers, and I'm hoping the Creator team will consider it. Zoho Creator is built on Deluge. Every workflow, custom function, validation and schedule we write
Zoho Books | Product updates | June 2026
Hello users, Welcome to this month's roundup of what's new in Zoho Books! We have an exciting line-up this time. The highlight is the launch of the all-new France Edition with full ISCA compliance. We're also introducing features such as Layout Rules
Next Page