Auto-populate subform data from a form based on lookup selection | Zoho Creator Help

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 audits. The process is streamlined through a dynamic data-loading feature in the asset audit form. When an auditor selects an employee’s name from the lookup field, the subform automatically populates with all relevant asset details associated with that employee, retrieved from the asset details form. This feature provides auditors with immediate access to employee-specific asset details, enabling real-time asset tracking and verification.

Steps to follow

  1. Create forms with the following fields for storing employee and asset details, which can auto-populate in a subform.

    Form

    Form Link Name

    Field Type

    Field Name

    Field Link Name

    Employee Details

    Employee_Details

    Name

    Employee Name

    Employee_Name

    Email

    Email

    Email

    Phone

    Phone

    Phone

    Address

    Address

    Address

    Asset Details

    Asset_Details

    Look up
    (Employee Details)

    Employee Name

    Employee_Name

    Drop Down

    Asset Category

    • Laptop

    • Mobile

    • Hardware

    Asset_Category

    Single Line

    Model

    Model

    Single Line

    Serial Number

    Serial_Number

    Asset Audit

    Asset_Audit

    Lookup
    (Employee_Details)

    Employee Name

    Employee_Name

    Subform

    • Single Line

    • Single Line

    • Single Line

    • Drop Down

    Assets Owned

    • Asset Category

    • Model

    • Serial Number

    • Verification (Passed/failed)

    Assets_Owned

    • Asset_Category

    • Model

    • Serial_Number

    • Verification

  2. Create a workflow to execute on user input of the Employee Name lookup field in the Asset Audit form. This workflow will be configured to auto-populate the asset details of the employee in the subform.

  3. Click Add New Action and enter the following script in the Deluge editor.
    1. //Fetch all assets of the employee 
    2. fetch_records = Asset_Details[Employee_Name == input.Employee_Name];
    3. //Create a collection to store the fetched subform data.
    4. rows_collection = Collection();
    5. for each data in fetch_records
    6. {
    7. row = Asset_Audit.Assets_Owned();
    8. row.Asset_Category = data.Asset_Category;
    9. row.Model = data.Model;
    10. row.Serial_Number = data.Serial_Number;
    11. rows_collection.insert(row);
    12. }
    13. //Insert the collection to the subform
    14. input.Assets_Owned.insert(rows_collection);
  4. Create another workflow in the Asset Audit form by selecting the Record Event as Created or Edited and Form Event as Field rules. This workflow will prevent the user from adding and deleting the auto-populated subform rows.

  5. Click Add New Action > Show/Hide subform actions > Hide subform add entry and select the Asset Owned subform. In the same workflow, click Add New Action > Show/Hide subform actions > Hide subform delete entry and select the Asset Owned subform.

  6. You can also choose to disable the auto-populated subform fields by creating another workflow on load of the Asset Audit form by selecting the Record Event as Created or Edited, as shown.

  7. Click Add New Action > Deluge Script and add the following script in the Deluge editor.
    1. disable Asset_Owned.Asset_Category;
    2. disable Asset_Owned.Model;
    3. disable Asset_Owned.Serial_Number;

See How it Works


  1. Insert rows in Subform
  2. Understand on delete row action in subform
  3. Understand on add row action in subform

    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 FormsEnterpriseBegin 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 onboardingOrder Forms for Small Business
                          No Code FormsConstructionRSVP tool for holidays
                          Free FormsTravel
                          Prefill FormsNon-Profit

                          Intake FormsLegal
                          Mobile App
                          Form DesignerHR
                          Mobile Forms
                          Card FormsFoodOffline Forms
                          Assign FormsPhotography
                          Mobile Forms Features
                          Translate FormsReal EstateKiosk in Mobile Forms
                          Electronic Forms

                          Notification Emails for FormsAlternativesSecurity & Compliance
                          Holiday FormsGoogle Forms alternative GDPR
                          Form to PDFJotform alternativeHIPAA Forms
                          Email Forms
                          Encrypted Forms
                          Embeddable Forms
                          Secure Forms
                          Drag & drop form builder
                          WCAG



                                            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


                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts


                                                    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

                                                                                                              • Autopopulate Zoho Creator field with Zoho People data

                                                                                                                Requirement Autopopulate Zoho Creator field with employee information stored in Zoho People. Use case Let's assume an organization named Zylker has a private library. The regular users must purchase a membership in order to access the library, ...
                                                                                                              • Auto populate a field based on the selection from a lookup dropdown

                                                                                                                Requirement   When a value is chosen from a lookup dropdown, related values are populated in the other fields of the same form. Use Case   An order management app contains a form to store order details. When the admin chooses the customer name from ...
                                                                                                              • 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 ...
                                                                                                              • How to display images dynamically on a subform row based on the lookup field selection

                                                                                                                The images stored in a form can be retrieved and displayed dynamically within subforms. When users select a record from a lookup field in a subform row, relevant images associated with that record can appear in a designated rich text field within the ...
                                                                                                              • Understanding emailing data to form

                                                                                                                This feature is currently supported only in the .com (US data center) and .eu (EU data center). A form is the component of your app (that you’ve built using Zoho Creator), through which your users can submit data. In addition to the default method of ...
                                                                                                                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