Blog Posts Process Management

Populate combo box from Web Service

Blog: Flokzu

When completing a task, users will sometimes have to fill in a field by choosing an option from a combo box. A typical example is a list of countries, cities, products, etc. If that list is too long, setting up the combo box manually would take too much time. In those cases it’s very useful to populate a combo box from a Web Service. Plus you can use it to import data from one of your own systems.

 

How to set it up

When setting up your process, in the ‘Process Form’ tab add a new field. Select ‘Combo box’ as field data type and choose the option ‘Populate from external Web Service’. Then click ‘Set up your Web Service here…’

 

ComboBoxWS

 

A window will pop up, where you can set up your Web Service:

  1. On the Web Service URL (REST) field, type the public URL of your Web Service.
  2. (Optional) In case you need to pass parameters to your Web Service, you can define them in the Input tab. You’ll have to specify a name and a value for each parameter added. The value can be selected from one of your fields or typed in manually.
  3. On the Output tab, map the Web Service response (that should be a JSON string) with the label and value of the options that will populate the combo box. Both fields are required, but you can choose the same label and value if you want.

In most cases, the system will display only the label. The main goal of distinguishing between value and label is to use the value as an input parameter in another Web Service call (in which case you’ll have to use the value instead of the label). The typical example would be to use a country value to populate a combo box with the cities of that country.

4. On the Web Service Settings pop up, click Accept.

5. On the Field Settings pop over, click Accept.

Please consider that the expected response format of your Web Service is as follows: [ { “country” : “Afghanistan”, “id” : “AF” } , { “country” : “Albania”, “id” : “AL” } ]

 

The combo box options will be calculated when opening the Document (as long as the field’s visibility is editable or required) and when any of the parameter field changes. As an input parameter you can select a field which will be hidden in that task. In that case, the value of the input parameter is the one the field had in the previous task.

 

Note: the REST Web Service call will send a HTTP get request.

The post Populate combo box from Web Service appeared first on Flokzu.

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="https://www.businessprocessincubator.com/content/populate-combo-box-from-web-service/?feed=html" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples

BPMN.org

XPDL.org

×