For Memento Database 5.6 and up
Automation triggers are a powerful feature in Memento Database that allow your database to respond automatically to specific events. Unlike script triggers, automation triggers are created through the user-friendly interface without any coding required, making them accessible to all users regardless of technical background.
How to Create an Automation Trigger
To create a new automation trigger:
- Open the library where you want to add the trigger
- Tap the menu button and select Automations
- Go to the Rules tab
- Tap the + button to add a new rule
- Select the appropriate event and phase (more on these below)
- Configure the conditions and actions for your trigger
Understanding Events and Phases
When setting up a trigger, you’ll need to specify two critical components:
- Event – The action that causes the trigger to activate (such as creating an entry)
- Phase – The specific moment during that event when the trigger should execute
The combination of event and phase gives you precise control over when your automations run. Let’s explore the available options:
Library Events
Event Type | Phase | Blocks UI |
---|---|---|
Opening a library | Opening the library | Yes |
This trigger executes whenever you open the library. It’s useful for showing welcome messages, checking for overdue items, or refreshing calculations.
Entry Creation & Modification Events
Event Type | Phase | Blocks UI |
---|---|---|
Creating an entry | Opening an Entry Edit card | Yes |
Before saving the entry | Yes | |
After saving the entry | No | |
Updating an entry | Opening an Entry Edit card | Yes |
Before saving the entry | Yes | |
After saving the entry | No |
These triggers respond to new entries being created or existing entries being modified. Each has three possible phases:
- Opening an Entry Edit card – Executes when you first open the form to create/edit an entry. Useful for setting default values or showing input instructions.
- Before saving the entry – Executes after you’ve filled in information but before the data is committed to the database. Perfect for validation checks or calculating derived values.
- After saving the entry – Executes once the entry has been successfully saved. Ideal for follow-up actions like creating related entries or sending notifications.
Entry Management Events
Event Type | Phase | Blocks UI |
---|---|---|
Deleting an entry | Before deleting the entry | Yes |
After deleting the entry | No | |
Opening an Entry View card | Before window display | Yes |
After window display | No |
These triggers activate when you view or delete entries:
- Deleting an entry – Can execute either before deletion (to perform checks or backup data) or after deletion (to update related entries or counts)
- Opening an Entry View card – Activates when viewing an entry’s details, either before or after the view is displayed
Note: Deletion events are triggered only when moving entries to the recycle bin
Favorites Events
Event Type | Phase | Blocks UI |
---|---|---|
Adding an entry to Favorites | Before the operation | Yes |
After the operation | No | |
Removing an entry from Favorites | Before the operation | Yes |
After the operation | No |
These triggers execute when entries are added to or removed from your Favorites list:
- Adding to Favorites – Useful for recording when important entries are flagged or for extending the favoriting functionality
- Removing from Favorites – Can be used to track changes in status or update related entries
Scheduled Events
Event Type | Phase | Blocks UI |
---|---|---|
At scheduled time | – | No |
Scheduled events allow you to execute rules at specific times or intervals, regardless of user interaction. They’re perfect for:
- Daily/weekly report generation
- Periodic data cleanup
- Recurring reminders or status updates
Note: Scheduled event execution timing may not be exact. On Android devices, the actual execution time depends on system settings and optimization features. The system might delay or batch scheduled tasks to optimize battery life and system resources.
Understanding UI Blocking
In the tables above, you’ll notice the “Blocks UI” column. This indicates whether the application interface will be unresponsive while the trigger executes:
- Yes – The user interface is blocked until the trigger completes its tasks. The user must wait before continuing.
- No – The trigger runs in the background, allowing the user to continue interacting with the application.
Important: Avoid creating “heavy” rules (those processing many entries or performing complex calculations) for triggers that block the user interface. These can cause noticeable delays and frustrate users. Instead, design such intensive operations for asynchronous phases, or break them into smaller steps.
Practical Examples
Example 1: Automatic Due Date Alerts
Event: Opening a library Phase: Opening the library Action: Check for approaching deadlines and display alert messages
This trigger will scan for entries with due dates approaching whenever you open the library, ensuring you never miss an important deadline.
Example 2: Data Validation
Event: Creating an entry Phase: Before saving the entry Action: Check if required fields are filled correctly
This trigger ensures data quality by validating information before it’s saved to the database. It can prevent entries with missing or invalid data.
Example 3: Automatic Stock Alerts
Event: Updating an entry Phase: After saving the entry Action: Send email notification when inventory drops below threshold
In an inventory management system, this trigger would monitor stock levels and automatically alert you when it’s time to reorder products.
Example 4: Scheduled Database Maintenance
Event: At scheduled time Phase: – Action: Archive old entries, update statistics, generate reports
Set up a nightly or weekly maintenance routine that keeps your database clean and generates summary reports automatically.
Example 5: Enhanced Favorites Management
Event: Adding an entry to Favorites Phase: After the operation Action: Send notification to team members or add tags
When important items are favorited, automatically notify relevant team members or add classification tags.
Tips for Effective Trigger Use
- Choose the right phase – “Before saving” is best for validations, while “After saving” is ideal for follow-up actions.
- Keep triggers focused – Each trigger should have a single, clear purpose.
- Test thoroughly – Create sample entries to verify your triggers work as expected.
- Consider performance – Complex triggers that run frequently could slow down your database.
- Use conditions – Not every entry needs the same processing; use conditions to limit when your triggers activate.
- Be mindful of UI blocking – Place resource-intensive operations in non-blocking phases when possible.
- Set realistic schedules – Remember that scheduled events might not run exactly on time, especially on mobile devices.