# Using TimeframeSelector in a code tile

**URL:** <https://community.dynatrace.com/t/using-timeframeselector-in-a-code-tile/42085>\
**Category:** Dashboarding\
**Tags:** latest-dynatrace, dashboards\
**Created:** [October 13, 2023, 6:42pm UTC](https://community.dynatrace.com/t/using-timeframeselector-in-a-code-tile/42085 "2023-10-13T18:42:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomLichti](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@TomLichti](https://community.dynatrace.com/u/TomLichti)\
**Post date:** [October 13, 2023, 6:42pm UTC](https://community.dynatrace.com/t/using-timeframeselector-in-a-code-tile/42085/1 "2023-10-13T18:42:27Z")

</div>

I am trying to use the TimeframeSelector in a code tile as the results from my function are not constrained by the time selector on the dashboard. I have found the TimeframeSelector code here:&nbsp;[TimeframeSelector | Dynatrace Developer](https://developer.dynatrace.com/reference/design-system/preview/forms/TimeframeSelector/#use-cases)&nbsp;but that is for the AppEngine, I have not been able to use it in a dashboard tile. I can add the import, but I am not sure how to use the value in the tile. As a caveat, I am not a developer, but I do play one on TV.

---

<div class="post-metadata">

**Author:** ![izabelarokita](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/izabelarokita/32/41812_2.png) [@izabelarokita](https://community.dynatrace.com/u/izabelarokita)\
**Post date:** [December 13, 2023, 12:30pm UTC](https://community.dynatrace.com/t/using-timeframeselector-in-a-code-tile/42085/2 "2023-12-13T12:30:15Z")

</div>

Hi&nbsp;[@TomLichti](https://community.dynatrace.com/user/54091)&nbsp;,  
Have you found the answer to your question as time passed, or do you still require our assistance? Let me know, and I’ll figure something out 🙂

---

<div class="post-metadata">

**Author:** ![TomLichti](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@TomLichti](https://community.dynatrace.com/u/TomLichti)\
**Post date:** [December 13, 2023, 3:50pm UTC](https://community.dynatrace.com/t/using-timeframeselector-in-a-code-tile/42085/3 "2023-12-13T15:50:18Z")

</div>

I have not found an answer, so anything you could help with would be great!

---

<div class="post-metadata">

**Author:** ![izabelarokita](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/izabelarokita/32/41812_2.png) [@izabelarokita](https://community.dynatrace.com/u/izabelarokita)\
**Post date:** [December 18, 2023, 10:00am UTC](https://community.dynatrace.com/t/using-timeframeselector-in-a-code-tile/42085/4 "2023-12-18T10:00:16Z")

</div>

[@TomLichti](https://community.dynatrace.com/user/54091)&nbsp;According to our engineers,&nbsp;strato components like the TimeframeSelector can only be used by developers when writing a Dynatrace app. The code within code tiles will be executed on the server, so it can’t contain any UI widgets.

It is only possible in code tiles to access the dashboard timeframe by using the built-in variables&nbsp;`$dt_timeframe_from`&nbsp;and&nbsp;`$dt_timeframe_to`. Tile-specific timeframes are not supported yet but will surely come in the future.
