# How to automatically change the time filter of embedded elements in Canvas

**URL:** <https://discuss.elastic.co/t/how-to-automatically-change-the-time-filter-of-embedded-elements-in-canvas/311901>\
**Category:** Kibana\
**Created:** [August 11, 2022, 6:33am UTC](https://discuss.elastic.co/t/how-to-automatically-change-the-time-filter-of-embedded-elements-in-canvas/311901 "2022-08-11T06:33:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhavya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavya/32/45679_2.png) [@bhavya](https://discuss.elastic.co/u/bhavya)\
**Post date:** [August 11, 2022, 6:33am UTC](https://discuss.elastic.co/t/how-to-automatically-change-the-time-filter-of-embedded-elements-in-canvas/311901/1 "2022-08-11T06:33:44Z")

</div>

I added the element from the saved library as :

```
Add Element -> Add from Kibana -> Selected the element to add

```

[![enter image description here](https://us1.discourse-cdn.com/elastic/original/3X/3/8/38032fdb90199e91d3e26b688b015c06b2992842.png)](https://i.stack.imgur.com/pLV0b.png)

The time filter inserted from canvas has a time set to Last 90 days, as can be seen in the image below, whereas the element added from Kibana has a time set to Last 7 days.

[![enter image description here](https://us1.discourse-cdn.com/elastic/original/3X/c/1/c10812ea31abd06585feed00639ce517d93d6208.png)](https://i.stack.imgur.com/kwZPK.png)

Based on this [answer](https://discuss.elastic.co/t/dropdown-in-canvas-does-not-filter-visualization-from-add-from-kibana/284631), I tried to prepend `filters | savedLens ...` in the expression window of the element added from Kibana. But it's not working.

**I want the new time to be applied to every element of the canvas if the time is changed using the dropdown of the time filter (even though the elements are added from Kibana like Map, Chart, etc)**

Can anyone please help me resolve this issue?

---

<div class="post-metadata">

**Author:** ![bhavya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavya/32/45679_2.png) [@bhavya](https://discuss.elastic.co/u/bhavya)\
**Post date:** [August 11, 2022, 10:50am UTC](https://discuss.elastic.co/t/how-to-automatically-change-the-time-filter-of-embedded-elements-in-canvas/311901/2 "2022-08-11T10:50:29Z")

</div>

@wylie @Marco_Liberati could you please help me out with this question ?

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [August 12, 2022, 11:20am UTC](https://discuss.elastic.co/t/how-to-automatically-change-the-time-filter-of-embedded-elements-in-canvas/311901/3 "2022-08-12T11:20:20Z")

</div>

Hi @bhavya ,

the trick is to set the Lens time range to a very big value (say 6 months) and then use the time picker with lower values than that (in your case 90 days is less than 6 months). This is a limit of the feature right now.

---

<div class="post-metadata">

**Author:** ![bhavya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavya/32/45679_2.png) [@bhavya](https://discuss.elastic.co/u/bhavya)\
**Post date:** [August 12, 2022, 11:53am UTC](https://discuss.elastic.co/t/how-to-automatically-change-the-time-filter-of-embedded-elements-in-canvas/311901/4 "2022-08-12T11:53:17Z")

</div>

Thanks @Marco_Liberati , this really worked like a charm 🙂

---

<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:** [September 9, 2022, 11:53am UTC](https://discuss.elastic.co/t/how-to-automatically-change-the-time-filter-of-embedded-elements-in-canvas/311901/5 "2022-09-09T11:53:43Z")

</div>

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