Linked Form with Workflow and ETL

Below is a simple example consists of two parts. The first part involves creating linked forms that uses the Form Select component to link forms onto the current form. This part links the forms a many-to-one, that is select continents for a country.

In the second part, we will navigate the other way, show all countries that belongs to a particular continent.

It involves several modules such as the ETL, Workflow and Forms modules.

Part 1

Create ETLs

In the ETL module, create two ETL chainsets, namely “Link-Continent” and “Link-Country”. Leave the ETLs blank at the moment.

Create Workflows

In the Workflow module, create two workflows, namely “Link-Continent” and “Link-Country” with the following settings.

Create Forms

In the Forms module, create two forms, namely “Link-Continent” and “Link-Country”.

For “Link-Continent” form, add two Text Input components and a Button Bar component. Define the Text Input components as name and area, and the Button Bar component as [Save]save as per the screenshot below.

For the “Link-Country” form, add a Text Input, a Form Select, a Text Area and a Button Bar component. Define the Text Input component as name, the Text Area component as continent, and the Button Bar component as [Save]save as per the screenshot below.

Set up the Select Form component as per the screenshot below.

The “Form” and “Workflow” fields defines the form and workflow to be used. The “Label Field” defines the continent name to be used as options from the form selected prior. An icon is added at the end to enable jumping between forms. In this case the target is set to open on a new tab.

Setup ETLs

Now we can set up the ETLs.

In the ETL module, select “Link-Continent” ETL chainset and add a “Add To elxPublic” ETL step.

In the “Add To elxPublic” step, key in the fields that need to be made public to pass on the information. In this case, the fields name and area from the form are used.

For the “Link-Country” ETL chainset, add the same “Add To elxPublic” ETL step.

In the “Add To elxPublic” step, key in the fields that need to be made public. In this case, the fields name, continent and description from the form are used.

Setup Workflows

In the Workflows module, select the “Link-Continent” workflow and add a new transition save that loop to the same “Running” state. In the “OnTransition” field, select “Save”. This transition will be called by the [Save]save on the form.

Add the same transition in the “Link-Country” workflow.

Test Forms

Run the “Link-Continent” form twice, once to create Africa and once to create Asia. Do not close the forms.

Now we have two records, with one continent name and area for each record.

Run the “Link-Country” form. Fill in the details for the “Name” and “Description” fields as per the screenshot below. Click on the “Continent” field and a drop-down list will appear. The options in the list are from the “Link-Continent” forms that are entered earlier. Select “Asia” in “Continent” field.

You can click on the “Open” icon to open the form with the “Asia” option selected in another tab.

Part 2

In this part, we will link the forms the reverse direction, one-to-many.

Create Link-All Form

All the forms that were created earlier will be lost when the tabs are closed.

To get the forms back, create a new form “Link-All” containing two Form Launcher components.

Run the form (no workflow required) and all the entries are listed in the two Form Launcher components.

Filter Entries In Form

To show a list of countries that belong to each continent, we need to add a Form Launcher component and set the “Matching Field” in its properties.

The “Link-Country” form has a “continent” field, which is the ID of the continent. This field is used in the “Matching Field” property to only show these with a continent value which matches this form. If “Matching Field” is left blank, it will show all countries (like on “Link-All” form).

In the “Link-All” form run earlier, click on the “Asia” to launch the form. The “Link-Continent” form shows all countries from the continent Asia, in this case, Singapore is listed.