Setting value of "Date Range" component doesn't trigger dependent queries

Hello!

I'm looking into the Retool, currently, to use it for our dashboards and I found that setting value of Date Range component doesn't trigger dependent queries at all. Is it supposed to?..

I want to make helper buttons to quickly change range of dates:
image

The "30 Days" button has the following event handler:
image

The button works ok, i.e. it changes the values of the date range. But dependent queries aren't triggered. If I set date in the date range manually (by clicking on it and changing dates), it works OK ,i.e. the queries are triggered.

What am I doing wrong?

Thanks.

What code do you have as it relates to when the date is changed that the dependent queries are triggered when you change the date manually in the field and not using the button? I would need to see that code to have more context and hopefully help you.

1 Like

The date range should trigger the following query, for example:

The date range doesn't have any special event handlers:
image

is the date range being displayed in a text input field? If so, you should set an "Change" event handler for it

No. It's a date range with the disabled label. If I understand correctly what you mean :slight_smile:

In short, I prepared a sample app to test the behaviour.

I assume that the value of the text with the value of the date range should change when I'm clicking on the buttons "30 days", "90 days", not only when I change ranges in the date range manually.

I can share the app with the Retool team if it's necessary.

OK I see what the problem is and I am able to replicate in my environment as well using your code from your original screenshot. I don't know if it is a bug or not, but you could get around it by chaining the event to trigger the queries directly in the screenshot below. Maybe someone from the Retool team would be able to replicate and see if there is a bug. You should still keep the "Change" event within the dateRange1 component.

1 Like

I do think it's a bug.

@luke-phillippi Could you please look into this issue?

Hi @programmer

Would you mind if we logged into your sample app? I'm not seeing the same behavior in my own app, but I see what you mean in the public sample app :thinking:

1 Like

Yes! I would appreciate it if you did that.

Hi @programmer Thank you! I see what you mean now. I am submitting this bug to our team.

For a workaround in the meantime, can you try returning the start and end dates in a transformer & then reference the transformer values in your text component?

Thank you!

I tried - it didn't help :grinning:

I, too, am running into this issue. I also am using this workaround. I'd love to see a solution that works without it, though!

Hello!
I don't want to bug anyone, but the problem is still present.
@retool-team @moderators whats the status? Are you working on this?
Our board heavily depends on fixing this bug, so any update would be appreciated.
Thanks

Hi @benbeu, I don't have any updates on this issue :confused: I've passed along your need for this bug to be fixed and I'll be sure to post any news on the issue here!

1 Like

Hey folks! We believe this issue should be resolved. Please let us know if you're still running into any problem with the APIs on Date Range.