I am trying to show a list of restaurants’ happy hours. For each restaurant I would like to display the name, happy hour hours, and the happy hour offering.
I have been able to create a repeating group that displays all of this information, however, I can’t figure out a way to hide the restaurants’ that don’t have a happy hour on a specific day.
A simple version of my database structure:
Data type: Restaurant
Data fields:
happy_hour (list of Happy Hours)
name (text)
Data type: Happy Hour
Data fields:
happy_hour_offering (text)
day (_Days_Of_The_Week)
opening_hour (_Hours_Of_The_Day)
open_am_pm (Hours_AmPm)
closing_hour (_Hours_Of_The_Day)
close_am_pm (Hours_AmPm)
restaurant - Restaurant - Data Type
Option Sets listed above
_Hours_Of_The_Day - this is an option set containing the 24 hours in a day split into 15 minute increments.
_Days_Of_The_Week - This is an option set containing Sunday through Saturday
_Hours_AmPm this is an option set containing the values am and pm
@icaroalmeida, thank you for the response!
The group that displays the happy hours is the repeating group with three text elements. It looks like this:
Are you recommending putting the conditional on the repeating group? If so, would you mind trying to write out the expression I would use?
For Instance today day is Monday. so you only want to show those restaurants who have happy hours on Monday and hide those who do not have ?
Am I right?
If this is what you want I think instead of making a “Do a search for:Restraunt”
Make - “Do a search for :happy hours”
condition- “Days of the week contains current day”
Adn you have already linked the happy hour to a restraunt so in the repeating group to populate the name of the restaurant you can use “current cell’s happy hours restrunts name”
now in every 24 hours you can update the current day option set to make this entire process dynamic
Hope this helps
If any point of my solution is wrong feel free to reply this helps me grow
This seems like a very complicated way to store happy hours. Why not just a openingTime (number 1-24) and a closingTime (same)? It would also allow you to find records already in progress or upcoming etc…
Thank you to everyone who chimed in with some helpful recommendations. I realized I was using “Do a search” for the Restaurant data type and when I switched it to the Happy Hour data type I was able to get everything to display and hide how I would like it.
@nocodenikhil I ended up using conditional statements to show the happy hours according to the day selected in the drop-down. Here’s what that looks like:
@code-escapee One reason is because a restaurant’s happy hour offering on Monday is different than the offering on Tuesday. A second is because I liked the formatting more this way and it is more clear for the restaurant when setting up their happy hour times in their dashboard.
I get that it’s different hours for different days and that the front end should display as hours and 15 minute inrements and am/pm. But DB wise I suggest it be stored as a number e.g., 5:15pm = 17.25