Manually entering data into Zoho CRM subforms is simple and straightforward when dealing with a few rows. However, repeatedly copying a large set of rows from a Sheet to a Subform can be challenging. Manually mapping lookup fields and adding parent IDs is not only time-consuming but also prone to errors, leading to inefficiencies in data entry. Automating this process can greatly improve efficiency, saving both time and effort.
Here’s how you can seamlessly
fetch data from Zoho Sheets and populate Zoho CRM subforms—including lookup fields—using Client Scripts and Functions.
2. Requirement
Zylker manufactures medical instruments, and its sales representatives manage bulk orders from distributors and hospitals. Product details are typically provided in a sheet, which the sales reps must manually enter into the subform on the Order Creation Page. However, creating numerous entries is tedious, time-consuming, and prone to errors. To streamline the process, a "Populate from Sheet" button is embedded in the Order module of Create Page(Canavas). When clicked, it should
- Display a pop-up asking to enter the Sheet ID.
- Fetch order details (product names, quantities, and prices) from a specific Zoho Sheet.
- Fetch the id of the Product name from the Products module and populate the lookup field "Product".
- Populate other data into the Product list Subform inside Zoho CRM.
3. Solution
To accomplish this requirement with a button click, you need to use a Canvas Page and add a button to it. (Currently, Client Scripts do not support Custom Buttons on the Create Page(Standard). When clicked, the Client Script should be triggered, it should retrieve the Sheet ID from the user, invoke a function to read the data, and populate the content into the Subform.
So you need to follow the following steps.
- Add a button in Create Page(Canvas)
- Create a Function to fetch data from Sheet
- Create a Client Script.
a. Add a button in Create Page(Canvas)
- Go to Settings > Canvas > Form View tab. Click the three dots next to the Canvas Order Create Page and click edit.

- Right click on the button and add the Element ID for the new button and click Save.

b. Create a Function to fetch data from Sheet
- Go to Setup > Developer Hub > Functions.
- In the Functions page, click + Create New Function.
- Choose the category as Button.
- Click Create.
- In the Create Function page, enter a name and description for your function.
- Write your function code. The below function is used to integrate CRM with Zoho Sheets and reads the content of the Sheet using zoho.sheet.getRecords(sheetid ,tab name)