# New dashboards and time frame selector?

**URL:** <https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075>\
**Category:** Open Q&A\
**Tags:** latest-dynatrace, dashboards\
**Created:** [June 5, 2023, 7:14pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075 "2023-06-05T19:14:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott-smith](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@scott-smith](https://community.dynatrace.com/u/scott-smith)\
**Post date:** [June 5, 2023, 7:14pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/1 "2023-06-05T19:14:00Z")

</div>

In the new dashboards, I see that there is a time frame selector in the top right that seems like it should control the time frame for any widget on that dashboard.&nbsp; However, this does not seem to be the case and I cannot find any documentation on how to use what is selected in that global time frame selector in Grail queries or JavaScript code.&nbsp; Can someone point me in the direction of the docs for this?&nbsp; Or, am&nbsp; I mistaken on the usage?

Thanks

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [June 6, 2023, 7:21am UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/2 "2023-06-06T07:21:08Z")

</div>

Hi,

I checked on my environment and timeframe selector changes the date range on Dashboard tiles.

> **[Dashboards](https://docs.dynatrace.com/docs/analyze-explore-automate/dashboards-and-notebooks/dashboards-new)**
>
> Create interactive, customizable views to visualize, analyze, and share your observability data in real time.

Radek

---

<div class="post-metadata">

**Author:** ![scott-smith](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@scott-smith](https://community.dynatrace.com/u/scott-smith)\
**Post date:** [June 6, 2023, 2:09pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/3 "2023-06-06T14:09:17Z")

</div>

Thanks Radek,

I guess maybe I have a different use case.&nbsp; I think the time frame selector would work for me if I were using a DQL query and not specifying a time frame in the query.&nbsp; However, since the metric data I need has not been migrated to Grail yet, I am using the the classic SDK to get the data, HTTP monitor metric data, using the following:

```markup
const response = await metricsClient.query({
    acceptType: 'application/json; charset=utf-8', 
    entitySelector: 'type(dt.entity.http_check),tag(SENTRY_AVAILABILITY:SMARTS_DOWN)',
    from: 'now/y',
    to: 'now',
    resolution: 'd',
    metricSelector: 'builtin:synthetic.http.availability.location.totalWoMaintenanceWindow'
  });
  const metrics = response.result;

```

I would like to be able to dynamically use the time frame selected instead of using the from and to values I have in the sample above.&nbsp; Is there a way to get the selected time frame?

---

<div class="post-metadata">

**Author:** ![scott-smith](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@scott-smith](https://community.dynatrace.com/u/scott-smith)\
**Post date:** [June 6, 2023, 3:11pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/4 "2023-06-06T15:11:47Z")

</div>

I guess this may be working if I remove the from, to, and resolution params.&nbsp; However, the charts do not seem to adjust to fit the new data based on the time frame selected, so it is not useful.&nbsp; Maybe I am missing something?

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [June 6, 2023, 7:37pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/5 "2023-06-06T19:37:16Z")

</div>

If you use “from - to” within a tile, you will be forcing a different date range than you set in the time frame selector.

---

<div class="post-metadata">

**Author:** ![scott-smith](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@scott-smith](https://community.dynatrace.com/u/scott-smith)\
**Post date:** [June 6, 2023, 7:41pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/6 "2023-06-06T19:41:30Z")

</div>

Right.&nbsp; See my edited comment above.&nbsp; If I remove those fields, then the selected time frame does appear to be used.&nbsp; But, the charts do not seem to adjust correctly.

---

<div class="post-metadata">

**Author:** ![scott-smith](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@scott-smith](https://community.dynatrace.com/u/scott-smith)\
**Post date:** [July 7, 2023, 8:14pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/7 "2023-07-07T20:14:32Z")

</div>

Spoke with Dynatrace.&nbsp; Access to the time frame values should be available in the dashboards version 1.4

---

<div class="post-metadata">

**Author:** ![heybeckerj](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/heybeckerj/32/22189_2.png) [@heybeckerj](https://community.dynatrace.com/u/heybeckerj)\
**Post date:** [August 3, 2023, 5:35pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/8 "2023-08-03T17:35:04Z")

</div>

Great, do we know when these time frame variables will be available?

---

<div class="post-metadata">

**Author:** ![scott-smith](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@scott-smith](https://community.dynatrace.com/u/scott-smith)\
**Post date:** [August 3, 2023, 5:40pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/9 "2023-08-03T17:40:08Z")

</div>

My company just received the updated dashboards this week 8/1/2023.&nbsp; &nbsp;It took several emails to our support reps at Dynatrace to get updated.

Here is a simple function to test with once you have been upgraded.

export default async function () {  
&nbsp; &nbsp; &nbsp;return "From/To: " + $dt\_timeframe\_from + " " + $dt\_timeframe\_to;;  
}

---

<div class="post-metadata">

**Author:** ![heybeckerj](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/heybeckerj/32/22189_2.png) [@heybeckerj](https://community.dynatrace.com/u/heybeckerj)\
**Post date:** [August 3, 2023, 5:41pm UTC](https://community.dynatrace.com/t/new-dashboards-and-time-frame-selector/40075/10 "2023-08-03T17:41:51Z")

</div>

Ah that is wonderful&nbsp;[@scott-smith](https://community.dynatrace.com/user/62022)&nbsp;. I knew about these variables, just did not work yet on our tenant:

$dt\_timeframe\_from

$dt\_timeframe\_to

I tested today and it works!

 ![heybeckerj_0-1691084685839.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/e/eee0633aa02aea3bbaeeed36c82f06719540e634.png)

Thanks for the snippet.
