Files
Introduction
FME 2023.0+ lets workspace authors control the visibility of published parameters to workspace users. This means at runtime, the workspace can be configured to automatically show or hide parameters based on what the user does elsewhere.
Why is this useful? It simplifies the user experience by only showing relevant options, preventing translation errors from misconfigured parameters, like setting guardrails on how you want your workspace to be used. Before, all published parameters appeared at runtime in the Translation Parameter Values prompt, often requiring authors to include manual instructions explaining which parameters to use for different cases.
This article demonstrates how to use the Conditional Visibility property utilizing both single conditions available in FME 2023.0+ and compound conditions available in FME 2025.0+ versions.
You should already be familiar with creating and managing workspace parameters before following this example. Review the Published Parameters in FME article or the FME Documentation.
Step-by-Step Instructions
FME Workbench 2023.0+ is required to follow along with most of the examples. Given that Compound Conditions were introduced in 2025.0, section 3 requires FME Workbench 2025.0+. Workspaces are provided for both the 2023 and 2025 versions.
Note: FME Workbench versions are backward compatible with older workspaces. While you can open the 2023 workspace in Workbench 2025+, the 2025 workspace is not guaranteed to run as expected. Refer to this article for a reminder on that.
1. Download the Workspace Template
Save workspace template, ConditionalVisibility_2023.fmwt (or ConditionalVisibility_2025.fmwt), then open it in FME Workbench 2023.0+.
This workspace uses an OGC GeoPackage source dataset containing two tables based in Surrey, BC:
- a parks table, with polygon features of parks; and
- a trash container table with point features of trash containers
The workspace identifies parks that are underserved by trash containers. It accomplishes this primarily by controlling the visibility of a user parameter group box.
In the example workspace, users can decide between two translation options:
- Simple overlay of trash container locations on park areas, followed by a Tester to identify those parks which do not contain the minimum acceptable number of trash containers; or
- More complex analysis that filters parks by park area statistics, and then identifies parks that do not contain the minimum number of trash containers acceptable for their area.
Note: The term “park area” refers to the mathematical area occupied by the parks, not the geographical area that these parks fall into. In other words, these parks fall within the geographical area of Surrey, BC, but we are interested in the mathematical area calculated from their on-the-ground boundaries, measured in square meters.
2. Access the Manage User Parameters to Configure Parameter Visibility
Right-click on the User Parameters section of the Navigator pane, and choose Manage User Parameters
With the Manage User Parameters dialog open, we can control the visibility of User Parameters.
First, select the Include Park Area Statistics group box to view its definition to the right.
This group box is configured as a checkable published parameter, with its default state set to unchecked. It is used in the first Tester transformer to direct the flow of features based on whether the user wishes to consider area statistics in the downstream calculation.
Now, select the published user parameter, Choose type of area to calculate, within this group box, and view its definition on the right.
The Conditional Visibility option is enabled for the Choose type of area (AREA_TYPE) user parameter. A Single Condition is used to control when this parameter appears in the runtime prompt. Specifically, AREA_TYPE is shown only when the INCLUDE_STATS parameter (Include Park Area Statistics) is enabled. If this condition is not met, the parameter remains hidden. Since no default value is set, users must choose an option (Plane Area or Sloped Area) when it becomes visible at runtime. This setup is useful because the AREA_TYPE parameter is only relevant when area statistics are included.
3. Set Up TestFilter Group Box Compound Conditional Visibility
This section requires FME Workbench 2025+. Select the Set Up TestFilter group box to view the TESTFILTER_SETUP parameter definition. Skip to Step 4, for version prior to 2025.
This group box also has Conditional Visibility enabled, but it uses a Compound Condition. Introduced in FME 2025.0, compound conditions allow for more advanced logic, combining multiple criteria using Boolean operators like AND, OR, and NOT, instead of a simple If-Then-Else statement. This type of configuration gives even more control to workspace authors, meanwhile, the Composite Expression section lets you build and manage these complex conditions more efficiently. Authors more comfortable with Boolean expressions may find composite expressions faster and more flexible for controlling visibility.
In this example, TESTFILTER_SETUP will be hidden unless users enable the INCLUDE_STATS parameter and AREA_TYPE is not empty at runtime. The parameters within this group box are exclusively applied to the TestFilter in the workspace, which is only run when users choose to include Area Statistics in the workflow. So it makes sense to hide this group box in the runtime prompt until it’s needed.
To view how the Set Up TestFilter group box will look in the runtime prompt, click the Preview button at the bottom right of the Manage User Parameters dialog.
The Parameter Preview dialog opens, showing a preview of how the runtime Translation Parameter Values prompt will look when the workspace is run. By default, the Include Area Statistics parameter is disabled. As expected, the dependent Set Up TestFilter group is hidden.
Now select the checkbox to the left of the INCLUDE_STATS parameter in the Parameter Preview dialog and choose the type of area to calculate.
The Set Up TestFilter group box, as well as the parameters it contains, are now visible and enabled in the Parameter Preview dialog.
Close the Parameter Preview to return to the Manage User Parameters dialog.
4. Parameters within the Set Up TestFilter Group Box
The conditions on the group box visibility affect the parameters inside. Select each parameter within the Set Up TestFilter group box, one at a time, ignoring the top Message parameter.
Each of these parameters has Conditional Visibility disabled. Since these parameters reside within a group box with Conditional Visibility enabled, they will behave according to the condition set for the containing group box. They will be hidden along with the group box until the Include Park Area Statistics parameter is enabled at runtime.
If one of the parameters within the Set Up TestFilter group box requires more restrictive visibility, then the Conditional Visibility option could be used on that specific parameter to further control its visibility at runtime. This is an alternative way to implement more complex visibility conditions for one parameter outside of the Compound Condition.
To view this additional visibility constraint in action, select the TESTFILTER_RIGHT_VALUE parameter from the Set Up TestFilter group box. Enable Conditional Visibility for this parameter, then set the Conditional Visibility If-Then-Else clause to the following:
| If | TESTFILTER_LEFT_VALUE | Is Not Empty |
| Then | Show as Enabled | |
| Else | Show as Disabled |
Click the Preview button at the bottom right of Manage User Parameters, enable Include Park Area Statistics, and choose an area type. The right value parameter within the Set Up TestFilter parameter group is grayed out, even though the visibility condition for this parameter group has been met.
The visibility condition set on this TESTFILTER_RIGHT_VALUE parameter must now be met to enable it at runtime.
Type “sometext” into the left value parameter input field.
Now the right value parameter is enabled and ready to accept user input.
Close the Parameter Preview dialog to return to Manage User Parameters. Select the TESTFILTER_RIGHT_VALUE parameter, and disable Conditional Visibility to return this parameter to its original definition.
5. The Minimum Acceptable Trash Cans Parameter
Select the Choose minimum acceptable number of trash cans for all parks parameter, just below the Set Up TestFilter group box, to view its definition on the right. This parameter allows the workspace user to specify the minimum acceptable number of trash cans for all parks in Surrey, regardless of park area.
Note how this parameter does not have Conditional Visibility enabled, and will therefore always appear active in the runtime parameter prompt. Test this out by clicking on the Preview button in Manage User Parameters. Now alternately enable and disable the INCLUDE_STATS and AREA_TYPE parameters while watching the Choose minimum acceptable number of trash cans for all parks parameter. Notice that it is visible and enabled regardless of the park statistics parameter.
With Include Park Area Statistics disabled
With Include Park Area Statistics enabled
This is not desirable behavior, as this parameter is not relevant at all times during translation. It is only needed when the user leaves the Include Park Area Statistics parameter disabled at runtime. To prevent workspace users from inputting values into this parameter unnecessarily, it should be hidden until required.
To adjust this parameter’s visibility, close the Parameter Preview dialog and return to Manager User Parameters.
Next, select the Choose minimum acceptable number of trash cans for all parks parameter, and enable its Conditional Visibility option.
Complete the visibility If-Then-Else statement as follows:
| If | INCLUDE_STATS | is <enabled> |
| Then | Hide | |
| Else | Show as Enabled |
Now, select the Preview button to return to the Parameter Preview dialog once more. Test out the adjusted visibility of this parameter by enabling and disabling Include Park Area Statistics.
The Choose minimum acceptable number of trash cans for all parks parameter is now hidden when Include Park Area Statistics is enabled.
Close the Parameter Preview dialog to return to Manage User Parameters.
6. Visibility of CSV Destination Folder Parameters
Select each Destination CSV folder parameter to view its definition. Each of these two parameters has Conditional Visibility enabled, but with slightly differing If-Then-Else statements.
The first Destination CSV folder parameter will only be enabled if INCLUDE_STATS parameter is enabled. This makes sense, as this parameter is only applied to the CSV writer capturing the area-filtered calculation.
The second Destination CSV folder parameter is only applied to the CSV writer that captures all parks, regardless of park area. Accordingly, this parameter will only be enabled if INCLUDE_STATS parameter is disabled. Both of these parameters will show as disabled (grayed out) when their visibility condition is not met.
The user parameters for this workspace are now ready to be tested. Click Close at the bottom right of the Parameter Preview dialog. Click OK at the bottom right of the Manage User Parameters dialog to return to the workspace canvas.
7. Enable Prompt for Parameters and Run the Workspace
Enable Prompt for Parameters in the Run drop-down menu from the navigation ribbon, and then run the workspace.
The Translation Parameter Values dialog will open, prompting users to input values for the various published user parameters, as shown in the Parameter Preview. The parameters visible to the user will change primarily based on the state of the Include Park Area Statistics and the Choose type of area parameters.
Now, users will only be able to provide values to the published parameters required for their specific translation, while extraneous parameters are no longer available in the runtime prompt. The conditional visibility of published user parameters has been successfully implemented in this workspace.
Additional Information
- Creating and Modifying User Parameters [Documentation]
- Running a Workspace with Published Parameters [Documentation]
- Controlling the Visibility of Published Parameters [Documentation]
- Published Parameters in FME Form
Data Attribution
The data used here originates from data made available by the City of Surrey, British Columbia. It contains information licensed under the Open Government License - Surrey.