# Not able to insert msg.tags in influx dB using node-red-contrib-influxdb

**URL:** <https://discourse.nodered.org/t/not-able-to-insert-msg-tags-in-influx-db-using-node-red-contrib-influxdb/97658>\
**Category:** General\
**Tags:** function-node, influxdb\
**Created:** [17 June 2025 05:52 UTC](https://discourse.nodered.org/t/not-able-to-insert-msg-tags-in-influx-db-using-node-red-contrib-influxdb/97658 "2025-06-17T05:52:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joseeviral](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@joseeviral](https://discourse.nodered.org/u/joseeviral)\
**Post date:** [17 June 2025 05:52 UTC](https://discourse.nodered.org/t/not-able-to-insert-msg-tags-in-influx-db-using-node-red-contrib-influxdb/97658/1 "2025-06-17T05:52:55Z")

</div>

I have created function to insert data in influx db 2.0 where i would like to insert 10 different parameter with measurement and tags. so i can filter data from m/c wise by using msg.tags. But not able to insert msg.tags value in database. Function node code as below.

```auto
msg.measurement = "MTR-MATRIX";
msg.tags = { machine_name: "D-1" };
msg.payload = {
    ai_LH_Platen_TempPV: msg.payload.ai_LH_Platen_TempPV,
    ai_LH_Jacket_TempPV: msg.payload.ai_LH_Jacket_TempPV,
    ai_RH_Platen_TempPV: msg.payload.ai_RH_Platen_TempPV,
    ai_RH_Jacket_TempPV: msg.payload.ai_RH_Jacket_TempPV,
    ai_LH_Press_IntPressurePV: msg.payload.ai_LH_Press_IntPressurePV,
    ai_RH_Press_IntPressurePV: msg.payload.ai_RH_Press_IntPressurePV,
    ai_LH_Press_IntTempPV: msg.payload.ai_LH_Press_IntTempPV,
    ai_RH_Press_IntTempPV: msg.payload.ai_RH_Press_IntTempPV,
    ai_RH_Press_ShapingPV: msg.payload.ai_RH_Press_ShapingPV,
    ai_LH_Press_ShapingPV: msg.payload.ai_LH_Press_ShapingPV
};

return msg; 

```

I wanted to use db to create Dynamic dashboard in Grafana using m/c name. So, i can filter by m/c name.  
help me to find out minor error i am missing.

---

<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:** [17 June 2025 07:16 UTC](https://discourse.nodered.org/t/not-able-to-insert-msg-tags-in-influx-db-using-node-red-contrib-influxdb/97658/2 "2025-06-17T07:16:06Z")

</div>

Read the help text for the node. That is not how to save tags.

---

<div class="post-metadata">

**Author:** ![joseeviral](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@joseeviral](https://discourse.nodered.org/u/joseeviral)\
**Post date:** [19 June 2025 04:57 UTC](https://discourse.nodered.org/t/not-able-to-insert-msg-tags-in-influx-db-using-node-red-contrib-influxdb/97658/3 "2025-06-19T04:57:05Z")

</div>

I have gone to the help of node-red-contrib-influxdb. I am not able to find related to .tag in node.  
i will thank full to you if you can provide code line or guide me.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 June 2025 06:40 UTC](https://discourse.nodered.org/t/not-able-to-insert-msg-tags-in-influx-db-using-node-red-contrib-influxdb/97658/4 "2025-06-19T06:40:58Z")

</div>

> [@joseeviral](#):
>
> I am not able to find related to .tag in node

I'm not familiar with this node but from the readme: [node-red-contrib-influxdb (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-influxdb)...

> The function node generates sample points as follows:
> 
> ```js
> msg.payload = [
> {
> measurement: "weather_sensor",
> fields: {
> temp: 5.5,
> light: 678,
> humidity: 51
> },
> tags:{
> location:"garden"
> },
> timestamp: new Date()
> },
> {
> measurement: "alarm_sensor",
> fields: {
> proximity: 999,
> temp: 19.5
> },
> tags:{
> location:"home"
> },
> timestamp: new Date()
> }
> ];
> return msg;
> 
> ```

Did that help?

---

<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:** [19 June 2025 08:55 UTC](https://discourse.nodered.org/t/not-able-to-insert-msg-tags-in-influx-db-using-node-red-contrib-influxdb/97658/5 "2025-06-19T08:55:02Z")

</div>

I am not at my PC, but doesn't it say something like  
If msg.payload is an array of two objects then the first object contains the fields and the second contains the tags.

---

<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:** [17 September 2025 08:55 UTC](https://discourse.nodered.org/t/not-able-to-insert-msg-tags-in-influx-db-using-node-red-contrib-influxdb/97658/6 "2025-09-17T08:55:13Z")

</div>

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