Trying to structure a rotating daily lesson feature

Complete newbie here. I’m building an app that will provide daily lessons for the user. These will appear in a pop up on the main user page. I would like the content to change everyday and avoid repeats (i.e. new lesson everyday). I’m struggling with how to structure this so that the information in the popup cycles through. Any basic advice for how to approach this is welcome.

My approach would be to use option sets

Option Set Structure
Step 1: Create your option set call it, let’s say, “Daily Lesson”.
Step 2: Create a new attribute of type text called, let’s say, “Lesson description”
Step 3: Add all your daily lessons and then modify each of their “Lesson description” to what you want that lesson to say in detail.

Data Type
Step 1: Create a data type, let’s call it, “Lesson of the Day”
Step 2: Give it a field, let’s call it “Current Lesson” with data type “Daily Lesson” (The option set you created)
Step 3: Give it another field, let’s call it, start date with data type “date”. We need this to calculate how many days into the daily lessons we are.
Step 4: Give it one last field, let’s call it, “seen by” with data type LIST of users.

The Backend Workflow
Step 1: Create a backend workflow that will change the “Current Lesson” at 12:00 AM every day, reset who has seen the popup, and then reschedule itself.
-You do this by setting the “Current Lesson” to: All Daily Lesson: item#(current date/time - this Lesson of the Day’s start date, formatted as days: rounded to 0
-To reset who has seen the popup, just clear “has seen”
-Then, reschedule that same Backend workflow to: (current date time) +days: 1

Step 2: Add a button to “jumpstart” this backend workflow. That will Create a “Lesson of the day”
-Leave the “Current Lesson” empty".
-Leave the “seen by” empty.
-The start date should be: (current date/time): rounded down to date).

Step 3: Schedule API Workflow to be the one you created in step 4. Schedule it for (current date/time): +days) 1) rounded down to date).
Step 4: Go in run mode and click this button. Delete it afterwards.

The Popup!
Step 1: Give the popup data type “Daily Lesson”
Step 2: Data source: Search for “Lesson of the Day”: first item’s “current lesson”
Step 3: Add the text in the popup to be: The popup’s daily lesson’s “Lesson description”.

Toggle the popup
Step 1: create an “on page load” action → only when (do a search for “Lesson of the Day”: first item’s “seen by” doesn’t contain: current user.
Step 2: The action is to show/animate in the popup.
Step 3: Depending on how you structure your popup, such as closing it with a button or simply clicking anywhere outside the popup to close it, this will be different. But essentially, when the popup is closed, have a workflow that will add this user to the “seen by” list. That way, when the page is loaded again, it won’t appear.

When the backend workflow triggers, it will reset who has seen this popup.

I can’t think of an easier way to do this. Maybe someone else can provide their input.

Hope this helps. if you have any questions, feel free to ask. Cheers! :slight_smile:

This is incredibly helpful and gives me a good picture of both the forward facing and backend structure. I’m going to give this a go right now and will let you know how it goes. Thank you so much!

So, I got immediately stuck (did I mention I’m a complete newbie). I was able to add the option set and attributes, but I’m a not quite sure where to add the daily lessons. Should these be on a page or somewhere in the data tab. Also, since there are multiple lessons should the option set attribute be set to a list of texts?

Thank you, again, for the help!

No worries,

You add each of the lessons in the option sets tab.
Also, the attribute should not be a list of text. You are creating many lessons, each with one single text description.

Your Lessons
Type in what you want the lesson’s name to be and click “Create”

Your Attribute
Create the Lesson description by clicking “Create new attribute”

Your Attributes For a specific Lesson
Modify each one of the Lessons you’ve created and type in a lesson description

May I also recommend, the moment you get stuck on something, search up a video on YouTube about it. That way you can learn exactly what you need! :slight_smile:

Let me know your next steps

Thank you, and will do! I found a helpful video immediately after I typed my response and will be sure to explore this option before preemptively coming here.

1 Like

Sounds good! :slight_smile:

Hey there, just want to follow up on this topic, what if you want to show for example a workout, but there is over 200+ workout in the database, do we create a option for each one?

Not the expert here, but that’s what I’m doing for the lessons - will have a years worth, so will make 360 options within this option set. At least that’s how I’m approaching it at this point.