Finding the ordinal day of the month

Hi All,

I’ve been using Bubble now for the last 6 months, love it and have been able to figure out most things myself but I can figure out for the life of me how to find the 1st/2nd/3rd/4th/last specific day of a specific month

For example, here’s a simple form that a user fills out:

I then want to take that data and create a backend workflow for the specified data.

Any thoughts?
Regards
Stew

If I understand what you’re asking correctly, and assuming you want to schedule your backend workflow to run on the selected day you can just use :change date to dropdown’s day

You can use current date/time: change date to dropdown’s day (if the current date is less than that day)

Or

current date/time: +1month: change date to dropdown’s day (if the current date is more than the dropdown’s day)

Based on your screenshot, I would make sure that the dropdown that contains the ordinal numbers (first, second, third, etc.) is actually an option set with attribute value to store the actual number value. This way, each option in the dropdown has the display (text) value for the ordinal number, but also contains the actual number value (1, 2, 3 etc.)

This way, you can write the expression current date/time:rounded down to month (+days) dropdown value's number.

Hey Sam/Adam - Thanks for picking this up. Still cant get it working. I’ve got it working perfectly for the hourly, daily and weekly frequency options. Here’s a little more info that may help you to get me over the line.

So I have this pop up that allows a user to create a metric and define the frequency at which it creates an update for the user to add a value to - so in this case, a new update will be generated at 08:00 every first Friday of each month:

Here’s the underlying record where the ordinal in the UI corresponds to the Selected Specific Ordinal field in the Metric Periodicity data set

Here’s that dataset showing the Selected Specific Ordinal field is referencing an Option set called Ordinal Numbers:

And here’s the Ordinal Numbers option set showing it has a number attribute (where First=1, Second=2 etc):

Here’s the expression I currently have:

which, for the time being, is being used to attempt to show the date of the next first Friday of the next month being displayed on the metric page (once I’ve got it displaying correctly, I can then set up the backend schedule api):

The Days of the Week option set that is used for the Selected Specific Day field also has a number value (sunday=0, Monday=1 etc)

I need to add a month to the current date/time (that bit I can do!) , how do I then get to the relevant week and day?

Does that help or is it better if I share my project somehow (not sure how)
Thanks again guys

This topic was automatically closed after 70 days. New replies are no longer allowed.