Tip 20: How to autopopulate values in a subform
Hey folks,
We know that many of you use subforms extensively in your applications, as it helps you get the job done more efficiently. In this tip, we'll show you how to autopopulate values in the subform using a special syntax called "row."
Let's look at an example.
Consider you have an application where you need to automatically display the price of the product in the subform field based on the choice selected when a user clicks Add New in the subform. Let's say you have a form called "Mainform" that contains a dropdown field named "Shoes" with a list of choices like "Puma" and "Nike". The main form has a subform called "SubForm" containing a "Currency" field, as shown below.
In order to autopopulate the price in the currency field when Add New is clicked in Subform, you need to follow these steps:
Step 1:
Go to Edit this application in the top right corner of your application, click the + to create a new workflow, and select While using the form. You'll see another popup window now.
As shown above, select the form that you need to run the workflow on—in this case it's Mainform—select the option Created or Edited, and provide a name for your workflow.
Step 2
Click Add New Action, select Deluge Script, select Subform on add row, and then select the subform that you want to use.
Step 3
Now, drag and drop the If else code snippet to perform the desired action.
This script will be executed in this manner: if the brand selected is "Puma", then the respective row's currency field value will be set to "100" using the keyword "row." And if "Nike" is selected, then "200" will be set as the value. If you have more products that you want to display in your dropdown, then you can make use of the nested if else statements.
And don't forget to click Save to save the workflow!
Now, let's access the application to see how this works.
Now, change the value in Mainform and click on Add New in SubForm—the corresponding value related to Mainform will be autopopulated.
And now you're all set!
In this tip, we discussed how to autopopulate values in subform rows when a user clicks on Add New in the subform. In our next tip, we'll be discussing how you can use Insert subform rows dynamically to autopopulate an entire row in the subform.
We hope this post was useful! If you have any questions, feel free to ask in the comments below, and we'll be happy to address them soon!
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Sticky Posts
[SESSION ENDED] Ask the Experts #07| Live Q&A: Building workflows with Blueprint in Zoho Creator |
Hello, Post the release of Zoho Creator Blueprint last month, we're happy to tell you that we'll be launching a new 'Ask the Experts' session on 16th September (Thursday) this month focussing on creating blueprints in Zoho Creator. The session will be
Zoho Creator Community Webinars | October - November 2020 [Completed]
Hello everyone, I’m happy to announce that Zoho Creator is hosting a new Community Webinar Series starting this October. This series is a learning initiative aimed at our developer community, where every session will take spotlight use cases focused on
Community Learning Webinar - Zoho Creator Blueprint & other release updates | July 29, 2021
Dear developers, This June, the Creator team unveiled a slew of updates including UI enhancements to the Detail View of reports, an new capabilities in Data Import and Connections, and most important of all, the release of Blueprint in Creator. Customize
Community Learning Webinar: Delve deep into the core concepts of Zoho Creator | 17th June, 2021
Dear developers, Every customer has unique business needs and unique problems to solve. To be able to give solutions to these problems, to get over any stumbling blocks and to be able to build applications expeditiously that tailor to specific needs,
[RECORDING: Community Webinar] | Build complex reports and documents with a Zoho Creator & Zoho Writer integration | March 23, 2021
Dear developers, Report generation is an essential activity to ensure decision makers have the best information available to be able to monitor and improve performance. Enterprises may need to generate and distribute stakeholder specific documents in
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.