Allow users to select a time for daily summary

I’ve not been able to find a straight answer to how I should set this up.

Goal: allow users to select a time like 7am for when to send new notifications.

I have a workflow to trigger an email summary if they have new notifications. I want when the trigger schedules it will look at the selected time and select the next Occurrence of that time.

So if I have 7am selected on my notification settings, any new notifications after 7am will be triggered for 7am the next day. If I get a new notification at 6am it will be triggered at 7am in an hour.

Input field:
Would I use an input set to integer, and then have a am/pm dropdown?

How would I convert that to an understandable time in the workflow when scheduling the API?

Does anyone have any thoughts on this?

Bubble Gods, @adamhholmes @Jici @mikeloc @rpetribu

Any thoughts on how to do this? Appreciate any help.

You should have a time picker and use Two WF. One conditionnal if selected time > current date time extracted hour and one <=
In the WF, you use scheduled backend WF with current date and time: change date to, change hour to… depending of the WF

Thank you. I’ll have to try this once my Bubble site is back up it seems to be down right now.

One question is can you have the Date and time picker for time only? I feel like when I was trying to set it up I had the option to do date only or date and time, but not time only. I tired a plugging that I think was called Air Date, but it had so many options to pick from I could not get it to work. Am I missing something?

I think there,s Air Dropper Time picker.
But you can also just use a dropdown. Easier if you want the user to only pick hour only. But if you wan’t more flexibility with minutes, a plugin may be a better option

If I wanted 3 dropdowns(hour, minute, AM/PM) would that be able to work? I’m just trying to think how I would translate the dropdowns to a time.

My guess: Change Hour to (hour Dropdown value), Change minutes to (minute Dropdown value), but how would I get the AM/pm to translate to time? I’m assuming I could use military time in the hour dropdown, but that’s not very user friendly as most people don’t use that.

I would need to read up on that Air Dropper Pluggin because as much as I tried to get it to work it wanted to be a giant cube that was bright blue. I could not get it to look like a normally time picker.

A “cheat” that you can do.
use the Bubble Date Time Picker.
Put something (a group or a shape) over the date part so user cannot see this. Set an initial value to the date part (it doesn’t matter which date is it because what you want is the time part).
The value will be a complete date and time but you can use change hours to… and on the value of the date picker, use extract hours.

Another option is to create options sets and use options set to set value according to AM or PM.
Create an option set of hours. Set display to PM time (12 to 23), and add another attribute for AM time (0 to 11). This way, when user select PM, you will have a conditonnal to use the display value and when user select AM, you set a conditionnal AM Attribute.

The only other option I can see after that is to create your own plugin.

I don’t think this is a good idea. I am using the “Air Date/Time Picker” plugin in some projects, it’s free and very easy to use:

image

You can use it to let your users select the time they want.

And you can save the selected hour as minutes (number). So, 12:00 PM will be 720. Doing this, you make the time comparison much much easy.

@Jici, I went with a version of the second option. I created option sets. Hour has two attributes for AM & PM(I wanted to list 1-12, and 12 needed to be a PM time, so that was the reason I did not use the Display in my wf).

My trigger to send I’m using the Hour which is a number field, and Minutes is a option Set, but using a attribute which is a number field.

For the example the Change hour time is 7 and the Change minute time is 15. I assume this would send at 7:15 AM, but it’s sending instantly.

Two thoughts before going through and doing a bunch of work to change:

  • Is it an issue that I’m using an Option set’s attribute value?
  • Should the field be a text field instead of a number?

Any thoughts of what’s going on?

Did you test in debug mode and step by test and check what is set in the scheduled date

It’s all on the backend workflow, so stop by step does not show anything.

I think that your condition is not correct.
Let’s say it’s currently 10 AM. User select 7H AM. So Current date and time change hour will be 7H that is less than current date and time, so the email can be sent tomorrow.
Change your > to <

Man, I can’t seem to get the logic of those. I even wrote it down if this is higher and and the current time is after which it should be. It was flipped, and that is why it was sending instantly. I was creating them for a date in the past which caused them to be sent immediately. Now that I flipped the conditions on the two it seems to be working perfectly. Thank you. One day I’ll be able to wrap my head around all this programming logic.

1 Like