Creator Scripts.
Creator Scripts.
Zoho Trusted Partner in Digital Transformation

Maximizing Your Use of Custom Modules in Zoho CRM through Data Fetching

12.01.22 04:27 PM By CreatorScripts

In Zoho CRM, fetching data from a custom module can be a valuable way to access and analyze specific information within your CRM account. Here's how to go about it:

What is Data Fetching?

Data fetching is the process of extracting data from a source and bringing it into your CRM system. This can be accomplished in a number of ways, including using APIs or manually importing data. In the case of Zoho CRM, the system offers built-in data fetching capabilities that may be utilized to import data from external sources.

How to Create a Custom Module

Adding a new module to Zoho CRM is a straightforward process. Begin by logging into your Zoho CRM account and going to the "Modules" area. You can then begin the process by clicking the "Create" button. You will be invited to give your new module a name and to select the type of module you wish to create. Your new custom module will be generated once you have finished these steps.

Retrieving Data as a report from Custom Modules in Zoho CRM

  • Go to the "Modules" tab in your Zoho CRM account.
  • Choose the custom module from which you wish to retrieve data.
  • In the top right corner of the page, click the "Advanced Search" button.
  • You can utilize the various filters in the "Advanced Search" window to select the criteria for the data you wish to get. You can, for example, provide certain date ranges, record ownership, or field values.
  • After you've defined your search parameters, click the "Search" button to retrieve the entries that match.
  • The matching records will be presented at the bottom of the page in the "Results" section.
  • Then, in the "Results" area, you can export the data, inspect individual entries, or conduct other activities.

That's all! You should be able to simply get data from a custom module in Zoho CRM after following these instructions."

Retrieving Data as a list from Custom Modules in Zoho CRM

If you wish to retrieve data from a custom module in Zoho CRM, you must use code. Assume you have a Zoho CRM module called "Goods" and want to extract the names of all the products in that module to utilize in a form called "Place Orders" in your Zoho Creator application.

One method is to create a list that dynamically retrieves data from the Products module and populates a drop-down field in the Place Orders form. It is crucial to note, however, that the Fetch Data task only allows you to obtain 200 records at a time via the API. As a result, in order to collect all of the needed information, you may need to develop a script that assists you in fetching data in certain ranges.
Let's see how to do this:

  1. range = 20;
  2. // 20 is the number of times the loop will run, you will need to give an appropriate number.
  3. val = leftpad("",range);
  4. //Insert 20 blank spaces.
  5. range_val = val.toList();
  6. loop_dec = 1;
  7. //loop_dec is the variable which will decide if the API call has to be executed or not
  8. fromindex = 0;
  9. toindex = 200;
  10. count = 0;
  11. productlist=list();     
  12.  for each element in range_val
  13. {
  14. if (loop_dec != 0)
  15. {
  16. crmresponse = zoho.crm.getRecords(("<Goods>"), fromindex, toindex);
  17. // In our example, Goods is the label name of Zoho CRM Custom Module from where the data has to be fetched
  18. for each element in crmresponse 
  19. {
  20. productlist.add(element.get("product_name")); 
  21. // Fetch the product_name and add it to the list called productlist
  22. }
  23. if (resp.size() != 0)
  24. {
  25. fromindex = (fromindex + 200);
  26. toindex = (toindex + 200);
  27. count = (count + resp.size());
  28. }
  29. else
  30. {
  31. loop_dec = 0;
  32. }
  33. }
  34. }
  35. input.Dropdown:ui.add(productlist); 

Custom modules in Zoho CRM are a useful tool for tailoring the system to your specific needs. You can pull in data from external sources and use it to obtain useful insights into your organization by leveraging the built-in data fetching capabilities. You can get the most out of your Zoho CRM investment by creating custom modules and importing data into them.

CreatorScripts