# export influxdb to excel

**URL:** <https://discourse.nodered.org/t/export-influxdb-to-excel/70623>\
**Category:** General\
**Created:** [15 November 2022 07:06 UTC](https://discourse.nodered.org/t/export-influxdb-to-excel/70623 "2022-11-15T07:06:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hagory85](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hagory85/32/70717_2.png) [@Hagory85](https://discourse.nodered.org/u/Hagory85)\
**Post date:** [15 November 2022 07:06 UTC](https://discourse.nodered.org/t/export-influxdb-to-excel/70623/1 "2022-11-15T07:06:13Z")

</div>

tengo en node red la lectura de mi inversor solar, el cual guarda los datos en influxdb, me gustaría exportar cada cierto tiempo esa base de datos en un csv o Excel… me podrían ayudar por favor

---

<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:** [15 November 2022 07:28 UTC](https://discourse.nodered.org/t/export-influxdb-to-excel/70623/2 "2022-11-15T07:28:12Z")

</div>

Welcome to the forum @Hagory85

Sorry, I do not speak your language, but I suggest you start by using Google to search for  
Export influxdb to excel  
Then when you know how to do it you can think about doing it in node red.

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [15 November 2022 16:36 UTC](https://discourse.nodered.org/t/export-influxdb-to-excel/70623/3 "2022-11-15T16:36:24Z")

</div>

> [@Hagory85](#):
>
> tengo en node red la lectura de mi inversor solar, el cual guarda los datos en influxdb, me gustaría exportar cada cierto tiempo esa base de datos en un csv o Excel… me podrían ayudar por favor

This structure should do the trick. The query is edited in the template node (not essential but a good practice as it gives you the ability to bring in variables from message properties.) This example would pull the last week worth of data and put it in a CSV formatted file.

````auto
    {
        "id": "b35992d8108e37c6",
        "type": "influxdb in",
        "z": "d7ef59df0fafedbb",
        "influxdb": "",
        "name": "",
        "query": "",
        "rawOutput": false,
        "precision": "",
        "retentionPolicy": "",
        "org": "YOURORG",
        "x": 560,
        "y": 620,
        "wires": [
            [
                "a56df2edbe56416f"
            ]
        ]
    },
    {
        "id": "0ed441529b5da056",
        "type": "inject",
        "z": "d7ef59df0fafedbb",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            },
            {
                "p": "bucket",
                "v": "bucketname",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 240,
        "y": 620,
        "wires": [
            [
                "2d7cf7837c332c64"
            ]
        ]
    },
    {
        "id": "2d7cf7837c332c64",
        "type": "template",
        "z": "d7ef59df0fafedbb",
        "name": "",
        "field": "query",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "from(bucket: \"{{{bucket}}}\")\n |> range(start: -7d)\n |> sort(columns: [\"_time\"])\n |> yield(name: \"reult\")",
        "output": "str",
        "x": 400,
        "y": 620,
        "wires": [
            [
                "b35992d8108e37c6"
            ]
        ]
    },
    {
        "id": "e0360f7585105061",
        "type": "debug",
        "z": "d7ef59df0fafedbb",
        "name": "debug 80",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 980,
        "y": 620,
        "wires": []
    },
    {
        "id": "a56df2edbe56416f",
        "type": "csv",
        "z": "d7ef59df0fafedbb",
        "name": "",
        "sep": ",",
        "hdrin": "",
        "hdrout": "all",
        "multi": "one",
        "ret": "\\n",
        "temp": "",
        "skip": "0",
        "strings": true,
        "include_empty_strings": "",
        "include_null_values": "",
        "x": 710,
        "y": 620,
        "wires": [
            [
                "15863b861736f80b"
            ]
        ]
    },
    {
        "id": "15863b861736f80b",
        "type": "file",
        "z": "d7ef59df0fafedbb",
        "name": "",
        "filename": "",
        "filenameType": "str",
        "appendNewline": false,
        "createDir": false,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 840,
        "y": 620,
        "wires": [
            [
                "e0360f7585105061"
            ]
        ]
    }
]```
````

---

<div class="post-metadata">

**Author:** ![Hagory85](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hagory85/32/70717_2.png) [@Hagory85](https://discourse.nodered.org/u/Hagory85)\
**Post date:** [16 November 2022 04:50 UTC](https://discourse.nodered.org/t/export-influxdb-to-excel/70623/4 "2022-11-16T04:50:47Z")

</div>

> [@JayDickson](#):
>
> This structure should do the trick. The query is edited in the template node (not essential but a good practice as it gives you the ability to bring in variables from message properties.) This example would pull the last week worth of data and put it in a CSV formatted file.

Where do I have to add this code? ... excuse me, I'm lost

---

<div class="post-metadata">

**Author:** ![Hagory85](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hagory85/32/70717_2.png) [@Hagory85](https://discourse.nodered.org/u/Hagory85)\
**Post date:** [16 November 2022 04:52 UTC](https://discourse.nodered.org/t/export-influxdb-to-excel/70623/5 "2022-11-16T04:52:06Z")

</div>

Before bothering here I had already Googled it... if I ask it's that I need help... anyway thank you for your answer

---

<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:** [15 January 2023 04:52 UTC](https://discourse.nodered.org/t/export-influxdb-to-excel/70623/6 "2023-01-15T04:52:54Z")

</div>

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