Actions
Updated on Apr 18, 2023 3 minutes to readOverview
Metadata of the Action type have several primary use cases:
- Creating a control element to open a specific List form from the main menu or Actions menu.
- Navigating through a static link from the main menu or Actions menu.
- Executing a script written using Server-side script.
- Implementing an external webhook URL.
Open Form
Sometimes, users may need the ability to open a form other than the main list form. To address this requirement, follow these steps:
- Create an "Action" with the type "Open list form" or "Open object form."
- Select the desired list in the "Metadata" field and choose the desired list form.
- Save the new "Action" element.
- Add the created "Action" to the main or auxiliary menus.
Open URL
In cases where you want to give users the ability to navigate to a custom link from the menu, follow these steps:
- Create an "Action" with the type "Go to URL."
- In the URL field, provide the absolute URL to the required resource.
- Specify whether the link should open in a new browser tab.
- Save the new "Action" element.
- Add the created "Action" to the main or auxiliary menus.
Script
The "Action" type with the script is arguably the most flexible and functional mechanism. This Action type opens up the possibility of using a "server-side script" which allows us to accomplish a vast array of tasks, such as:
Webhook URL
This feature allows us to receive data from third-party services as well as implement interactions between multiple apps within the same domain. By using the E8App.$request and E8App.$response plugins, we can obtain request parameters and prepare data for the response.
To make the Action accessible externally, navigate to the "Security" tab and switch the action to "External use".
Custom Script
By leveraging the capabilities of "server-side script," we can program our action to perform virtually any task, such as generating a PDF document, performing bulk updates to lists, or initiating message distribution. The possibilities are limited only by your imagination.
This Action can be displayed in the menu or invoked programmatically by passing the necessary parameters. Below is an example of correctly obtaining the absolute URL of an action that is not declared external:
Client side code:
E8App.$metadata.get(<action script alias>).then(info => { info.absoluteBaseUrl })
Server side code:
E8App.$metadata.get(<action script alias>).absoluteBaseUrl
For non-external actions with the script type, access restrictions based on roles can be configured in the Security tab (see Roles).