Automating Business Processes & Funnels via Triggers

Trigger executes a set of Operations, like operations with data, API calls, sending notifications and messages. That can be done:

  • in accordance with user-defined schedule
  • when a certain data changes on the platform side

Triggers use Filters to track the event of interest occurrence and to define the data range that will be affected by triggered Operations.

CREATE YOUR FIRST TRIGGER

In this example your trigger will send the notification message each time an app user clicks Submit button on the screen.

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 - appropriate filter detects those changes, notifies the attached trigger
  3. Trigger executes attached notification operation.

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

______________________________________

  1. ADD SENDING MESSAGE API METHOD
    1. Navigate to MY PROFILE section in the top right corner
    2. Go to Keys tab and copy Primary and Secondary Key to your favorite note app
    3. Navigate to API Providers section in the left hand side menu and click Add API Provider
    4. Fill in:
      1. Name: Mobsted
      2. Base URL: https://demoapp-admin.mobsted.com
    5. Click Save API Provider and then click Create New API Provider Method
    6. Name the fields:
      1. Api Provider Method Name: send garant
      2. Method: POST
      3. Endpoint URL: /api/v8/object/sendmessage
      4. Consumes Type: application/x-www-form-urlencoded
      5. Produces Type: application/json
    7. Click Add parameters at the bottom of the pop up and fill in the fields:
      1. Name: applicationId
      2. In: query
      3. Type: Integer
      4. Description: Application ID
      5. Check the box Required
      6. Click Save Parameter
    8. Click Add parameters again and fill in the fields:
      1. Name: message
      2. In: query
      3. Type: String
      4. Description: Message
      5. Check the box Required
      6. Click Save Parameter
    9. Click Add parameters again and fill in the fields:
      1. Name: subject
      2. In: query
      3. Type: String
      4. Description: Message subject
      5. Click Save Parameter
    10. Add one more parameter, named phone using the same settings as the message parameter
    11. Click Save API Provider Method
    12. Click Close
    1. Go to API KEYS tab and click Create New API Key
    2. On API Key - Create page fill in the fields:
      1. Api Key Name: Mobsted Key
      2. Method: Basic
      3. Key1 and Key2: copy paste the keys you've copied on step 1-b
      4. Click Save and then Close.

________________________________________________

  1. ADD API BASED SENDING MESSAGE OPERATION
    1. Click Operations in the left hand side menu
    2. Click Add Operation
    3. Open Mobsted dropdown on the left, select send garant method that we created on the previous step
    4. Fill in the field: Operation Name: Send Message
    5. In the EXECUTION section fill in the parameters:
      1. API Key: Mobsted Key
      2. applicationId: 1
      3. message: The button is clicked!
      4. subject: Clicked!
      5. phone: #Backendname:Phone#
    6. Click Save Operation and Close.

____________________________________________

  1. CREATE FILTER FOR BUTTON CLICK EVENTS
    1. Open Demo App
    2. Go to Backend in the top menu
    3. Click Add Filter and then Create New Filter
    4. Name the filter Send Message
    5. In Conditions section in the drop down after WHERE select Backendname
    6. Set it to be equal (=) to Send Message and click Save Changes.

___________________________________________________________________

  1. 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 Scheduled.
    7. Click Schedule and set it to run every minute, click Save Changes
    8. Click Start automatic mode and Save trigger, click Close.

_______________________

  1. CHECK THE RESULT
    1. Create new App
    2. Drag and Drop Text Input element to the Screen, set it's properties:
      1. Backendname = Phone
      2. Placeholder = phone number which will be used for testing starting with +
    3. Click Save Screen
    4. Drag and Drop Button element to the screen, set it's properties:
      1. Backendname = Send Message
      2. 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 its working
    10. Click the button to execute the trigger and make sure you've received the message to your phone.

TRIGGER SETTINGS DETAILS

Trigger scope

  • Trigger Scope - selects what Trigger will respond(react) to - Objects, Events.

Trigger mode

  • Manual mode - trigger is being launched via API or manually. Options below define scope of data to be affected by such manual launch:
    • All existing data: Trigger runs on all the records that are in the system and that fall under Filter conditions. Run Trigger instantly by clicking Execute now.
    • New records, since last execution: Trigger runs on all the new records that also match Filter conditions, since last Trigger execution. Run the Trigger instantly by clicking Execute now.

  • Automatic mode - every time data meets filter conditions. This mode allows to manage trigger executions with additional parameters:
    • All existing Data, Scheduled (periodically - every minute / hour / day / month specified)
      • No limit on number of executions
      • Limited number of executions - Enter a number. Would run only once per schedule defined.
      • Until date - set the date the trigger will stop executing.
    • On new records: runs right when a new record appears to match Filter OR a delay can be set in munites/hours/days/months.
MENTIONED ARTICLES


Was it useful?