Adding Subform Rows in Zoho CRM

Difficulty: Intermediate
Estimated reading time: 10 mins
Estimated implementation time: 30 mins

Here’s a cool bite-sized function for you! We’re gonna show you how to add subform rows on Zoho CRM via Deluge scripting without overwriting existing row(s), no API calls needed!

If you’ve ever Googled this, you would probably find the API documentation on subforms. While this works, it doesn’t explain the parameters needed if you’d like to add additional rows without overwriting the table. Plus, if you’re gonna be executing this function in CRM, the method I’m about to show you is simpler.

If this is helpful, check out our other Zoho training and educational resources!

Cool Ideas to Use the Code

Think of subforms as a spreadsheet table where you can store multiple line items on a single CRM record. The ability to add rows to the subform via Deluge creates many possibilities:

  • You can write a function to log the details of every outreach made on a Lead to an “Outreach Log” on a subform
  • If you have a subform on Deals that logs product sales, and another similar subform on Accounts to record every product sold under the Account, you can write a function that adds a line item to the Account subform whenever a line item is added on a subform of any related Deal.

Create a Map for the New Row

Create a map with the subform columns (keys) and the respective values for the new row to add.

Note: Please replace the keys with your subform column API names and the values respectively.

Add the Map into a List

Lists are required to update subforms. Create a list variable and then add the map to it.

Want to learn even more? Sign up for one of our Zoho courses!

Add Existing Subform Row(s) to the List

This step will prevent the existing subform row(s) from being overwritten.

  • Access the subform by getting the API name on the record
  • Use a loop to iterate through every row of the subform.
  • For each row, create a map with row ID, and add to the updateList variable.

Update the Subform on CRM

Update the subform on the CRM record with the updateList variable that you have made.

Click here to copy the scripts. For more Zoho-wizardry, check out our GitHub page.

More Free Resources

Deluge Tips – Null Check

When scripting, ask yourself this question – will this value ever be null? If it’s a yes, that’s a place for a null check! Here are 3 tips and best practices to help you kickstart the habit.

Read More »


Are we through here? Ok, go check out our other guides!