Unlocking database entries by pressing a button

Hello guys!

I am building a little app - basically, there are 30 lessons (stored as records in a Lessons database collection). I want the users to complete the lessons step-by-step - only when a lesson is completed, display the next lesson in the list.

What I’ve done so far:
User database collection has a “hasCompleted” number property, in which I add +1 after user clicks “COMPLETED” in the lesson. So if the user has 7, it means he has completed 7 lessons and the eighth one should appear.

I’m having trouble connecting that number property to the Lessons database collection, so that it would hide/show the lessons.

Any help would be appreciated - I am new to Adalo but have some coding experience. Maybe I have to re-do my database record setup.

Looking forward to your guys’ reply.

All the best

Hi Tom,

Welcome to the community :partying_face:

You would need a number property in the lessons collections as a ID. And once you adding the lessons add the IDs too. Like Lesson 1 - 1 , Lesson 2 - 2 etc.

Then you can create a many to many relationship between the users collection and the lessons collection ( 3rd option when creating the relationship ). You can name the relationship created on the lessons collection like listened users and for the relationship created in the users collection you can name it as like listened lessons.

Then you can add a custom list to the home screen and connect it to the lessons collection and add a custom filter that Listened Users > Does not contains > Logged in user. And in the list set the maximum number of items to 1.

And you can add a button to the list and in the button you can add a Update current lesson action that add logged in user to the Listened Users relationship.

You can do this using another collection that create a record in that collection and making the conditions but this way will be easier!

And this app created by @Yongki will help you too! : Tinder app functions (Like, Dislike, Match) using list with filters - #9 by Yongki Same like this but it’s for users.

Hope this helps!

Thank you

Hey, really appreciate your in-depth answer. Will try this tonight. Thanks x