For looping through all records and then changing them using Zoho Creator, use the Deluge “for each record” task. It allows you to repeat over the records by using a form with the criteria you choose and make changes as required. To make large-scale updates, it is possible to make use of custom tools or integration tasks such as updateRecords to modify several records simultaneously. This is a great method to automate changes across your database without the need for manual editing.
This is a platform that doesn’t require any code, which allows you to create customized apps to suit your needs. A key feature is the capability to go through all the records within a form and modify them as necessary. This can be useful if you’re looking to modify a lot of records simultaneously, such as making changes to prices, changing conditions, or fixing errors. Here at Itechleadz, we frequently assist firms by assisting them with Zoho integration and workflow automation.
In this blog, you’ll learn to make simple scripts that run through the records and make updates within them.
Understanding Records and Forms in Zoho Creator
Record entries are the information that you can add to your Zoho Creator forms. Consider a form like an actual table. Each row of that table is a record. In the example above, there is a form that you call “Tasks.” Each task that you create will be an entry in the record. Every record contains fields, for example, Task Name, Status, or Inventory. The fields contain information on each record.
Forms help you organize your data. Forms can be used to accomplish many tasks, such as organizing tasks, keeping track of inventory, or keeping track of the details of customers. If you’re looking to change several records, it is important to be aware of how to locate the correct fields for every document.
Looping Through Records: The Basics
Zoho Creator’s scripting language is Deluge. Deluge allows you to write easy scripts to automate repetitive processes. One of the most useful Deluge tasks is to use the “for each record” loop. The loop runs through each record using a format that meets your specifications.
In the example above, if you’re looking to locate every record where the number of records exceeds 10, you can make use of a loop such as this:
text
for each r in NameofyourForm [inventory == 10]
{
r.inventory = 0;
}
The script examines every entry within the form. When the field for inventory has a value of 10, it will set the value to zero.
How to Update Records in Zoho Creator
When you can go through your records in a loop and update them, you can do so. In Deluge, it is possible to utilize the update function to modify the values of fields. It is possible to update a single field or several fields simultaneously.
Below is a step-by-step instruction:
- Edit Your Application: Open your Zoho Creator app.
- Visit Workflows: Find the Workflow section, where you can create your scripts.
- Create a new function: Give the function the proper title.
- Write Your Script: Use the “for each record” loop to find and update records.
An example script for updating the tasks that are with the name “Old Task” to “New Task”:
text
for each t in Tasks [Task_Name == “Old Task”]
{
t.Task_Name = “New Task”;
}
It is also possible to integrate the updateRecords task for more detailed updates.
text
dataMap = Map();
dataMap.put(“Task_Name”, “Priority Task”);
otherParams = Map();
response = zoho.creator.updateRecords(“OwnerName”, “AppName”, “ReportName”, “criteria”, dataMap, otherParams, “creator_oauth_connection”);
This script can update any records that satisfy your criteria to the latest values that you have set in the dataMap.
Mass Update and Bulk Edit Options
If you are looking to update a lot of data, it offers mass updating options. If you have a small database (less than 200 records), you can make use of Zoho Creator’s integrated “Bulk Edit” option. In larger databases, you can write an individual function using a loop, which would be better.
To update the mass:
- Utilize this loop to create the “for each record” loop inside a customized function.
- Make sure you have a pattern in place to choose the data you would like to modify.
- Change the fields within the loop.
This technique is speedy and is effective for thousands of documents.
Practical Example: Step-by-Step Mass Update
If you’ve got 2,945 records in your table that you wish to set all inventory values from 10 to 0. This is how to do it:
- Make changes to your application.
- Click Workflows, and then Functions.
- Make a brand new function, such as “ResetInventory.”
- Make use of this script:
text
void ResetInventory()
{
for each r in Products [inventory == 10]
{
r.inventory = 0;
}
}
This script will be updated for each record with an inventory of 10 and will set it to zero. This script is easy to use and runs quickly, even on massive tables.
Best Practices for Looping and Updating Records
- Use Criteria to Select: Always utilize criteria within your loop to choose only the records you’d like to edit. It will prevent you from changing incorrect records.
- Make a Test Script: Run your script with a tiny record first.
- Save Your Work: Save your function before you run it.
- Make sure you check for errors. If the script you are using does not function, make sure you verify the names of your fields and the criteria.
- Utilize Bulk Edit for small changes to speed up the process using Bulk Edit to make small updates. Bulk Edit option to update fewer than 200 data records.
Automation and Workflow Integration
Looping and updating records may form part of a wider workflow. In the case of automated workflow automation, it is possible to change the status of maintenance activities when the plane is scheduled for maintenance. Zoho Creator allows you to create workflows to automate these updates.
You can:
- You can set up triggers to be activated when forms are submitted.
- Make records updated when particular conditions are met.
- Make reports or send out notifications following the latest updates.
Automating the process saves time as well as minimizes the chance of errors.
Custom Solutions and Advanced Use Cases
There are times when your business needs may be unique. There are times when you need to change data based on complicated regulations or integrate Zoho Creator with other programs. Custom functions can help you accomplish this. For example, you can:
- Make changes to records on one form based on the changes that have been made to another form.
- Make connections with other Zoho applications to get the full Zoho integration.
- Create dashboards that display the latest information in real time.
The custom solutions you choose for your company will help it function the way you would like it to. Your workflow can be designed to streamline and automate any process you want to automate.
Conclusion!
Re-creating and looping data in Zoho Creator is simple by using Deluge scripts. It is possible to use loops that are simple to complete small tasks or develop customized functions to handle larger tasks. Make sure you have clear guidelines and test your scripts, and utilize automation to reduce time. If you’re interested in learning more about Zoho deployment or exploring the automation of workflows in aviation, Itechleadz will help you get started.
Do you want to make your information management more efficient? Contact Itechleadz today to find out how Zoho Creator can help transform your company.