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

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

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.