How to use 1 data type instead of 230?

Hello,

I’m building a simple web app that consists of two pages. The first page is a simple landing page with an input box/datepicker and a search button.

The user has to pick a date that falls sometime within the next 4.5 years.

Once they hit search they’re brought to the second page. The content on the second page will be dependent on what date the user chose on the first page.

There will be c.230 potential pieces of content (1 per week in the 4.5 year period).

What’s the best way of structuring my database to achieve this? You could obviously have 230 conditional statements on the second page, but that seems wildly inefficient.

Any help would be much appreciated!

Simply past the date in the parameter when redirecting to page nr 2 and do a search for a piece of content which picked date is in the content date range (using get data from the url).

So the piece of content has to have data field “date range”.

1 Like

Thanks @bartek.dev!

Just to clarify: are you saying I should have a data type with 2 variables? Date and content?

Then lookup the date in the data type and retrieve the corresponding piece of content (I’m not 100% on how to do this tbh)?

In your data type Content you should have a field data range .

So you do a search like this: