Using Smart Actions
Last updated
Last updated
Sooner or later, you will need to perform actions on your data that are specific to your business. Moderating comments, generating an invoice, logging into a customer’s account or banning a user are exactly the kind of important tasks to unlock in order to manage your day-to-day operations.
On our Live Demo example, our companies
collection has many examples of Smart Actions. The simplest one is Mark as live
.
If you're looking for information on native actions (CRUD), check out this page.
Here it depends on your setup: if you are using a self-hosted agent, head on to the Developer documentation portal, navigate to the Smart Actions
documentation of your agent stack to start plugging them right into your agent. If you have used instant setup (cloud), you will be able to create new actions right from your Collection settings.
Go to Edit Layout, select the collection where you want to create new actions, then select the Actions
tab:
From there you can click on Create your first action
to get started.
This action allows you to update the value of selected fields from your records. You just need to select the appropriate fields by clicking on 'Add field', and selecting the right entry from the dropdown menu, then type the desired value on the right
This action allows you to plug in to a workflow automation tool like n8n, make, zapier… and trigger actions on those platforms right from your admin panel. You just need to pick your favorite automation tool, and create a webhook endpoint with your workflow. Then copy the URL to this endpoint in the provided field:
When a webhook action is triggered on a record (or list of records), Forest Admin will send along the ids of those records so that you can use them in your automation process.
After saving those actions, you will see a spinner that lets you know the action is being created, and a couple seconds later it is available (you will just need to refresh your browser when prompted).
Sometimes, your Smart Action only makes sense depending on the state of your records. On our Live Demo, it does not make any sense to enable the Mark as Live
Smart Action on the companies
collection if the company is already live, right?
In the collection settings, you can configure the UI options of your Smart Actions.
When using Forest Admin with several teams and when you have clear roles defined it becomes relevant to restrict a Smart Action only to a specific set of roles. It can be configured in the Roles tab of your project settings.
Critical actions for your business may need approval before being processed.
To add an additional layer of security over a Smart Action, head over to the Roles tab of your project settings. From there, you'll be able to select Trigger with approval for that Smart Action. Note that this must be set for each role.
Actions requiring approval will be available in the Collaboration menu (3) in the “Approvals” section:
“Requested” for all incoming requests (yours to approve or not)
“To Review” (4) for requests you need to review
“History” for all past requests.
In “To Review”, you will be able to approve or reject the request (5) with an optional message (6) for more details.
All past approval requests - made by you or other approvers - in the History tab (1).
You can export your approval requests history from this tab using the top right button (2).
You can get more details on a specific action by clicking on it: