# Access msg object in dashboard ui\_template

**URL:** <https://discourse.nodered.org/t/access-msg-object-in-dashboard-ui-template/5502>\
**Category:** Dashboard\
**Created:** [5 December 2018 14:24 UTC](https://discourse.nodered.org/t/access-msg-object-in-dashboard-ui-template/5502 "2018-12-05T14:24:33Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![JayGhb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayghb/32/5550_2.png) [@JayGhb](https://discourse.nodered.org/u/JayGhb)\
**Post date:** [6 December 2018 13:55 UTC](https://discourse.nodered.org/t/access-msg-object-in-dashboard-ui-template/5502/9 "2018-12-06T13:55:34Z")

</div>

Thank you krambriw, your answer pointed me to the right direction for what I wanted!  
The trick was executing the

```auto
initMap(data)

```

google maps callback function in place of your " update(data) ".  
Then I could normally access the msg returned from the query like

```auto
for (var a = 0; a < data.length; a++) {
            var tmpLat = data[a].lat;
            var tmpLng = data[a].lng;   

        var marker = _newGoogleMapsMarker({
            _map: map,
            _lat: tmpLat,
            _lng: tmpLng
        }); 
        
 }

```

---

_[View the full topic](https://discourse.nodered.org/t/access-msg-object-in-dashboard-ui-template/5502)._
