FAQ

How to Implement Custom Recurring Reminders in Bubble.io with Complex Scheduling Patterns?

Understanding Complex Recurring Reminders in Bubble.io

Implementing custom recurring reminders in Bubble.io that support complex scheduling patterns requires a strategic approach using Bubble's backend workflows and data structure. This tutorial will guide you through creating a reminder system that allows users to set reminders for specific intervals (like every 2 weeks), on specific days (Monday and Friday), at specific times (9:00am).

Setting Up Your Data Structure

First, you'll need to create a data structure to store reminder preferences:

1. Create a Reminder data type with these fields:

- User (type: User)

- Interval (type: Number) - to store how many weeks between occurrences

- Days (type: List of Option Set) - create an Option Set called "Weekday" with values 0-6 representing days

- Time (type: Time) - to store when the reminder should trigger

- Title (type: Text) - reminder title

- Message (type: Text) - reminder content

- Last Run (type: Date/Time) - to track when the reminder last triggered

- Active (type: Yes/No) - to enable/disable reminders

Creating the Backend Workflow System

The implementation uses two key components: a daily recurring event and conditional scheduling:

Step 1: Create a daily recurring backend workflow

Go to Workflow tab → Backend workflows → New recurring event. Name it "Daily Reminder Check" and set it to run daily at midnight. This workflow will check all reminders to see if they should run today.

Step 2: Configure the daily workflow logic

In this workflow:

1. Do a search for Reminders where Active is Yes

2. For each Reminder, run the following checks:

3. Get the current day of the week (0-6)

4. Check if this day is in the Reminder's Days list

5. Check if the Reminder should run this week (based on interval and Last Run date)

6. If conditions are met, schedule another backend workflow to run at the specific time

Step 3: Create a secondary backend workflow for execution

Create another backend workflow named "Execute Reminder" that will be scheduled by the daily check workflow. This workflow will:

1. Accept a Reminder as an input parameter

2. Trigger the actual notification (email, in-app message, etc.)

3. Update the Reminder's Last Run field to the current date

Implementing the Week Interval Logic

The trickiest part is determining if a reminder should run based on its interval setting. Here's how to implement the "every X weeks" logic:

Step 1: Calculate weeks since last run

In your daily check workflow, add an expression to calculate the number of weeks since the reminder last ran:

1. If Last Run is empty, always run the reminder (first occurrence)

2. Otherwise, calculate: (Current date - Last Run date) converted to weeks

3. Use the rounded down integer value of this calculation

Step 2: Check if it's time to run based on interval

Add a condition: "Only when Weeks Since Last Run is greater than or equal to Reminder's Interval"

Creating the User Interface for Scheduling

Design a user-friendly interface for setting up these reminders:

1. Create a "New Reminder" form with:

- Input for Title and Message

- Dropdown for Interval (1 week, 2 weeks, etc.)

- Multi-select for Days (Monday, Tuesday, etc.)

- Time picker for the reminder time

2. Create a workflow on form submission that:

- Creates a new Reminder in the database

- Sets all fields based on user input

- Converts user-friendly day selections to the 0-6 format

- Sets Active to Yes

3. Start the recurring workflow for this user

When a user creates their first reminder, trigger the "Daily Reminder Check" recurring workflow for that user using the "Set or cancel a recurring event" action.

Handling Time Zone Considerations

For reliable reminder timing across different time zones:

1. Store the user's time zone in their profile

2. When scheduling the "Execute Reminder" workflow, calculate the correct time based on:

- The reminder's set time (e.g., 9:00am)

- The user's time zone offset

- The server's time zone

Testing and Troubleshooting

Test your implementation thoroughly:

1. Create test reminders with different scheduling patterns

2. Use the Bubble debugger to monitor workflow executions

3. For testing, you can temporarily modify the current date/time in your workflows

4. Check the Logs section in Bubble to see scheduled workflows

If reminders aren't triggering correctly, common issues include:

- Incorrect day index values (remember Sunday is 0, Monday is 1, etc.)

- Time zone conversion errors

- Calculation issues with the week interval logic

Optimizing for Performance

For apps with many users and reminders, consider these optimizations:

1. Instead of checking all reminders daily, organize them by day of week

2. Only process reminders relevant to the current day

3. Use batched operations where possible

4. Consider implementing a custom plugin for complex time calculations if needed

By following this implementation approach, you'll create a robust, custom recurring reminder system in Bubble.io that supports complex scheduling patterns, giving your users the flexibility they need for their reminder preferences.

Watch next

Suggested tutorials