Forum Academy Marketplace Showcase Pricing Features

How to create simple drop down with dynamic dates

Hi,

I am trying to create a simple scheduler for laundry delivery.

The first drop down menu should display dates, starting with tomorrow, then extend out 7 days, AND exclude sundays (when we are closed). So it should look similar to this:

Unfortunately, the dynamic date/time construction isn’t working. Here is what I currently have that isn’t working:

The obvious problem is that I in no way understand the logic of what the program is trying to do. Can anyone help?

1 Like

Great question - I have a recommendation why don’t you use the Date/Time Picker?

This element lets you users pick a date and (optionally) a time with a calendar type interface. The value returned by this element is a date that can be used in date fields.

It’s under Input Forms and is built to handle date/time functions much better than the generic dropdown box. Then you can add your logic inside an element that know date/time definitions.

2 Likes

Hey John,

I wasn’t using the date picker because (foolishly?) I was thinking that this would be the simplest. Maybe not from a programatic stand point, but from a user standpoint. Especially because the options are going to be so limited. Dates are only tomorrow +7 days, and there will only be 3 times users could choose from. A 2 hour block in the morning, another in the afternoon, and a final in the evening.

So the overall functionality would be a quick select day, select time slot, then schedule.

With this in mind, it seemed like 2 drop down menus were quick and clean.

Just tried the date/time picker and the logic was much easier to solve. I don’t know if I like having an entire calendar pop up.

1 Like

I’m 100% throwing out an idea that I have no clue if its even possible, so bear with me. What if you created a table called Available Days, and you only put 7 days in it. Schedule an API workflow for midnight that empties that table, then adds a new 7 days, then schedules the API workflow for current date/time+24 hours.

Your data source for the dropdown would be something like, “do a search for > Available Days”

No clue if it’s possible or not, but I’m sitting in a meeting that hasn’t started yet and was thinking on it.

4 Likes

that’s interesting. What API would do that?

1 Like

You’d create an API workflow within bubble, then just call your own API. I think you have to be on a paid tier to do that, tho.

2 Likes

That’s interesting. It’s amazing how complicated something that looks like it should be so simple can get ;0)

Just testing around, the date/time picker functionality is much easier, and follows the logic much more simply.

But I don’t see any way to constrain times to one of 3, 2 hour time blocks (9am-11am, 1pm-3pm, 5pm-7pm). If there are any ideas there, I might just do that instead.

1 Like

Populate a table with dates.

Then do a Search where date is between “today” and “today + 7 days”. Sort.

The hardest bit is populating the dates.

3 Likes

Another idea would be to display just the date portion in the date/time picker. Then next to it create the dropdown with your 3 time block choices just as static choices. Create a submit/save button. Then tie a workflow action to the button that saves the date and time block chosen. So you will have the date picked and time block picked saved with the associated user. This seems to solve what you’re trying to do…

1 Like

It depends on how complicated the manipulation of the data is then going to get. So displaying a list of free slots for example.

But if it is purely input, rather than output, it is a good idea.

1 Like

For right now we are trying to get an MVP up and running. It’s not an ideal solution, but it is good enough for what we need it to do right now.

Already started working on this, and the issues with the menu bar don’t seem to be a problem. Working on the the workflow at the moment.

Thank you for your help!

1 Like