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

How to copy 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

      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        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 LinksWorkflow AutomationData Collection
                              Web FormsEnterpriseOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceAccessible Forms
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit
                              Intake FormsLegalMobile App
                              Form DesignerHRMobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic Forms
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsEncrypted Forms

                              Secure Forms

                              WCAG

                                      Create. Review. Publish.

                                      Write, edit, collaborate on, and publish documents to different content management platforms.

                                      Get Started Now






                                                        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

                                                              Use cases

                                                              Make the most of Zoho Desk with the use cases.

                                                               
                                                                

                                                              eBooks

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

                                                               
                                                                

                                                              Videos

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

                                                               
                                                                

                                                              Webinar

                                                              Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                               
                                                                
                                                              • Desk Community Learning Series


                                                              • Meetups


                                                              • Ask the Experts


                                                              • Kbase


                                                              • Resources


                                                              • Glossary


                                                              • Desk Marketplace


                                                              • MVP Corner

                                                                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 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 ...
                                                                                                                        • Creating and managing action item in reports for mobile and tablet

                                                                                                                          1. What does this page cover Learn how to configure custom actions for reports and access them on mobile and tablet devices. Learn how to create a custom action item for a report in the web 2. Availability Available across all plans of Creator Can be ...
                                                                                                                        • 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 ...
                                                                                                                          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