Hi there
I developed a time tracker “app”. From legal perspective, employees need to approve their stored records always on the 25th day of the month. Therefore I would like to open up a popup when the currentDate is the 25th day of the month or later AND when there are some not approved records. In this pop up you see all these records (in a repeating group) until the latest 25th day of the month.
E.g.
If today is the 2nd of September and I still have some not approved records on the 23rd, 24th, 25th, 26th, etc. of the month. Therefore the popup is shown and I as a employee (or user) only will see the records until the latest 25th day of the month. How can I handle that?
Many thanks and please do not hesitate to ask questions. It is a bit tricky to explain
You can just get the day (in Bubble date) of the current date/time and check if it is greater than or equal to 25. And add other conditions to it when you see need. See below:
It’s indeed tricky to understand precisely what you’re seeking to accomplish.
Sounds like you want to do a search for records with something along the lines of the following constraints.
Approved is no
Current date/time:extract date > 25 and Current date/time change date to 26 > Record Date or Current date/time+ months: -1 change date to 26 > Record Date
Of course, you should test yourself and tweak this starting point as necessary. If you can’t the date constraint expression to cover both scenarios where the current date is before or after the 25th of the current month, you could probably instead run two separate searches and merge the results.
Maybe that search is then the data source directly for a repeating group, or maybe it populates a custom state upon page load and the popup you mention shows only if the custom state is not empty.
How I would approach this from what I under stand is create a "month " data type which holds all the current months records and has an “Approved” of yes or no, and a “date” which would be set to the 25th
Then you would do a search for employees month, with dates less then current “months” date, if approved no count is > 0 show popup.
Is there a possibility to get the 25th of last month? I ask that because if I am still in the same month e.g. 28th of August then I do not want to get the last month, I would like to get the current month. But if I am in September, then I would like to get the last month. Or as I have written above, I need the latest 25th, which is in this case 25th of August.
To make this process easier, set up a monthly trigger that creates a database record. If any of the records is not filled in, display a popup or repeating group (RG) showing the records that need to be filled in.
This way, if someone is absent for more than six months, you won’t rely on a series of popups. Instead, provide them with an overview and the option to fill in the required data.