Automating Business Processes & Funnels via Triggers
Automate with triggers
Trigger executes a set of operations, i.e. operations via external and internal API calls, API based notifications and messaging.
Triggers are activated by changes in:
Statuses
Triggers use Filters to track data linked to the triggered operations. Currently, Mobsted platform supports triggers ran in automatic mode on new records. The trigger runs immidiately when a new filtered record appears.
______________________________
CREATE YOUR FIRST TRIGGER
In this example the trigger will send the notification message to app user each time Submit button is clicked.
How this works:
Each time the button is clicked, an event with appropriate data is created ("Send Message" event)
Each time a new "Send Message" event is created, the appropriate filter detects those changes and notifies the attached trigger
Trigger executes attached notification operation (sends notification message).
Steps to take:
ADD SENDING MESSAGE API METHOD
ADD API BASED SENDING MESSAGE OPERATION
CREATE FILTER FOR BUTTON CLICK EVENTS
CREATE SENDING TRIGGER BASED ON BUTTON CLICK EVENTS FILTER
CHECK THE RESULT
______________________________________
ADD SENDING MESSAGE API METHOD
Go to Keys tab and copy Primary and Secondary Key to your favorite note app
Navigate to Providers section on the left hand side menu and click Add API Provider
Fill in:
Name: Mobsted
Base URL: https://*yourTenantName*.mobsted.com
Click Save API Provider and then click Create New API Provider Method
Name the fields:
Api Provider Method Name: send garant
Method: POST
Endpoint URL: /api/v8/object/sendmessage
Consumes Type: application/json
Produces Type: application/json
Click Add parameters at the bottom of the pop up and fill in the fields:
Name: ApplicationId
In: formData
Type: String
Description: Application ID
Check the box Required
Click Save Parameter
Click Add parameters again and fill in the fields:
Name: message
In: formData
Type: String
Description: Message
Check the box Required
Click Save Parameter
Click Add parameters again and fill in the fields:
Name: email
In: formData
Type: String
Description: Object email
Check the box Required
Click Save Parameter
Click Save API Provider Method
Click Close
13. Go to API KEYS tab and click Create New API Key
14. On API Key - Create page fill in the fields:
Api Key Name: Mobsted Key
Method: Basic
15. Key1 and Key2: copy paste the keys you've copied on step 2
Note: if you generate new Mobsted API keys, make sure you have updated the keys in already exsisting operations with Mobsted provider.
16. Click Save API Key and then Close.
__________________________________________________
ADD API BASED SENDING MESSAGE OPERATION
Click Operations on the left hand side menu
Click Add Operation
Open Mobsted dropdown on the left, select send garant method created on the previous step
Fill in the field: Operation Name: Send Message
In EXECUTION section fill in the parameters:
API Key: Mobsted Key
applicationId: 1 or use Hashtag: #Application:id#
message: Hello
email: #Object:Email#
Click Save Operation and Close.
____________________________________________
CREATE FILTER FOR BUTTON CLICK EVENTS
Open Demo App
Go to Backend on the top menu
Click Add Filter and then Create New Filter
Name the filter Send Message
In Conditions section on the drop down after WHERE select Backendname
Set it to be equal (=) to Send Message and click Save Changes.
_______________________________________________________________________
CREATE SENDING TRIGGER BASED ON BUTTON CLICK EVENTS FILTER
Navigate to Triggers tab in the filter created and click Create new trigger
Name the trigger as Send Message
From Operations dropdown select pre-created Send Message operation and click Add Operation
Trigger Scope menu: select Events
Trigger Mode menu: select Automatic
On new data appearing select Instantly
Click Start automatic mode and Save trigger, click Close.
____________________
CHECK THE RESULT
Add new screen in Demo app
Drag and Drop Text Input element to the screen, set it's properties:
Backendname = Email
Placeholder = email address
Click Save Screen
Drag and Drop Button element to the screen, set it's properties:
Backendname = Send Message
Caption = Submit
Click Actions, then open Add new action drop down and select Create Event
Set the name of the event = Send Message
Click Save
Click Save Screen
Click Preview button to launch the app from the current screen to check it works
Click the button to execute the trigger and make sure you've received the message to your phone.
MENTIONED ARTICLES
Statuses
Smart Filters
Last updated