Creating dynamic tables
Instead of hard-coding a table data source when you design the table, you can specify that the source server and form be dynamically selected at runtime according to values that a user or workflow enters in specified fields.
For example, the Dynamic Table Field form in the following figure contains two fields (server and form) that can be hidden or display-only. The values entered in these fields (for example, from a Set Fields action) at runtime determine which server and form are used as sources for the table field. Administrators might prefer to hide this functionality from users and use the Window Loaded execution condition instead.
Using dynamic table fields
(Click the image to expand it.)
In this example, two requests exist in the Source form on the server cordova. If users open the Dynamic Table Field form in the mid tier, enter cordova as the server and Source as the form, and then refresh the table field, the content of the table is refreshed by the underlying active link workflow. The table field displays the requests from the dynamically specified server and form.
You cannot use a dynamic data source in a results list.
To create a dynamic table
- Select the appropriate table.
- In the Properties tab, select one of the following properties, and click its ellipsis button:
- (List view, tree view, alert list, results list) Tree/Table Property
- (Cell-based) Remote/Local Fields
The Tree/Table Property or Remote/Local Fields dialog box appears.
- In the Data Source list, select SAMPLE DATA.
- In the following fields, enter a server and form to use to add "sample" field columns to the table:
- Sample Server Name
- Sample Form Name
The sample server and form are used as temporary references to create the dynamic table field. You can even delete the sample form after saving the table field. What is important is having a sample form from which to select field columns in step 7. At design time, the sample form must contain every field that you are using in the menu.
By default, the current server and form are selected.
You can select a different server from the drop-down list.
To select a different form, click the ellipsis button next to the Sample Form Name field, and use the Form Selector dialog box.
- To specify the fields or keywords (for example, $server$ ) that determine which server and form are used at runtime, click the ellipsis buttons next to the following fields, and use the Field/Keyword Selector dialog box.
- Runtime Server Value
- Runtime Form Value
The fields listed in the dialog box come from the sample form.
If you select fields, the server and form that a user or workflow enters into those fields at runtime are used as the source server and form whose data the table displays.
For the example in the above figure, the Runtime Server Value field would be set to server, and the Runtime Form Value would be set to form.
- In the Qualification field, enter a qualification to specify the search criteria that determines which requests appear in the table.
Fields from the sample form can be used in the qualification. Conversion rules do not apply in this case.
Make sure you select fields that are available on any form that can be dynamically selected at runtime. Otherwise, when users refresh the table, they might receive an error that the field does not exist, and no data will appear in the table.
For example, in the above figure, the table includes two columns that are core fields required on every form: Request ID and Short Description.
Select the fields to use as columns in the dynamic table field.
- Click OK.
- Right-click the form, and select Save.
Dynamically defining table field search criteria
To enable users to define table field search criteria dynamically, use the EXTERNAL() operator. For more information, see Operator types.