# A server-side getProperty for dashboard D2

**URL:** <https://discourse.nodered.org/t/a-server-side-getproperty-for-dashboard-d2/91091>\
**Category:** Developing Nodes\
**Tags:** dashboard-2\
**Created:** [19 September 2024 05:51 UTC](https://discourse.nodered.org/t/a-server-side-getproperty-for-dashboard-d2/91091 "2024-09-19T05:51:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [19 September 2024 05:51 UTC](https://discourse.nodered.org/t/a-server-side-getproperty-for-dashboard-d2/91091/1 "2024-09-19T05:51:46Z")

</div>

Hi folks,

Some months ago the `getProperty` function has been introduced in dashboard D2. That allows ui node developers to get easily the value of a property. That property can have its value from the config screen, but it can also be overwritten via `msg.ui_update`. But that doesn't matter, because the getProperty function handles all of this nicely.

I was wondering if a similar function exists on the server-side. For my new ui-web-push node I need my property values (which can be overwritten dynamically) on the server-side, so it would be nice if something would be offered by the dashboard framework, so not all ui node developers have to reinvent hot water.

Perhaps we have already discussed this before somewhere on Discourse. But my brain is chaos at the moment 🤯

Thanks!!!  
Bart

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [19 September 2024 21:47 UTC](https://discourse.nodered.org/t/a-server-side-getproperty-for-dashboard-d2/91091/2 "2024-09-19T21:47:47Z")

</div>

> [@BartButenaers](#):
>
> That property can have its value from the config screen, but it can also be overwritten via `msg.ui_update`.

I could solve it by adding following function to my serverside js file:

```auto
function getProperty(property) {
   return base.stores.state.getProperty(node.id, property) || node.config[property]
}

```

Although it would feel better if this would in the future integrated into the dashboard somehow, so ui developers simply need to call an API (and not have to bother about the stores).

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 September 2024 06:11 UTC](https://discourse.nodered.org/t/a-server-side-getproperty-for-dashboard-d2/91091/3 "2024-09-20T06:11:59Z")

</div>

Should that be `??`  
Otherwise a zero or falsey value in the store will not override the config.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [19 November 2024 06:12 UTC](https://discourse.nodered.org/t/a-server-side-getproperty-for-dashboard-d2/91091/4 "2024-11-19T06:12:20Z")

</div>

Closed on 19 November 2024 06:12 UTC

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