Skip to content

Leapwork Documentation

Set Element Expand/Collapse

⚠ Early Access Feature

This feature is Early Access and may change based on user feedback and testing. Share your thoughts with our team to help us improve it.

The Set Element Expand/Collapseblock is used to expand or collapse UI sections such as menus or accordions in a D365 F&O application.

It is automatically created when a user interacts with expandable elements during recording using the D365 Fusion Recorder. This block allows you to define whether a section should be opened or closed at runtime, ensuring consistent UI navigation throughout your flow.

Note:This block works only in browser windows launched using the Login block or within the current D365 recording session.

Fully expanded, the D365 Set Element Expand/Collapseblockshows the following properties:

d365-set-element-expand-collapseThe Block Header

The green input connector at the top left triggers the block when the automation flow reaches this step.

Once the section has been expanded or collapsed successfully, the green output connector activates.

The block title reflects the UI element being toggled, such as “Set Summary”, and can be renamed by double-clicking on it, which is useful for keeping flows readable and well-organized.

State

This property determines whether the target element should be expanded or collapsed. During recording, the state selected by the user is automatically captured.

You can switch between the two options, Expand or Collapse, to control the intended behavior at runtime. This provides clarity in navigation scenarios, where the visibility of nested fields depends on the UI state.

Not Found

This green output connector is triggered if the expand/collapse element cannot be located within the configured timeout period. This allows the flow to follow an alternative path or take corrective action when the expected UI section is unavailable.

Source Element

This optional property restricts the search for the expandable element to a specific parent container. This helps increase accuracy in interfaces where multiple expandable menus are present.

In Early Access versions, this field is shown but not editable.

Browser Window

This property defines the browser instance where the expand or collapse action should be performed.

In Early Access, only a single browser session is supported, so this setting is not configurable.

 

Default timeout

If the Default Timeout property checkbox is not selected, then the timeout value is 10 seconds. If the property checkbox is selected, then the Default timeout value selected in the flow settings will be applicable.

Timeout

This field sets the maximum time (in seconds) that the block should wait for the expandable element to appear before triggering the Not Foundconnector. It is only visible when the Default Timeout checkbox is not selected.

Note: All cases have a “global timeout” that can be configured in the “Settings” panel. This is unrelated to the timeout of a single building block. However, a running case will automatically be cancelled if it runs for longer than the global timeout.

 

Created 23.04.25