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:

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:

  1. Each time the button is clicked, an event with appropriate data is created ("Send Message" event)

  2. Each time a new "Send Message" event is created, the appropriate filter detects those changes and notifies the attached trigger

  3. Trigger executes attached notification operation (sends notification message).

Steps to take:

  1. ADD SENDING MESSAGE API METHOD

  2. ADD API BASED SENDING MESSAGE OPERATION

  3. CREATE FILTER FOR BUTTON CLICK EVENTS

  4. CREATE SENDING TRIGGER BASED ON BUTTON CLICK EVENTS FILTER

  5. CHECK THE RESULT

______________________________________

ADD SENDING MESSAGE API METHOD

  1. Go to Keys tab and copy Primary and Secondary Key to your favorite note app

  2. Navigate to Providers section on the left hand side menu and click Add API Provider

  3. Fill in:

    • Name: Mobsted

    • Base URL: https://*yourTenantName*.mobsted.com

  4. Click Save API Provider and then click Create New API Provider Method

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

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

  7. Click Add parameters again and fill in the fields:

    • Name: message

    • In: formData

    • Type: String

    • Description: Message

    • Check the box Required

    • Click Save Parameter

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

  9. Click Save API Provider Method

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

  1. Click Operations on the left hand side menu

  2. Click Add Operation

  3. Open Mobsted dropdown on the left, select send garant method created on the previous step

  4. Fill in the field: Operation Name: Send Message

  5. In EXECUTION section fill in the parameters:

    1. API Key: Mobsted Key

    2. applicationId: 1 or use Hashtag: #Application:id#

    3. message: Hello

    4. email: #Object:Email#

  6. Click Save Operation and Close.

____________________________________________

CREATE FILTER FOR BUTTON CLICK EVENTS

  1. Open Demo App

  2. Go to Backend on the top menu

  3. Click Add Filter and then Create New Filter

  4. Name the filter Send Message

  5. In Conditions section on the drop down after WHERE select Backendname

  6. Set it to be equal (=) to Send Message and click Save Changes.

_______________________________________________________________________

CREATE SENDING TRIGGER BASED ON BUTTON CLICK EVENTS FILTER

  1. Navigate to Triggers tab in the filter created and click Create new trigger

  2. Name the trigger as Send Message

  3. From Operations dropdown select pre-created Send Message operation and click Add Operation

  4. Trigger Scope menu: select Events

  5. Trigger Mode menu: select Automatic

  6. On new data appearing select Instantly

  7. Click Start automatic mode and Save trigger, click Close.

____________________

CHECK THE RESULT

  1. Add new screen in Demo app

  2. Drag and Drop Text Input element to the screen, set it's properties:

    • Backendname = Email

    • Placeholder = email address

  3. Click Save Screen

  4. Drag and Drop Button element to the screen, set it's properties:

    • Backendname = Send Message

    • Caption = Submit

  5. Click Actions, then open Add new action drop down and select Create Event

  6. Set the name of the event = Send Message

  7. Click Save

  8. Click Save Screen

  9. Click Preview button to launch the app from the current screen to check it works

  10. Click the button to execute the trigger and make sure you've received the message to your phone.

MENTIONED ARTICLES

Last updated