Actions
An action is an instruction that will be executed on the platform when called upon. An Action can only be triggered by a rule but can be associated with several rules so that different triggers can result in the same action being performed. Action Scripts are executed on the server side, as opposed to client-side scripts that can be added to UI elements. More information is available in the Appivo Scripting Guide.
Action Types
A single action can be used by multiple rules.
Click > Create New > new page opens. There are several action types available:
- Execute script
- Send Email
- Send SMS
- Send Push Notification
- Invoke Webhook
- Execute command via SSH
- Transfer file via SFTP or SCP
- Transfer file via FTP
Execute Script
Scripts are used to add custom logic to an app. Adding scripts to your app is very easy and can be done without knowing much about programming. However, if you know programming, you can write advanced scripts to perform complex logic. The three different methods for creating scripts:
- QuickActions are like macros and are the quickest and easiest way to perform the most common actions in an app.
- Logic is easy to use but still allows with full control over what the script does
- JavaScript allows you to create advanced actions with full control over what happens.
Descriptions of fields:
Action Methods
Action method can be described in three ways:
- Quick Action
- Logic
- Java
Quick Action
QuickActions are a fast and easy way to perform the most common operations, and can be thought of as macros. Once the script editor is set to use QuickActions you simply pick the action that you wish to perform from the dropdown and then input any parameters needed for the QuickAction.
The currently available QuickActions are:
Description of fields:
Logic
Logic allows you to define custom app logic without writing any code, with more flexibility than QuickActions. Resembling a puzzle, the pieces or blocks connect only in ways that make sense. The blocks are parsed from top to bottom, and have connections above and below that let you place them in the order you want them to be run. Some blocks also have connections to the right. Blocks connected on these right-side connections are called “arguments” and are used to configure or modify the behavior of a block.
For example, a “Get user name” block may take a user block as an argument to specify which user’s name it should output. Figuring out which arguments fit in which block may be difficult. Luckily some help is available through tooltips. Just hold the mouse cursor over the colored part of a block and the tooltip will appear. The tooltip will usually have a short description, detailing the block’s purpose, along with information on the argument inputs and output value.
Blocks can be described in few ways:
Description of fields
✰Note: Some blocks are both an instruction and a value. In these cases, the instruction normally comes down to finding the value that the block should represent. Arguments can be used to alter the value. For example, a “get name” block may have different values depending on which user is provided as the argument.
JavaScript
Using JavaScript directly is the most advanced way to add custom logic to an app. It requires to be familiar with programming and the syntax of JavaScript. Using JavaScript gives full access to all the APIs available in the platform and can create very advanced logic for an app. However, if one is not used to writing code it is very easy to make mistakes that will cause the script to malfunction. Therefore it is recommended to use QuickActions and Logic for creating scripts until one feels comfortable writing code.
Send Email
Email action is used to send emails. It supports the use of helpers (variables) in order to add context specific information to the message.
Description of fields:
-Configuration
-Manual Input
Select parameter
1. Role – Select role
2. User – Select user
3. Record reference – Select a data model attribute from the available options, based on the rule(s) using this action.
4. Previous record reference – Select a data model attribute from the available options, based on the rule(s) using this action.
5. Configuration – Select a parameter
6. Application – Enter a mail-key for an application.
7. Manual Input – Manually enter an email address.
1. Role – Select role
2. User – Select user
3. Record reference – Select a data model attribute from the available options, based on the rule(s) using this action.
4. Previous record reference – Select a data model attribute from the available options, based on the rule(s) using this action.
5. Configuration – Select a parameter
6. Application – Enter a mail-key for an application.
7. Manual Input – Manually enter an email address.
-HTML
–Source: enter HTML content.
–WYSIWIG: Use the visual HTML editor to enter content.
Define the email content
-Type
1. Generate from template
–Template – Select a template
–File Name – Enter a filename
–Content type – This refers to the mime type of the attachment. If left blank the mime type will refer to the template.
2. Related documents – Enter the path of related document(s).
Send SMS
SMS action is used to send SMS messages to users. It supports using variables to add context specific information to the message.
Descriptions of fields:
1. Role – Select role
2. User – Select user
3. Record reference – Select a data model attribute from the available options, based on the rule(s) using this action.
4. Previous record reference – Select a data model attribute from the available options, based on the rule(s) using this action.
5. Configuration – Select a parameter
6. Application – Enter a mail-key for an application.
7. Manual Input – Manually enter an email address.
Send Push Notification
Sending push notifications is a great way to drive user interaction with your app. Push notifications can be used instead of SMS and emails to send messages to users, and are more direct and less expensive. The only limitation with push notifications is that they require you to create and distribute a mobile app to your users. When defining a push notification you can decide what you want to push to the user. The most basic push notification includes only a message and a title. The title is optional and will be defaulted to the application’s name if left empty. The message and title work in the same way as emails and SMSs, and use the same variables.
Descriptions of fields:
1. Role – Select role
2. User – Select user
3. Record reference – Select a data model attribute from the available options, based on the rule(s) using this action.
4. Previous record reference – Select a data model attribute from the available options, based on the rule(s) using this action.
5. Configuration – Select a parameter.
6. Application – Enter a mail-key for an application.
7. Manual Input – Manually enter an email address
-Select Role
2. Push Message – Enter a text-based message.
3. Display when the app is open – If enabled, an in-app dialog will open with the notification. Otherwise the notification will be silently ignored.
Invoke Webhook
Invoke webhook sends an HTTP request to a remote service.
Description of fields:
-Put
-Post
-Delete
-Basic
-Bearer
-Name
-Value
Execute command via SSH
The SSH action allows connecting to a remote server via SSH to execute a command and retrieve its output.
Description of fields:
required*
Transfer file via SFTP or SCP
Actions can be used to transfer files securely via SFTP or SCP. This action allows for secure file transfer with endpoints that support SFTP or SCP.
Descriptions of fields:
-SFTP
-SCP
-Upload a file
-Download a file
E.g. /var/app/files/file.txt
required*
Transfer file via FTP
The file-transfer actions are for uploading or downloading files via the respective protocols.
Descriptions of fields:
-Upload a file
-Download a file
E.g. /var/app/files/file.txt
required*
Note: This section is available for each action type, and lists the rule(s) that trigger the action. It’s especially important to understand the triggering rules when modifying an existing action.
Up Next
No Topics.