# How to set the \_field tag to write to influxdb using the influxdb out node?

**URL:** https://discourse.nodered.org/t/how-to-set-the-field-tag-to-write-to-influxdb-using-the-influxdb-out-node/74990
**Category:** General
**Created:** [10 February 2023 11:25 UTC](https://discourse.nodered.org/t/how-to-set-the-field-tag-to-write-to-influxdb-using-the-influxdb-out-node/74990 "2023-02-10T11:25:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![HerrLux](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@HerrLux](https://discourse.nodered.org/u/HerrLux)
#### Post date: [10 February 2023 11:25 UTC](https://discourse.nodered.org/t/how-to-set-the-field-tag-to-write-to-influxdb-using-the-influxdb-out-node/74990/1 "2023-02-10T11:25:23Z")

</div>

Hey everyone,

I'm new to node-red and already learned a lot from browsing this forum.

I have a little flow that right now uses a single object to write a value into influx db using the influxdb out node.  
My problem is, that the entries made in influxdb have `_value` as the `_field` tag where I want it do be `AT` and I don't get why that is. The object send to the influxdb out node is

![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b9fed438e8566e4d1a6f749a0267515b8fd690eb.png)

I am thankful for hints and ideas and happy to learn.

---

<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: [10 February 2023 11:53 UTC](https://discourse.nodered.org/t/how-to-set-the-field-tag-to-write-to-influxdb-using-the-influxdb-out-node/74990/2 "2023-02-10T11:53:27Z")

</div>

Welcome to the forum @HerrLux

As described in the help text for the node, you can pass on object in msg.payload with the property `AT` set to the value.

---

<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: [10 February 2023 15:26 UTC](https://discourse.nodered.org/t/how-to-set-the-field-tag-to-write-to-influxdb-using-the-influxdb-out-node/74990/3 "2023-02-10T15:26:44Z")

</div>

You do that in a Change node configured like this  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/c/3c49d4d9e5b49a9ada74265f9bb633c5ed883f38.png)

Then feed that into a Debug node to make sure it looks right before connecting to the Influx node.

---

<div class="post-metadata">

### Author: ![HerrLux](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@HerrLux](https://discourse.nodered.org/u/HerrLux)
#### Post date: [10 February 2023 15:31 UTC](https://discourse.nodered.org/t/how-to-set-the-field-tag-to-write-to-influxdb-using-the-influxdb-out-node/74990/4 "2023-02-10T15:31:18Z")

</div>

Thank you very much Colin.

In between your two replies I came up with a function note that does the trick for me

```auto
msg.payload = [{
       "AT": msg.payload,
   }];
return msg;

```

---

<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: [10 February 2023 17:05 UTC](https://discourse.nodered.org/t/how-to-set-the-field-tag-to-write-to-influxdb-using-the-influxdb-out-node/74990/5 "2023-02-10T17:05:20Z")

</div>

If you want to do it in a function (which is less efficient than a change node) then you can take out the square brackets. It doesn't need to be an array. Again, see the help text for the node.

---

<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: [11 April 2023 17:06 UTC](https://discourse.nodered.org/t/how-to-set-the-field-tag-to-write-to-influxdb-using-the-influxdb-out-node/74990/6 "2023-04-11T17:06:00Z")

</div>

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