Forum Academy Marketplace Showcase Pricing Features

Bug? or noob at it again?

Hey, i’ve been trouble-shooting this for days. I’m starting to get competent with bubble so i’m incline to think it might be a bug but i thought i better post this here under ‘need help’ before i report as a ‘bug’.

So i have a text box with dynamic field ‘Do a search for:count’ (so i’m just having a text box display a number basically). The ‘do a search for’ is set up with four constraints as shown in image below.

This does everything i need it to do (e.g. my text box now displays “14” as intended) but now i need a fifth constraint to constrain the search to a particular date, but that’s when it all stops working and just reads “0”

You can probably ignore the slightly complicated creation date action seen in the image above because even when i set it to “creation date = current date”, my text box still just now reads “0”.

Any help or ideas would be much appreciated.

Could it be because the database date reads “Oct 16, 2021” format and maybe the action it’s trying to search for it in another format or something?

No bug here.

Remember this…

A ‘date’ in Bubble (and in JavaScript) is a precise moment in time, to the nearest millisecond.

So in your screenshot above, you’re constraining your search to return results that match a specific date/time (i.e. a timestamp of a specific millisecond in time).

So, in this case, only results that were created at the precise same millisecond as the date/time in the constraint will be returned (which is extremely unlikely to be any).

You probably want instead to return results that were created on a specific day, in which case you’ll need to use 2 constraints:

Created date ≥ current date/time: rounded down to day
Created date < current date/time: rounded down to day: +1 Day

Or instead of ‘current date/time’ use whatever date you want to constrain the search to, but round it down to day for the lower limit, and round it down to day, plus 1 day, for the upper limit.


It worked. Thanks, my man. Bubble community saves the day again.

1 Like