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 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









                                                                                                                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