In our last tip we discussed how to autopopulate values in subform rows while clicking on Add New. As promised, in this tip, we'll show you how to dynamically insert rows in the the subform without clicking the Add New button, using our new feature—Insert rows in Subform dynamically.
Let's say you have an application where you have the product name in the Mainform field, and you need to automatically display the price of the product in the subform field based on the choice selected in Mainform field.
The Mainform 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 in the screenshot below.
When a product is selected from the Shoes dropdown field, the Currency field in the subform should be automatically populated with the corresponding value.
To achieve this, we need to write a Deluge script during On User Input of Shoes, as shown in the below 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, and enter the name for your workflow.
Step 2
Click Add New Action, select Deluge Script, select On User Input, and then select the subform that you want to use.