Automating Business Processes & Funnels via Triggers

Trigger executes a set of Operations, i.e. 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 data to be affected by the triggered Operations.

CREATE YOUR FIRST TRIGGER

In this example your trigger will send the notification message to the app user each time the 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, 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

______________________________________

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

___________________________________________________________________

  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 "+" sign
    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 it works
    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 - defines whether a trigger will respond(react) to changes in Objects or Events.

Trigger mode

  • Manual mode - trigger is being launched via API or manually. Options below define the scope of the data to be affected by such manual launch:
    • All existing data: trigger runs on all the records in the system falling under Filter conditions. Run trigger instantly by clicking Execute now.
    • New records, since last execution: trigger runs on all the new records matching filter conditions, since the last trigger execution. Run trigger instantly by clicking Execute now.
  • Automatic mode - trigger runs every time the data meets the filter conditions. This mode allows to manage trigger executions with additional parameters:
    • All existing Data, Scheduled (periodically - every minute / hour / day / month specified)
      • Unlimited number of executions
      • Limited number of executions: enter a number and trigger will run only per schedule defined.
      • Until date: set the date when trigger stops executing.
    • On new records: runs immidiately when a new record which matches the filter appears OR a delay can be set in munites/hours/days/months.

MENTIONED ARTICLES


Was it useful?