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.

Actions

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:

  1. QuickActions are like macros and are the quickest and easiest way to perform the most common actions in an app. 
  2. Logic is easy to use but still allows with full control over what the script does
  3. JavaScript allows you to create advanced actions with full control over what happens.
Execute Script

Descriptions of fields:

Fields
Description
Action type
Use the type field to change the action type if necessary.
Action weight
Set the priority of this action in the form of a number. A lower number represents higher priority and means the action will execute earlier compared with other actions.
Action method
Pick an action
Rules that trigger this action
This is a list of all rules that are configured to trigger this action.

Action Methods

Action method can be described in three ways:

  1. Quick Action
  2. Logic
  3. 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:

Fields
Description
Go to view
Navigate to the specified view and optionally display selected record data in that view.
Go to user interface
Navigate to the specified user interface and display the default view or selected view, and optionally display selected record data in that view.
Go back
Navigate to the previous view.
Submit form
Submit the specified form, optionally include any related child forms, and then perform an action like refresh widget or go back to the previous view.
Open dialog
Open the specified dialog and optionally display selected record data in that view.
View record window
Open a new window using the selected template and select widget-record data.
Load record
Load a record from the selected widget and form.
Display a notification
Display a custom text notification of type Error, General or Success.
Play a sound
Play the selected sound from previously uploaded media resource files.

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

Fields
Description
Instruction Block
Instruction block represents instructions, for example, a send email block will send email.
Value Block
Value block represents values such as numbers and text strings(like “hello”, for instance). Value blocks are often used as arguments to configure instruction blocks.
Expression Block
Expression block performs logic and mathematics on their arguments, such as addition, subtraction or resolving whether a statement is true or false.
Control Flow Block
Control flow block controls how the puzzle is parsed. These usually take an expression as the argument and direct the parsing on different paths depending on whether the expression is true or not.
Variable Block
Variable blocks are special blocks that can be used to temporarily store values.

✰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.

Send Email

Description of fields:

Fields
Description
Action type
Use the type field to change the action type if necessary.
Forced
Use this field to force the message to be sent to users who have chosen not to receive notifications.
Action weight
Set the priority of this action in the form of a number. A lower number represents high priority and means the action will execute earlier as compared with other actions.
Sender name
Select type
-Configuration
-Manual Input
Select parameter
Email to
Select Reference
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.
Reply to
Select Reference
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.
Exclude sender
Select the checkbox, if you would like to exclude the sender.
Body format
-Text
-HTML
Subject
Define the subject of the email.
Add email content
Display mode (for HTML only)
–Source: enter HTML content.
–WYSIWIG: Use the visual HTML editor to enter content.
Define the email content
Attachments
The developer can send emails with or without attachments
-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.

Send SMS

Descriptions of fields:

Fields
Description
Action Type
Use the type field to change the action type if necessary.
Forced
Use this field to force the message to be sent to users who have chosen not to receive notifications.
Action Weight
Set the priority of this action in the form of a number. A lower number represents high priority and means the action will execute earlier as compared with other actions.
SMS to
Select Reference
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.
Add SMS content
Define the SMS content.

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.

Send Push Notification

Descriptions of fields:

Fields
Description
Action Type
Use the type field to change the action type if necessary.
Forced
Use the type field to not force the users who have chosen not to receive this notification.
Action Weight
Set the priority of this action in the form of a number. A lower number represents high priority and means the action will execute earlier as compared with other actions.
Push to
-Select Reference
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
Push includes:
Message
1. Push Title – Enter the notification title. If left blank the app name will be used.
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.
Button
Notifications can support zero, one or two buttons. Buttons can open app views and/or execute scripts.
Badge Update
Badges appear on mobile app icons to indicate that something new is available. Badges can also execute scripts.
Additional data
This option is used to load additional data for use by scripts.
Exclude Self
This option will exclude the sender from receiving the notification.
Actions when notification is clicked
Use this option to define actions to take when a user taps on a notification body instead of notification buttons. This action can open a view and/or execute a script.
Rules that trigger this action
Rules that trigger this action will be listed below.

Invoke Webhook

Invoke webhook sends an HTTP request to a remote service.

Invoke Webhook

Description of fields:

Fields
Description
Action Type
Use the type field to change the action type if necessary.
Action Weight
Set the priority of this action in the form of a number. A lower number represents high priority and means the action will execute earlier as compared with other actions.
Method
-Get
-Put
-Post
-Delete
URL*
Authentication
-None
-Basic
-Bearer
Headers
Click on +Add Header to add header
-Name
-Value
Pass through request body
The checkbox must be selected.
Content Type
Content type is the “MIME-type” of the request body

Request body
Request body is the content of the request – the payload.
Extract Data
Transform response
Select transformation template
Rules that trigger this action
Rules that trigger this action will be listed below, with icons

Execute command via SSH

The SSH action allows connecting to a remote server via SSH to execute a command and retrieve its output.

Execute Command via SSH

Description of fields:

Field
Description
Action Type
Use the type field to change the action type if necessary.
Forced
Use the type field to not force the users who have chosen not to receive this notification.
Action Weight
Set the priority of this action in the form of a number. A lower number represents high priority and means the action will execute earlier as compared with other actions.
SSH Host*
A SSH action must have an account and a command.
Port
The port number is used to identify the process for which the data is used.
Credential Parameters
The credential parameter allows the developer to run the function or as a different user.
Command
Command a directive to perform a specific task.
Rules that trigger this action
Rules that trigger this action will be listed below, with icons.

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.

Transfer file via SFTP or SCP

Descriptions of fields:

Fields
Description
Action Type
Use the type field to change the action type if necessary.
Action Weight
Set the priority of this action in the form of a number. A lower number represents high priority and means the action will execute earlier as compared with other actions.
SSH Host*
A SSH action must have an account and a command.
Port
The port number is used to identify the process for which the data is used.
Credential Parameters
The credential parameter allows the developer to run the function or as a different user.
File Transfer Method
Use the type field to select the file transfer method
-SFTP
-SCP
Operation
Use the type field to load the file
-Upload a file
-Download a file
Path
It’s the path of the source (or destination) file on the remote server.
E.g. /var/app/files/file.txt
Rules that trigger this action
Rules that trigger this action will be listed below, with icons.

required*

Transfer file via FTP

The file-transfer actions are for uploading or downloading files via the respective protocols.

Transfer file via FTP

Descriptions of fields:

Fields
Description
Action Type
Use the type field to change the action type if necessary.
Action Weight
Set the priority of this action in the form of a number. A lower number represents high priority and means the action will execute earlier as compared with other actions.
FTP Host*
A FTP action must have an account and a command.
FTP Port
The FTP port number is used to identify the process for which the data is used.
Credential Parameters
The credential parameter allows the developer to run the function or as a different user.
Operation
Use the type field to load the file
-Upload a file
-Download a file
Path
It’s the path of the source (or destination) file on the remote server.
E.g. /var/app/files/file.txt
Rules that trigger this action
Rules that trigger this action will be listed below, with icons.

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.