About events and rules
When you design your app, you may need to associate user interactions to specific app behaviors. For example, when X happens, do Y, where:
- X is called an Event.
- Y is called a Rule.
Here are a few examples:
- When the "Submit deposit" button is clicked, run an automation.
- When the value of the "Cash In" textbox changes, change the label color to red if the value is < 0.
- When the help icon is clicked, open the browser to show a documentation page.
- When a tab button is clicked, change the page container to show a different page.
By specifying what rules to execute when an event occurs, your app becomes a dynamic and interactive console.
Events
Events are triggers that happen when a user interacts with an app or control. Each control supports a single event:
| Event | Control(s) |
|---|---|
| Clicked On | Button, Header, Label, Icon, Image, etc |
| Value Changed | Checkbox, Date picker, Dropdown, Slider, Switch, Text Area, Textbox, List |
| Loaded | Page, Table |
Rules
Rules define what actions your app takes when a certain event occurs. Below is a list of the rules that Apps provides:
| Rule | Description |
|---|---|
| Set Value | Sets the value of a property. |
| Show Message | Shows a message as a toast notification. |
| Open a Page | Opens a page of the app as a pop-over or as the contents of a page container. |
| Close Pop-Over/Bottom Sheet | Closes the current Pop-Over. |
| Open URL | Opens a URL in the browser. |
| Show/Hide Spinner | Shows or hides a spinner overlay to show the app as busy. |
| If-Then-Else | Provides support for conditional statements in the rules builder. |
| Reset Value | Reverts a control to a default value, or clears it if a default value is not configured. |
| Create Entity Record | Creates a Data Service entity. |
| Update Entity Record | Updates a Data Service entity. |
| Delete Entity Record | Deletes an entity from Data Service. |
| Start process | Starts a process. |
| Add to Queue | Adds an item to queue. |
Reordering rules
To reorder rules, click the "gripper" icon at the left side of the rule name and relocate the rule.
