Inserting multiple rows in a subform based on user input | Zoho Creator

03.07.24 12:00 PM By CreatorScripts

🔑 **Key Takeaways**



- 📝 Automate subform entry: Automatically populate subform fields in a return order form using a custom script based on user input to improve efficiency and accuracy.

- 🛠️ Custom script creation: Utilize a custom script to fetch records from an order form using an order ID, facilitating streamlined return processes.

- 🔄 Use of loops in scripting: Implement loops to iterate through records and subform items, ensuring all relevant data is captured and transferred appropriately.

- 📊 Dynamic data handling: Dynamically handle data insertion into subforms, allowing for flexible and user-specific interactions within the app.

- 🚀 Workflow optimization: Optimize workflows by triggering scripts based on specific user actions, such as entering an order ID, to enhance user experience and operational flow.

📄 **Summary**


In this tutorial, we delve into the process of automating the insertion of multiple rows into a subform based on user input within an application. This functionality is particularly useful in scenarios involving forms where data from one form needs to be seamlessly transferred to another, such as transferring order details to a return order form.



The process begins with the setup of an order form, which is used for placing new orders and includes a subform for selecting multiple products. This is complemented by an All Orders report that displays all existing orders, each identified by a unique order ID. The Return Order form, used for submitting return requests, also features a subform for selecting products to return.



The core requirement here is that when a user inputs an order ID in the Return Order form, the products associated with that order should be fetched and listed in the subform automatically. This allows users to easily select which products they wish to return.



To achieve this, a custom script needs to be written and integrated into the app. The first step involves accessing the app's editor and creating a workflow that triggers on a form event, specifically when a record is created in the Return Order form. The trigger is set to activate upon the input of an order ID by the user.



Within the workflow, the script employs the "fetch record" task to retrieve the relevant order details using the order ID entered by the user. This involves declaring a variable to store the fetched record, which then serves as the basis for populating the return items subform.



The script uses a loop to iterate through each record in the fetched order. For each product listed in the order's subform, a new row is created in the return items subform of the Return Order form. The product details, such as the product name, serial number, and quantity, are transferred to the respective fields in the new subform row.



This automation not only simplifies the process of filling out the return order form but also ensures accuracy and efficiency by eliminating manual data entry errors and reducing the time taken to complete the form. It exemplifies how scripting and workflow automation can significantly enhance user interaction and data management within apps.



Overall, the ability to automatically insert data into subforms based on user input is a powerful feature that can be leveraged in various types of applications to streamline operations and improve user experience. This tutorial provides a clear guide on setting up such automation, highlighting the practical steps and scripting techniques involved.

What are low-code solutions examples?

Low-code solutions examples include platforms like Zoho Creator, OutSystems, Mendix, and Microsoft Power Apps. These platforms provide visual development interfaces that enable users to create applications with minimal coding, accelerating the development process.

How is low-code industry shaping the future of business?

The low-code industry is shaping the future of business by empowering citizen developers and speeding up application development. It allows business users with no coding experience to create applications, enabling faster innovation, increased agility, and improved digital transformation.

What can you build with low-code?

With low-code, you can build a wide range of applications, including customer relationship management (CRM) systems, workflow management tools, project management platforms, employee portals, and more. The flexibility of low-code platforms allows for customization and scalability to meet specific business needs.

What is the future of low-code platform?

The future of low-code platforms looks promising. As businesses continue to embrace digital transformation, low-code will play a vital role in accelerating application development and enabling citizen developers. The platforms will evolve with new features, integrations, and improved user experiences to cater to evolving business requirements.

Which company uses low-code?

Many companies across industries use low-code platforms to streamline their application development processes. Some notable examples include Siemens, Toyota, Deloitte, Lufthansa, and Liberty Mutual. These companies leverage low-code to accelerate innovation, enhance operational efficiency, and improve customer experiences.

What is low-code strategy?

Low-code strategy refers to an organization's approach to utilizing low-code platforms and methodologies. It involves identifying use cases, establishing governance, training citizen developers, and integrating low-code development into the overall digital transformation strategy. A well-defined low-code strategy can drive innovation, agility, and cost savings.

CreatorScripts