# Control User Input

Variables can be used to collect input which is required for the script to operate.

For example, a script which is creating a mesh of any geometry would require a geometry file and Element Size.

The script has the data names defined as CADFile and elem_2D. These will take the values from Pulse variables InFile (Study) and elem_size (Task).

#File name for import obtained from Pulse

#Mesh variable obtained from Pulse Variable.

The Author controls how the input should be requested through the GUI description. What widget to use depends on the nature of the variable itself. A file variable goes hand in hand with a File Path Open widget which you can use to select explore and select a file.
All GUI widgets of variables assigned to a task will be organized in a dialog. This dialog will be generated at run time. At the execution of the task, you will be prompted to input the requested information. It can also be previewed from the Edit Task dialog. In the Input GUI tab, you can add structure to and organize the variables in the dialog.

## Input GUI

In many scenarios a task or process requires multiple inputs. If this is the case, it is highly recommended for an author to organize and add structure to the dialog to make it clear and intuitive for an Analyst. This is achieved through the Input GUI tab in the Edit Task dialog.

By default, all variables which originate from user input will be added to a Property Editor Layout in a flat list. Use RMB Context menu to organize your structure. It’s possible to combine variables into categories and layouts into tabs following this hierarchy.

## Control Visibility of Layouts - Active Condition

If the Active in Dialog option is disabled for a layout or tab, they will not be visible in the Input dialog. The visibility can also be controlled automatically through the Active Condition option. If the condition is not fulfilled the layout or tab will not be visible. This action can be used to create dynamic dialogs.

In the example below, the variable Action determines what will be shown in the dialog. As Active Condition is fulfilled for Layout_5 (Action = Create), it will be visible. However, as the active conditions for the other layouts are not fulfilled, these are not visible. If an Analyst would select Delete for Action, the dialog will update and show all variables belonging to Layout_4 instead.

## Consolidate All User Input to Beginning of Process

For a fully automatic process it is recommended to consolidate all user input to the beginning of a process to avoid stalling the process when waiting for user input. This can be achieved in two ways:
• Move all variables listed in Input GUIs in all tasks to the first task of the process. See Figure 6.
• Through RMB, Add all Variables to Input GUI of the first task of the process and Remove or inactive everywhere else.
Note: Removing or moving a variable from an Input GUI of a task does not unassign it from the task as the variable is still required to execute the task. If a user input variable is not available in the Input GUI of any tasks, the default value will be used at execution.
Tip: To run a process in batch, you can inactivate all Input GUI and the default value of all variables will be used.