How to copy a subform data to another subform using a report action | Zoho Creator Help

How to copy a subform data to another subform using a report action

The values in a subform of a record can be copied to another form's subform using Deluge within the report actions. This allows seamless transfer of subform data between forms, ensuring consistency.

For example, consider a Zoho Creator resource management application where teams raise product requests with the list of products in a subform. The manager can verify these requests from the form's report. After verification, the requests are directly converted into purchase orders by duplicating the requested materials from the subform into the purchase order form's subform. This is triggered when the report action is clicked on the preferred record.

Prerequisites

In order to transfer data from one subform to another in your application, both subforms must have the same type of fields across two different forms. Here for demonstration purposes, we'll be creating the forms Form A with the subform field Subform A and Form B with the subform field Subform B by replicating the same fields in Subform A to transfer the subform data from Form A to Form B
Additionally, a number field ID_Number is added in Form B to store the ID of the record from which the action item is triggered in Form A's report. The subform data will be fetched from Form A by matching the record's ID stored in the ID_Number field, and then populated into Subform B in Form B.
Form A:


Form B:

Steps to follow

  1. Navigate to the report of Form A in the edit mode of the application. Configure an action item with the name 'Copy Subform' for a single record by creating a workflow and adding the following Deluge script to the workflow. When this action item is triggered, it will open Form B and populate the ID of the selected record to the ID Number field in Form B.
    1. //Configure an openURL task to open the 'Form B' and populate the ID of the selected  record in the ID Number field of the 'Form B'.
    2. openUrl("#Form:Form_B?ID_Number="+input.ID, "same window");
  2. Add the action item to the quick view layout of Form A's report to access it as a button from the quick view of Form A's report.

  3. Create a new workflow to execute on load of Form B with the record event as Created. This workflow will fetch and populate the subform data from the From A.

  4. Click Add New Action > Deluge Script and add the following script to the Deluge editor.
    1. if(ID_Number != null)
    2. {
    3. //Fetch subform data of the selected record in 'Form A' by matching the autopopulated ID in the ID Number field.
    4. fetch_records = Form_A[ID == input.ID_Number].Subform_A;
    5. //Create a collection to hold subform rows.
    6. rows_collection = Collection();
    7. //Iterate through the each subform row in the 'Form A' to fetch and assign values from Subform A in 'Form A' to the Subform B in 'Form B'.
    8. for each data in fetch_records
    9. {
    10. subform_row = Form_B.Subform_B();
    11. subform_row.Single_Line_B = data.Single_Line_A;
    12. subform_row.Number_B = data.Number_A;
    13. rows_collection.insert(subform_row);
    14. }
    15. //Insert the subform rows stored in the collection to the 'Subform B'.
    16. input.Subform_B.insert(rows_collection);
    17. }
You can also choose to hide the ID Number field in Form B, as it is used internally for storing the ID to fetch the relevant record in Form A.

See how it works


  1. Insert rows in Subform
  2. Create Action Item
  3. openUrl

    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION






                          Quick Links Workflow Automation Data Collection
                          Web Forms Enterprise Begin Data Collection
                          Interactive Forms Workplace Data Collection App
                          Encrypted Forms Customer Service Accessible Forms
                          Digital Forms Marketing Forms for Small Business
                          HTML Forms Education Forms for Enterprise
                          Contact Forms E-commerce Forms for any business
                          Lead Generation Forms Healthcare Forms for Startups
                          Wordpress Forms Customer onboarding Order Forms for Small Business
                          No Code Forms Construction RSVP tool for holidays
                          Free Forms Travel
                          Prefill Forms Non-Profit

                          Intake Forms Legal
                          Mobile App
                          Form Designer HR
                          Mobile Forms
                          Card Forms Food Offline Forms
                          Assign Forms Photography
                          Mobile Forms Features
                          Translate Forms Real EstateKiosk in Mobile Forms
                          Electronic Forms

                          Notification Emails for Forms Alternatives
                          Holiday Forms Google Forms alternative 
                          Form to PDF Jotform alternative





                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Update a form using custom action (from another form's report)

                                                                                                                Requirement   Update a form using a custom action configured in another form's report. Use Case In an engineering college student management application, a student may withdraw at any time of the academic year. Whenever a student applies for ...
                                                                                                              • Add subform rows with dynamic data from another subform

                                                                                                                Requirement             Automatically add rows to a subform and populate it with dynamic data fetched from another subform. Use Case   A form named Orders Database contains customer details and their frequent orders in a subform. We have another ...
                                                                                                              • Display custom action button for specific records

                                                                                                                Requirement   The custom action button in a report should be visible only for certain records, based on a condition. Use Case   An asset request app lets employees raise requests for gadgets or machines. While filling the form, employees can specify ...
                                                                                                              • Capture data using NFC

                                                                                                                Requirement Capture data from NFC supported tags. Use Case An organization wants a mechanism where its employees can submit feedback about its cafeteria and restrooms by tapping their NFC- enabled ID cards against the feedback collecting ...
                                                                                                              • Auto-populate subform data from a form based on lookup selection

                                                                                                                Requirements Streamline the process of retrieving and displaying relevant data by auto-populating a subform based on the value selected in a lookup field. Use Case Consider an IT asset management application used by organizations to conduct asset ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources