Skip to main content

Dynamically Populating BPM Web Form Dropdowns

Posted by bleonard on May 3, 2013 at 7:22 AM PDT

Web Forms is one of the exciting new features of the recently released BPM 11.1.1.7. To really embrace the power of Web Forms, one must understand Forms Rules, which can give your forms dynamic behavior, such as showing a field or calculating a sum total. In this example, I'm going to show you how to use Form Rules to dynamically populate a dropdown (or list).

Step 1: Create the Web Form

Using Business Process Composer, create a new BPM Process called DynamicDropdown. Then create a new Web Form called DropdownForm. Add 2 dropdowns on the form: Country and City. Your form should look as follows:

Step 2: Add the Country Rule

Click the rules icon to toggle to the Form Rules:

Create a new rule and click the edit Rule icon , then create the rule PopulateCountry as follows:

If you're playing along at home, you are free to use the same public URL as it returns a list of 5 countries as JSON output (if you want your country added to the list, just let me know): https://java-trialaxkb.java.em1.oraclecloudapps.com/LOVHelper/jersey/listvalues/countries. Just note that you will also need to add the Oracle Cloud's certificate to your WebLogic KeyStore See Calling an Oracle Cloud Service from Java for details.

Note, the JavaScript editor validates when you tab out of the Rule field. So if there's an error for example:

If you want to test run your form at this point, click the blue running man icon :

Step 3: Add the City Rule

It's very common to have the results of one field determine the contents of another. In this case we only want to see cities that apply to the selected country. Create a second Form Rule as follows:

And that's all there is to it:

AttachmentSize
GetLovRESTService.zip54.65 KB
DynamicDropdown.zip9.24 KB
Related Topics >>