# Change Visualization source from Index-Pattern to Saved Search

**URL:** https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255
**Category:** Kibana
**Created:** [September 2, 2020, 3:26pm UTC](https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255 "2020-09-02T15:26:47Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![BkQc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkqc/32/73699_2.png) [@BkQc](https://discuss.elastic.co/u/BkQc)
#### Post date: [September 2, 2020, 3:26pm UTC](https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255/1 "2020-09-02T15:26:47Z")

</div>

In Nov 2019, someone asked the [same question](https://discuss.elastic.co/t/how-to-switch-source-of-visualization-from-index-pattern-to-saved-search/208341/5) and the answer was that it was not possible. Was there any change about that?

I would like to modify an existing visualization that uses an index pattern and use a saved search instead. I looked at 2 objects, one using the index pattern and the other the saved search and I think it is safe to say that the only thing missing to be able to correctly modify it through the GUI is the _savedSearchRefName_ attribute.

Other than that, _kibanaSavedObjectMeta.searchSourceJSON_ and _references_ are already modifiable.

So I think the 2020 question is: how can I add a _savedSearchRefName_ to an existing vis?

---

<div class="post-metadata">

### Author: ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)
#### Post date: [September 2, 2020, 3:49pm UTC](https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255/2 "2020-09-02T15:49:44Z")

</div>

That question you referenced was from a year ago and I don't believe there is a way to make this change from the UI at this time.

There is a pretty old issue which you can track and/or show your support on: [https://github.com/elastic/kibana/issues/5060](https://github.com/elastic/kibana/issues/5060)

---

<div class="post-metadata">

### Author: ![BkQc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkqc/32/73699_2.png) [@BkQc](https://discuss.elastic.co/u/BkQc)
#### Post date: [September 2, 2020, 3:55pm UTC](https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255/3 "2020-09-02T15:55:44Z")

</div>

You are right, I don't know where I saw 2007... I edited my post. Thanks for the issue link.

If not from the UI, I could I do this using APIs? Is it possible to use the DevTools\>Console UI from Kibana?

---

<div class="post-metadata">

### Author: ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)
#### Post date: [September 2, 2020, 4:13pm UTC](https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255/4 "2020-09-02T16:13:06Z")

</div>

The Dev Tools Console application is for Elasticsearch API's. We do have an API for interacting with these objects documented [here](https://www.elastic.co/guide/en/kibana/current/saved-objects-api.html). We have an issue open to add support to Console to also support Kibana API's [here](https://github.com/elastic/kibana/issues/49330).

I am not sure what exactly is needed other than setting `savedSearchRefName` as modifying these documents directly is not something we provide support or documentation for. So, you're free to experiement but it would be a "proceed at your own risk" sort of thing.

As an aside, we are working on a new visualization called Lens currently in Beta that is much more flexible. I am not sure about changing a search source, but you can change between visualizations types.

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [September 2, 2020, 4:40pm UTC](https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255/5 "2020-09-02T16:40:45Z")

</div>

Saved searches are mostly a set of filters that can be applied, they still operate on an index pattern underneath. Your best option is to re-create the filters from your saved search.

Lens doesn't currently support saved searches as a data source, and it's low in the list of priorities. [Here is the issue](https://github.com/elastic/kibana/issues/55896)

---

<div class="post-metadata">

### Author: ![BkQc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bkqc/32/73699_2.png) [@BkQc](https://discuss.elastic.co/u/BkQc)
#### Post date: [September 2, 2020, 8:29pm UTC](https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255/6 "2020-09-02T20:29:09Z")

</div>

While this is true, the saved search is more flexible as you can use one common set of data between multiple related viz and if required a modification, you only have one place to change.

---

<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 30, 2020, 8:29pm UTC](https://discuss.elastic.co/t/change-visualization-source-from-index-pattern-to-saved-search/247255/7 "2020-09-30T20:29:09Z")

</div>

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