# How to compile Script box creating a scripted field to hyperlink values in data table

**URL:** <https://discuss.elastic.co/t/how-to-compile-script-box-creating-a-scripted-field-to-hyperlink-values-in-data-table/283885>\
**Category:** Kibana\
**Created:** [September 10, 2021, 1:19pm UTC](https://discuss.elastic.co/t/how-to-compile-script-box-creating-a-scripted-field-to-hyperlink-values-in-data-table/283885 "2021-09-10T13:19:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![giammihendrix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/giammihendrix/32/94412_2.png) [@giammihendrix](https://discuss.elastic.co/u/giammihendrix)\
**Post date:** [September 10, 2021, 1:19pm UTC](https://discuss.elastic.co/t/how-to-compile-script-box-creating-a-scripted-field-to-hyperlink-values-in-data-table/283885/1 "2021-09-10T13:19:03Z")

</div>

Hi everyone, I'll try to make it brief.

- total noob

- never wrote any code whatsoever

- forced to use kibana by employer

- need to link a dashboard (filtering by the clicked value) to values in a data table when clicked on

- managed to start creating a scripted field following an old post

- managed to set link, url, editing the url with "{{value}}"

- when it comes to the script part I really have no idea of what to do. Searched all around but it is impossible without any knowledge.

Beg your pardon if I missed any older post or unintentionally did not follow any rule.  
Thanks everyone anyways

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [September 10, 2021, 2:44pm UTC](https://discuss.elastic.co/t/how-to-compile-script-box-creating-a-scripted-field-to-hyperlink-values-in-data-table/283885/2 "2021-09-10T14:44:59Z")

</div>

Guessing all you need to do is add this in the scripting box but replace the field name with the correct one.

`return doc['YOUR-FIELD-NAME'].value;`

There is no compiling. What happens with a scripted field is every time the record is being read it will run that script.

---

<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:** [October 8, 2021, 2:45pm UTC](https://discuss.elastic.co/t/how-to-compile-script-box-creating-a-scripted-field-to-hyperlink-values-in-data-table/283885/3 "2021-10-08T14:45:53Z")

</div>

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