DMXzone Database Connector 2 Support Product Page

Setting default record for query when no URL parameter present

5 years ago Rachel Semmler posted:
I have a repeat region that uses a URL parameter to filter the query. Is there a way to set a default recordset to display when there is no URL parameter present?

Replies

Replied 5 years ago
5 years ago Teodor Kuduschiev replied:
Hi Rachel,
what needs to be displayed on your page exactly, when the url param is missing?
Replied 5 years ago
5 years ago Rachel Semmler replied:
Hi Teodor,

When there's no param, I'm looking to display the most recent record.

It's a meeting page, which shows details for a specific meeting based on the url param (meetingID). When there is no URL param, it would show the details for the last meeting in the database (highest meetingID).


Thank you for helping!
Replied 5 years ago
5 years ago Teodor Kuduschiev replied:
You just need to make the filter conditional, i.e. to be applied only when it has a value. So use the same value for the condition, as you are using for the filter, this will make the filter work only when there is a value:



Then, on the page how are you binding the data, is it in a repeat region, or do you bind the values directly on the page?

Reply to this topic