How to clear and add values in dropdown of a subform

How to clear and add values in dropdown of a subform

Assume you have a dropdown field in the subform with preset values. You can clear these options and add new ones dynamically in the UI using Deluge scripting. As a result, only the values specified in the deluge script will appear in the dropdown.
Note: Altering the dropdown values through this task is limited to the client interface, ensuring that only the UI is modified, without affecting the predefined values stored in the backend.
For example: Let’s consider the course registration application used in an educational institution. Students register for their preferred courses in a course registration form with a subform to handle and showcase enrolled courses for students. Depending on the student's academic year, the subform dynamically displays only the courses allocated for that specific year.
  1. Create a new workflow to execute on your preferred form event.

  2. Click Add New Action > Deluge Script and add the following script to the Deluge editor.
  1. // Create a list of values to replace the existing dropdown values
  2. New_Items = List();
  3. New_Items.add("Item 1");
  4. New_Items.add("Item 2");
  5. New_Items.add("Item 3");
  6. //Utilize an 'if' statement to selectively clear or add dropdown values based on a specified condition. Define your condition within the <criteria> placeholder.
  7. if(<criteria>)
  8. {
  9. //Clear and add the drop values
  10. row.<Dropdown>:ui.add(<New_Items>);
  11. }

Where

<New_Items>

is the LIST that contains the values that to be replaced with the existing values in the drop down.

<Criteria>

is the conditional expression that determines whether the subsequent code within the 'if' statement should be executed.

<Dropdown>

Is the field link name if the drop down field added in the subform

 

See How it Works


  1. Add & Append


    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

                                                                                                              • 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 ...
                                                                                                              • Auto-calculating values on a subform's field

                                                                                                                Requirement Perform statistical operations on the numerical fields in subforms for analysis. Use Case  In an order management application, there are two forms, Order and Product. The Product form lists all the products in the inventory and the Order ...
                                                                                                              • Display subform's report in parent form's report

                                                                                                                Requirement   When the user views a particular record in a report that has subform, the values in the corresponding records are also shown. Use Case   An order management application contains two forms: Customers and Orders. The Customer s form is ...
                                                                                                              • 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 ...
                                                                                                              • Create Serial Number for subform rows

                                                                                                                Requirement Create serial numbers or auto-numbers for subform rows when a new row is added. Use Case In an employee management system, an employee can add up to five dependents. It will be easy for the employees if the dependents added in the subform ...
                                                                                                                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