# How to get the selected date/time range into my dashboard text element?

**URL:** <https://discuss.elastic.co/t/how-to-get-the-selected-date-time-range-into-my-dashboard-text-element/374941>\
**Category:** Elastic Search\
**Tags:** dashboard\
**Created:** [February 24, 2025, 10:47am UTC](https://discuss.elastic.co/t/how-to-get-the-selected-date-time-range-into-my-dashboard-text-element/374941 "2025-02-24T10:47:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticNovis](https://avatars.discourse-cdn.com/v4/letter/e/46a35a/32.png) [@ElasticNovis](https://discuss.elastic.co/u/ElasticNovis)\
**Post date:** [February 24, 2025, 10:47am UTC](https://discuss.elastic.co/t/how-to-get-the-selected-date-time-range-into-my-dashboard-text-element/374941/1 "2025-02-24T10:47:27Z")

</div>

Hello,

I am creating a dashboard, and I want whatever date/time range that has been selected (Top right), to be shown into the dashboard as a visual element, I thought in a text visual.

Because the dashboard will be many elements long, I wanted to be able to show this text element multiple times where I choose. Hence why I don't want to just relay on the top right showing the date/time frame.

Is there any ideas/advise on how to do this?

Thanks.

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [February 24, 2025, 1:38pm UTC](https://discuss.elastic.co/t/how-to-get-the-selected-date-time-range-into-my-dashboard-text-element/374941/2 "2025-02-24T13:38:46Z")

</div>

Hi @ElasticNovis,

Welcome back! do you know which type of control you want to use?

For Lens, you could try using the `@timestamp` field (albeit this is driven off the `@timestamp` field in the documents rather than the selected range explicitly):

 ![Screenshot 2025-02-24 at 13.31.48](https://us1.discourse-cdn.com/elastic/original/3X/3/2/32dd0149e03913b496d1550c1205d5e0eac2772c.png)

In Vega using the [%timefield% option](https://www.elastic.co/guide/en/kibana/current/vega.html#vega-queries).

Hope that helps!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 24, 2025, 1:39pm UTC](https://discuss.elastic.co/t/how-to-get-the-selected-date-time-range-into-my-dashboard-text-element/374941/3 "2025-03-24T13:39:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
