# Issue while displaying value in gauge

**URL:** <https://forum.inductiveautomation.com/t/issue-while-displaying-value-in-gauge/86665>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [March 1, 2024, 9:23am UTC](https://forum.inductiveautomation.com/t/issue-while-displaying-value-in-gauge/86665 "2024-03-01T09:23:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 1, 2024, 9:58am UTC](https://forum.inductiveautomation.com/t/issue-while-displaying-value-in-gauge/86665/2 "2024-03-01T09:58:58Z")

</div>

I don't understand what you are trying to do but I think that all your `parent.parent.parent.getChild().getChild().getChild()` code makes your application very brittle. If you move anything into another container it will break.  
I recommend that you set up some custom properties on the view and write the values to those. Then bind your gauge properties to those.

I would also try to do all this with expression functions rather than a script. You could have custom props for calculated daily, weekly and monthly and switch the gauge bindings based on `duration_type`.

You have one occurrence of `"{:.2f}kwh"`. It should be `"{:.2f}kWh"` (capital W for watt).

---

_[View the full topic](https://forum.inductiveautomation.com/t/issue-while-displaying-value-in-gauge/86665)._
