# Vega: Use values from "data" for a signal definition

**URL:** https://discuss.elastic.co/t/vega-use-values-from-data-for-a-signal-definition/140869
**Category:** Kibana
**Created:** [July 20, 2018, 10:24am UTC](https://discuss.elastic.co/t/vega-use-values-from-data-for-a-signal-definition/140869 "2018-07-20T10:24:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![vega\_user](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vega\_user](https://discuss.elastic.co/u/vega_user)
#### Post date: [July 20, 2018, 10:24am UTC](https://discuss.elastic.co/t/vega-use-values-from-data-for-a-signal-definition/140869/1 "2018-07-20T10:24:55Z")

</div>

Hello everyone,

I was wondering whether it is possible to use a specific value from "data" within a signal - for instance, to define the initial value of a slider. I tried this:

```auto
  "data": [
    {
      "name": "testvalue",
      "values": [{"first": "40"}]
    }
  ],
  "signals": [
    {
      "name": "testslider",
      "value": {"signal": "data('testvalue')[0].first"},
      "bind": {
        "input": "range",
        "min": 0,
        "max": 100,
        "step": 1
      }
    }
  ]

```

But it does not work - I get [Object object] as the initial value. However, this works perfectly fine in, for instance, x-coordinate-values within marks. Is there another solution to use values from other sources within signal definitions?

Thanks,  
vega\_user

---

<div class="post-metadata">

### Author: ![christophilus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christophilus/32/42991_2.png) [@christophilus](https://discuss.elastic.co/u/christophilus)
#### Post date: [August 6, 2018, 4:08pm UTC](https://discuss.elastic.co/t/vega-use-values-from-data-for-a-signal-definition/140869/2 "2018-08-06T16:08:31Z")

</div>

Hi Anna,

I took a look into this a bit, but it's honestly a question that's probably best asked in the [Vega forum](https://groups.google.com/forum/#!forum/vega-js). I'd drop it in there, as it's not a Kibana-specific question.

That said, I wasn't able to figure out how to get the signal's value to have access to the global data structures. `"value": "datum"` Worked, but it's not what you're looking for! I don't think that you can put the value `{ "signal": ...}` Where you are. I think you need to put a direct expression there: `"value": "time('Jan 1, 2008')"` For example.

But as I said, the Vega folks should be able to answer this much better than I!

---

<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 3, 2018, 4:08pm UTC](https://discuss.elastic.co/t/vega-use-values-from-data-for-a-signal-definition/140869/3 "2018-09-03T16:08:32Z")

</div>

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