# Clearing Dashboard textbox prior to update

**URL:** <https://discourse.nodered.org/t/clearing-dashboard-textbox-prior-to-update/89443>\
**Category:** General\
**Created:** [12 July 2024 13:01 UTC](https://discourse.nodered.org/t/clearing-dashboard-textbox-prior-to-update/89443 "2024-07-12T13:01:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fogmajor](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@fogmajor](https://discourse.nodered.org/u/fogmajor)\
**Post date:** [12 July 2024 13:01 UTC](https://discourse.nodered.org/t/clearing-dashboard-textbox-prior-to-update/89443/1 "2024-07-12T13:01:20Z")

</div>

I have a dashboard textbox that displays a database record count which is working fine, Lets say its displaying a value of 10 and the sql query updates and returns no records I want to either set the textbox to 0 or leave it blank currently it displays the last positive count.

Thank you in advance

Andrew

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 July 2024 13:42 UTC](https://discourse.nodered.org/t/clearing-dashboard-textbox-prior-to-update/89443/2 "2024-07-12T13:42:48Z")

</div>

You would need to send a empty or 0 to the text node prior to updating from the query. If this relates to your previous topic on sending array elements to text nodes, then something like this.

```auto
[{"id":"90834dc7f475afa6","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[$round($random()*10),$round($random()*10)]","payloadType":"jsonata","x":430,"y":60,"wires":[["c7ecbcc3aad7a729","c99169a5f6d2f71e"]]},{"id":"c7ecbcc3aad7a729","type":"split","z":"d1395164b4eec73e","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":590,"y":60,"wires":[["f55c284f5c491308"]]},{"id":"c99169a5f6d2f71e","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":20,"wires":[["5ce3538521150066","db935955d2c92528"]]},{"id":"f55c284f5c491308","type":"switch","z":"d1395164b4eec73e","name":"","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":60,"wires":[["5ce3538521150066"],["db935955d2c92528"]]},{"id":"5ce3538521150066","type":"ui-text","z":"d1395164b4eec73e","group":"9d83cd8b3d5ee33c","order":1,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","style":false,"font":"","fontSize":16,"color":"#717171","className":"","x":870,"y":60,"wires":[]},{"id":"db935955d2c92528","type":"ui-text","z":"d1395164b4eec73e","group":"9d83cd8b3d5ee33c","order":2,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","style":false,"font":"","fontSize":16,"color":"#717171","className":"","x":870,"y":100,"wires":[]},{"id":"9d83cd8b3d5ee33c","type":"ui-group","name":"Group1","page":"c694d0ebe0d2b702","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"c694d0ebe0d2b702","type":"ui-page","name":"Page1","ui":"1805777f90e92057","path":"/page1","icon":"home","layout":"grid","theme":"a965ccfef139317a","order":2,"className":"","visible":"true","disabled":"false"},{"id":"1805777f90e92057","type":"ui-base","name":"dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false},{"id":"a965ccfef139317a","type":"ui-theme","name":"HN Theme","colors":{"surface":"#5c5c5c","primary":"#00fdff","bgPage":"#383838","groupBg":"#4f4f4f","groupOutline":"#858585"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

```

---

<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:** [10 October 2024 13:43 UTC](https://discourse.nodered.org/t/clearing-dashboard-textbox-prior-to-update/89443/3 "2024-10-10T13:43:00Z")

</div>

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