# Set custom value in synthetic and show it in dashboards

**URL:** <https://community.dynatrace.com/t/set-custom-value-in-synthetic-and-show-it-in-dashboards/33147>\
**Category:** Dashboarding\
**Tags:** dashboards-classic, synthetic-monitoring\
**Created:** [November 1, 2021, 7:59am UTC](https://community.dynatrace.com/t/set-custom-value-in-synthetic-and-show-it-in-dashboards/33147 "2021-11-01T07:59:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![george\_azzam](https://avatars.discourse-cdn.com/v4/letter/g/f14d63/32.png) [@george\_azzam](https://community.dynatrace.com/u/george_azzam)\
**Post date:** [November 1, 2021, 7:59am UTC](https://community.dynatrace.com/t/set-custom-value-in-synthetic-and-show-it-in-dashboards/33147/1 "2021-11-01T07:59:23Z")

</div>

Hello,

I would like to be able to set a key-value inside a synthetic script, and then be able to see this value inside a dashboard.

This should be a custom key-value that I can calculate during the synthetic script run, set it as a (maybe global) key-value, and when opening a dashboard the up-to-date value should be shown.

Is this possible?

We work with NewRelic, and we consider moving to Dynatrace, In NewRelic we could easily do this operation by using $util.insights.set(Key, Value); and then read the value inside the dashboard.

Thanks very much.

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [November 1, 2021, 8:33am UTC](https://community.dynatrace.com/t/set-custom-value-in-synthetic-and-show-it-in-dashboards/33147/2 "2021-11-01T08:33:34Z")

</div>

Hi&nbsp;[@george\_azzam](https://community.dynatrace.com/user/45731)

Check the&nbsp;[Pre-execution script methods](https://www.dynatrace.com/support/help/shortlink/http-monitor-pre-post-script#pre-execution)&nbsp;request.addHeader(key,value)

HTH

Yos

---

<div class="post-metadata">

**Author:** ![george\_azzam](https://avatars.discourse-cdn.com/v4/letter/g/f14d63/32.png) [@george\_azzam](https://community.dynatrace.com/u/george_azzam)\
**Post date:** [November 1, 2021, 8:40am UTC](https://community.dynatrace.com/t/set-custom-value-in-synthetic-and-show-it-in-dashboards/33147/3 "2021-11-01T08:40:36Z")

</div>

But how can I fetch this data to a Metric inside the dashboard ?!

For example I used:

```javascript
request.addHeader("ScansCount", "8765");

```

How can&nbsp; I show the “ScansCount” value/avg/sum/etc inside a metric in a dashboard?

-- EDIT --

We work on Clickpath scripts

[@Yosi\_Neuman](https://community.dynatrace.com/user/6931)

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [November 1, 2021, 9:55am UTC](https://community.dynatrace.com/t/set-custom-value-in-synthetic-and-show-it-in-dashboards/33147/4 "2021-11-01T09:55:29Z")

</div>

For that you will need to collect the information from server side with [request attribute](https://www.dynatrace.com/support/help/shortlink/request-attributes-web-requests)&nbsp;and [calculated metrics](https://www.dynatrace.com/support/help/shortlink/calculated-service-metric)&nbsp;then you will be able to chart your metrics with [data explorer](https://www.dynatrace.com/support/help/shortlink/explorer).
