How to display relational data by date

Hi Bubble Community,

If we have a Datatype 1, with multiple things, and on the User: Datatype 1 list of Datatype 1’s (created in a workflow with Step 1: Create Datatype 1, thing and Step 2: change user, Datatype 1 (list) Add “results of step 1”), how do we set the data source on an element to display the thing constrained/filtered by creation date?

Trying to figure out how to create the constraint on a list of things from the current user. Previously, I’ve been recalling the data by the data source of Datatype 1, with constraints of created by: current user and creation date >= midnight today and creation date < midnight tomorrow.

Thanks so much for the guidance,
Jason

If I’m understanding your data structure correct, you should be able to do something like this.

Current user list of datatype1 → filtered by-> created date

Thanks, @twilson9034 . Any idea how to have it filtered for a moment in time, between to other moments in time (ex: between a start and end time that are two elements) ?

The app already has these two starting and ending elements:
Element 1: today midnight
Element 2: tonight midnight

Thanks!

Are those two elements saved to dataset1? If they are you could filter
Element 1 >= today midnight
Element 2 < midnight tomorrow

If not then the filter would be similar to your current setup.

Thanks, @twilson9034 . No those data types are not. Actually looking to find the point in the database that will be somewhere inbetween the time of the 2 elements (range of today).

Thanks for the help,
Jason

Jason try this filter
Created date >= arbitrary date/time and put today 2359
Created date < arbitrary date/time and put tomorrow 2359

@twilson9034 I pretty much hacked at it and got it. Now the data is tied to the current user and can be pulled through the current user, then the filter for date range. Not sure if that will provide any better or worse performance in the short or long term (this will be a fairly large list over time). It seems like avoiding a “Do a search for” whenever possible could provide an improvement in performance?

1 Like

whenever you can limit the system having to “look” and open doors to find something it will improve performance

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