I’m trying to prevent users below the age of 18 from viewing adult content in a video streaming web app.
I already know how to get the age through a formula I got from another post. Now my question is, how do I prevent my repeating group from showing content for adults if the current user is below 18?
In my data type called “movie”, I have a field called genre, and if a certain movie’s genre is “adult”, I want the repeating group to exclude that if the current user is below 18.
Also, I have a dropdown that allows users to filter movies by genre, as shown in the screenshot below:
As you can see, these are just static choices and I would like to leave it at that for now.
How do I prevent the app from showing the adult option if the user is below 18?
I figured I’d have to add a workflow that starts with “when a page is loaded”, but adding conditions it’s still a little vague for me, as I’m new to Bubble.
What do you mean checkbox? Do you mean ‘User_is_over_18’ is a “yes/no” field type?
And if I make it that way, how do I make the program automatically set its value based on a user’s date of birth?
I think I got what you mean by this part. What you meant was add a conditional in the repeating group and the dropdown.
Also, when the app finds out that the user is below 18 via the field type mentioned earlier, a conditional in both dropdown and repeating group filters the data source being used on those two elements: