# Set Href Query String in Vega

**URL:** https://discuss.elastic.co/t/set-href-query-string-in-vega/227395
**Category:** Kibana
**Tags:** vega
**Created:** [April 9, 2020, 7:12pm UTC](https://discuss.elastic.co/t/set-href-query-string-in-vega/227395 "2020-04-09T19:12:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jmrozi1](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jmrozi1](https://discuss.elastic.co/u/jmrozi1)
#### Post date: [April 9, 2020, 7:12pm UTC](https://discuss.elastic.co/t/set-href-query-string-in-vega/227395/1 "2020-04-09T19:12:27Z")

</div>

I figured out how to make it so text acts as a URL:

```auto
    marks: [
      {
        type: "text",
        encode: { enter: { href: { value: "/path/from/base/href/<dashboard ID>/?myParam=myValue" }}}
      }
    ]

```

The problem is that I just need to update the query string (i.e. the part of the URL after the question mark). Is this possible? We have a bunch of dashboards (10+), so if I set the full href, I need to create a separate plugin for every dashboard. It doesn't seem that specifying the dashboard ID as part of the href is possible, but is it possible just to set the query string?

---

<div class="post-metadata">

### Author: ![jmrozi1](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jmrozi1](https://discuss.elastic.co/u/jmrozi1)
#### Post date: [April 13, 2020, 3:07pm UTC](https://discuss.elastic.co/t/set-href-query-string-in-vega/227395/2 "2020-04-13T15:07:19Z")

</div>

Just to clarify a little more, what I'm trying to do is to click on a link inside a Vega plugin that stays on the current dashboard. I don't care how this is done - it could be by specifying a relative path, replacing the query string, or getting the dashboard ID as a signal. I'm just trying to figure out whether or not it's possible to do this so I know wheter or not I need to create a separate plugin for every dashboard.

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [April 15, 2020, 8:33am UTC](https://discuss.elastic.co/t/set-href-query-string-in-vega/227395/3 "2020-04-15T08:33:02Z")

</div>

If you want to stay on the current dashboard, why do you need a link? If you are trying to set a filter from within the Vega chart (e.g. by clicking a series), you can use the `kibanaAddFilter` integration. This is an example how this works: [https://gist.github.com/nyurik/3c579fb8e81c8a981d4b267ad1767227](https://gist.github.com/nyurik/3c579fb8e81c8a981d4b267ad1767227)

You basically have to piece together an object containing the thing you want to filter and then call `kibanaAddFilter` with it on click.

---

<div class="post-metadata">

### Author: ![jmrozi1](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jmrozi1](https://discuss.elastic.co/u/jmrozi1)
#### Post date: [April 28, 2020, 3:53pm UTC](https://discuss.elastic.co/t/set-href-query-string-in-vega/227395/4 "2020-04-28T15:53:12Z")

</div>

Joe,

Sorry for the really long delay - covid is definitely making things interesting here. At any rate, the reason for the link is that I need all visualizations on the dashboard to be updated. I believe the filter will only apply to the one visalization.

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [April 29, 2020, 7:58am UTC](https://discuss.elastic.co/t/set-href-query-string-in-vega/227395/5 "2020-04-29T07:58:07Z")

</div>

The filter will apply to all visualizations on the dashboard when triggered like this (given you are embedding the vega visualization in a panel on a dashboard, of course).

---

<div class="post-metadata">

### Author: ![jmrozi1](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jmrozi1](https://discuss.elastic.co/u/jmrozi1)
#### Post date: [April 30, 2020, 2:24pm UTC](https://discuss.elastic.co/t/set-href-query-string-in-vega/227395/6 "2020-04-30T14:24:48Z")

</div>

Joe,

Got it! I'll give it a shot soon, and thanks for looking into this!

---

<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: [May 28, 2020, 2:24pm UTC](https://discuss.elastic.co/t/set-href-query-string-in-vega/227395/7 "2020-05-28T14:24:51Z")

</div>

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