Edit triggers - KL-Psychological-Methodology/ESMira GitHub Wiki
Edit triggers
Trigger will either be executed by events ("Add event") or on a recurring basis ("Add schedule"). When executed, all actions that have been created for the trigger will be carried out.
Note: Android and iOS behave slightly different when dealing with timed actions (either events with a timeout or schedules). See Difference between Android and iOS
Actions
An action will always evoke a notification showing the message you provided for the action. Depending on what executed the trigger, the notification title will either be the title of the time of day (see Schedules), or the title of the event (see Events).
These types of actions are possible:
Invitation to questionnaire using a notification: Creates a clickable notification. When clicked, the notification will open the corresponding questionnaire.
Message to participant: Sends a message to the participant using the Message system.
Simple notification: Creates a simple notification that is not clickable.
Note: All actions (e.g. notifications) that would happen while a questionnaire is hidden (e.g. because their expiration runtime was reached) will be skipped (See Availability and runtime.
Schedules
Schedules are executed repeatedly every amount of days ("Repeat every"). You can also set if the schedule should only be executed at specific days of the month or specific weekdays. In this case the set amount of days ("Repeat every") will become the minimum of days in between executions (example: A schedule is set to be executed every 10 days and only on Wednesdays and Fridays. The first time it is executed on Fridays 2nd. 10 days later would be Monday 12th, but it can not be executed on Mondays, so the next execution will be on Wednesday 14th).
In order to be executed, a schedule needs to have at least one Time of day. The times of day determine when exactly the schedule will be executed. Times of day can either be fixed to the same time every day or randomly chosen. When set to random, you have to provide a start and end time (which span the time window in which the times of day are chosen), and a frequency (which determines how many times the schedule will be randomly executed between start and end time). If you set a frequency greater than 1, you can also make sure, that the randomly chosen times can not be closer together than a minimal interval by changing "Shortest interval". Another option when set to random is to set "Fixed" to "On". This will "fix" the points in time for the rest of the study after they have been randomly chosen for the first time.
Note: On some (Android-) phones the background tasks responsible for time based notifications are restricted. Read Notifications are not working for some participants for more information.
Events
There are several in app events that can initiate a trigger. Note that usually, event triggers are only executed when the event is triggered by the same questionnaire (events like "join" that are not bound to any questionnaire, will execute all event trigger from that type). For each event you can provide a delay which defines that its actions should be executed after a waiting time when the event has occurred.
Will only be triggered by events from a specific questionnaire: This overrides the default behaviour (that events will only be triggered by events from the same questionnaire) and has the event trigger listen to events of the given questionnaire.
Will only be triggered by events from other questionnaires (from this study): This reverses the default behaviour and has the event trigger listen to events from other questionnaires instead.
The following events are possible:
actions_executed: Created, when the actions of a trigger are executed (Only created in iOS. See Time of execution).
invitation: Created, when a notification, that leads to a questionnaire, was created (only created in Android. See Time of execution).
invitation_missed: Created, when an invitation to a questionnaire was missed.
joined: Created, when the study was joined.
message: Created, when a message was sent as an action for a trigger (only created in Android. See Time of execution).
quit: Created, when the study was left.
questionnaire: Created, when a questionnaire was filled out.
rejoined: Created, when the study was joined and there are still old statistics for this study saved in the app.
reminder: Created, when a reminder for an invitation was issued (only created in Android. See Time of execution).
schedule_changed: Created, when the participant changed the schedule of the study.
statistics_viewed: Created, when the participant opened the statistics for a study.
study_message: Created, when a study message (a message that can be sent to participants over the web interface. See Sending message) was received.
study_updated: Created, when the study was updated.