Actions
Introduction
Actions within Actional buttons in FlowAgent are dynamic sets of tasks triggered based on specific conditions. These actions automate processes, manipulate data, and guide user interaction within the application. This document offers an overview of actions in Actional buttons, detailing their structure and interaction with other components.
For an in-depth guide on the syntax, types, and advanced configurations of actions, please refer to the comprehensive Actions Documentation.
Purpose of Actions in Actional buttons
Actions in Actional buttons are designed to:
- Automate Tasks: Execute tasks like CRUD operations automatically, enhancing efficiency in data management.
- Enhance User Interaction: Trigger forms and display notifications, ensuring a responsive and engaging user experience.
- Streamline Workflows: Seamlessly integrate with system workflows, triggering necessary actions in response to user interactions with Actional buttons.
JSON Configuration
Actions are consists of conditions (if
) and the tasks to be executed (then
).
JSON Actions are a standard concept in the Flow Platform and are used also in Forms. Below we will show what actions can be performed for Actional Buttons.
Property | Type | Description |
---|---|---|
crud | object | Perform CRUD operations like insert, update, relate, and delete. See CRUD Operations |
showForm | object | Show a form to the user. See Show Form Action |
showRelevantForms | object | Show relevant forms to the user. See Show Relevant Forms Action |
sendToast | object | Send a toast message to the user. See Send Toast Action |
webhook | object | Call an external webhook. See Webhook Action |
openLocation | object | Open a location in a new window. See Open Location Action |
sendEmail | object | Send an email to a user. See Send Email Action |
Examples
Example 1: Perform CRUD Operations
{
"actions": [
{
"name": "Add New Customer",
"if": [
["customerName", "=", "John"]
],
"then": {
"crud": {
"insert": {
"customer": {
"moduleid": 50,
"moduleitemtype_id": "111",
"customfield": {
"cf100": "[post.name]",
"cf101": "[post.phonenumber]",
"cf102": "[post.email]",
"cf103": "[post.role]",
"cf104": "blue"
}
}
}
}
}
}
]
}