Button
The widget allows you to add a panel with buttons to the dashboard. When clicked, each button executes an assigned click action.
You can assign multiple actions to a single button. In this case, clicking the button displays a menu listing all added actions.
Data Settings
To configure the widget, add it to the view and click + Button in the right-side panel.
You can specify a title and description for the widget. For each button, you can configure:
- Name
- Type: Primary, Secondary, or Link. The button’s visual appearance on the panel depends on its type
- Click actions
- Display settings:
- Button color (only for Primary type)
- Text color
- Border color (only for Secondary type)
- Hint (text that appears on hover in browse mode); maximum length: 160 characters
To delete a button, click Delete.
Input Methods for Click Actions in the Button Widget
Available input methods depend on the selected click action:
- Run the script:
- Variable
- From Data Model
- Set by aggregation
- Manual
- Static list
- Dynamic list
- Update variable:
- From variable
- Set by aggregation
- Open view:
- Variable
- Set by aggregation
When using Manual, Static list, or Dynamic list, a modal window appears upon clicking the Button in browse mode, prompting the user to enter or select parameters. To trigger the click action, make the required changes and click Run.
Additionally, when configuring the Run the script action with the Dynamic list input method, the Consider filters toggle is available. When enabled, the parameter receives data respecting filters applied in browse mode.
Input methods cannot be used with the Go to the URL click action.
Display Settings
In addition to standard display settings, you can configure vertical and horizontal alignment for buttons inside the widget:
- Vertical alignment: top, center, or bottom
- Horizontal alignment: left, center, right, or full width
Additionally, when configuring the Run the script action, you can define button activation conditions — either by formula or by variable. If the condition is not met (e.g., the variable value is not in the selected list, or the formula evaluates to false), the button becomes disabled. When the Hide inactive button toggle is enabled, such a button is hidden in browse mode. This helps visually simplify the dashboard and prevent irrelevant elements from being shown to the user.
Activation Condition by Variable
You can restrict script execution access based on user role. For example, a script to recalculate the Data model should be available only to managers. To implement this:
- Create a User Role variable and define a list of roles (e.g., Operator, Manager, Head of Support).
- In the Run the script action, select activation by variable and specify which role values grant execution rights (e.g., Head of Support).
- Enable the Hide inactive button toggle.
As a result, in browse mode, the active button is displayed only to users with the selected roles; others will see an inactive button. In our example, a user with the Head of Support role will see the button.
Users with other roles will see the inactive button.
Activation Condition by Formula
You can configure button visibility based on a field’s value. For example, the Delete Comment button should only appear when a comment has already been added to the selected row. To implement this:
- Create a button and assign a Run the script click action (e.g., delete comment).
- In the action settings, define the activation condition by formula: comment field is not empty.
- Enable the Hide inactive button toggle.
In browse mode, the Delete Comment button appears only when selecting a row with a non-empty comment.
If there is no comment, the button remains hidden.
Widget Configuration in YAML
You can edit the widget not only in the view but also in the YAML editor. To add the widget, use the buttons block. The tables below list the keys and values used for configuration.
Data Settings in YAML
| Key | Type | Definition |
|---|---|---|
| name | string | Title |
| buttonType | enum | Button type: - primary — Primary- primary-outlined — Secondary- link — Link |
| onClick | — | Click action |
| hint | string | Hint for the button |
Color Settings in YAML
To specify button and text colors, use the color block with the keys and values shown in the table.
| Key | Type | Definition |
|---|---|---|
| mode | enum | Coloring mode: - AUTO — Auto- BASE — Solid |
| value | string | HEX color code |
For secondary buttons, use the borderColor block with the same mode and value keys to set the border color.
Display Settings in YAML
| Key | Type | Definition |
|---|---|---|
| verticalAlign | enum | Vertical alignment: - TOP — Top- CENTER — Center- BOTTOM — Bottom |
| horizontalAlign | enum | Horizontal alignment: - LEFT — Left- CENTER — Center- RIGHT — Right- FILL — Full width |
Example of a Configured Widget in the YAML Editor
- key: button
apiVersion: "17"
type: BUTTON
settings:
buttons:
- name: Refresh store list
onClick:
- type: UPDATE_VARIABLE
name: Update variable
variables:
- inputMethod: VARIABLE
sourceVariable: Stores
name: Stores
buttonType: primary
horizontalAlign: LEFT
verticalAlign: TOP
sorting: []
Was the article helpful?