Appboard/2.4/builder/widgets/actions/write static value
The "Write Static Value" action provides a way to write a static value back to the data source based on the selected item. This action only works if the data source supports updates, and is configured appropriately if required.
A simple example and use of this action would be to set an acknowledged flag on a selected ticket in a table widget. In this case either a database table or query would be configured to retrieve the list of tickets, a widget configured to show the tickets, and the action created to set a specific field in order to mark it as acknowledged (e.g. the setting the "Acknowledged" field to "Yes"). See the example use case further down this page.
As with any widget action it's possible to configure these in context, multiple actions if it's desired to set multiple fields, and action menus can be built if different operations need to be presented to the end-user.
Supporting Data Source Types
Data Source Type | Details |
---|---|
CSV file/dir | no configuration required on data source |
Database Table | automatic for entities with primary keys defined |
Database Query | each entity (query) needs a specific SQL update statement defined |
How To Create a Write Static Value Action
For instructions on adding an Action to a Widget, see the general instructions in How To Create an Action in a Widget.
How To Configure a Write Static Value Action
Perform the following steps to configure the "Write Static Value" Action for a Widget:
- Follow the instructions above to create the Action in the Widget Actions panel.
- Name: Enter a name for this Action. For convenience, a default name is provided. The Name is not used anywhere else in AppBoard, and only displayed on this configuration page.
- On selection of:
- Select "any" or "specific" for the type of data selection by the User that will trigger the Action. When selecting "specific", perform the following additional steps:
- Click the Filter button. The Filter Editor is displayed.
- Click Add Rule to create one or more rules that indicate what data should trigger the Action, when selected.
- Click Close to save the Filter settings.
- Select the Data Collection name. When the Widget is run, selection of data in this Data Collection will trigger the Action.
- Select "any" or "specific" for the type of data selection by the User that will trigger the Action. When selecting "specific", perform the following additional steps:
- Enter the following information:
- Field Name: Select the name of the field for the user-selected record that AppBoard will update.
- Value: Enter the value that AppBoard will write for the indicated field in the user-selected record.
Sample Use Case
Suppose a Table Widget displays data from the following source to a User:
Customer ID | IP Address | Error | Acknowledged |
---|---|---|---|
0001 | 172.21.38.220 | License Expired | No |
0001 | 172.21.38.226 | Server Not Responding | No |
0002 | 172.26.11.101 | Slow response time | No |
0002 | 172.21.38.105 | License Warning | Yes |
0002 | 172.21.38.313 | Temperature too high | Yes |
The Table Widget's Data Collection has a Client Side filter that only displays errors that have not been acknowledged (Acknowledged="No"). So the Table Widget displays the following data:
Customer ID | IP Address | Error | Acknowledged |
---|---|---|---|
0001 | 172.21.38.220 | License Expired | No |
0001 | 172.21.38.226 | Server Not Responding | No |
0002 | 172.26.11.101 | Slow response time | No |
Suppose that when the User clicks on a row, he acknowledges the error and it should then be removed from the display. To do this, you can create a "Write Static Value" Action that will write the Value "Yes" to the Field "Acknowledged".