# Using join Node and CSV Node

**URL:** <https://discourse.nodered.org/t/using-join-node-and-csv-node/29645>\
**Category:** General\
**Created:** [7 July 2020 10:11 UTC](https://discourse.nodered.org/t/using-join-node-and-csv-node/29645 "2020-07-07T10:11:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amir](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Amir](https://discourse.nodered.org/u/Amir)\
**Post date:** [7 July 2020 10:11 UTC](https://discourse.nodered.org/t/using-join-node-and-csv-node/29645/1 "2020-07-07T10:11:27Z")

</div>

Good morning every one, I want to write an .CSV file that contains the data captured from  
a sensor, i was succeeded to make the csv file when i wanted to store one parameter from the  
sensor but when i try to collect other types of parameters the join node doesn't produce an output on the debugger , the following is the flow

```auto
[{"id":"a891dc25.73993","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"50881b49.b37344","type":"ttn uplink","z":"a891dc25.73993","name":"","app":"f73f7950.45c808","dev_id":"fipy-2020","field":"","x":60,"y":300,"wires":[["8f0b2a03.5ece08","63f18f8a.096dc"]]},{"id":"8f0b2a03.5ece08","type":"interval-length","z":"a891dc25.73993","format":"human","bytopic":false,"minimum":"","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":false,"msgField":"payload","timestampField":"timestamp","repeatTimeout":false,"name":"","x":180,"y":400,"wires":[["da513d96.e4097"],[]]},{"id":"ef47ed18.99dfb","type":"join","z":"a891dc25.73993","name":"Join Data ","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":460,"y":300,"wires":[["d04adb46.0f3c28","a4b65ff0.50628"]]},{"id":"a3d96c31.7a581","type":"debug","z":"a891dc25.73993","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":530,"y":180,"wires":[]},{"id":"63f18f8a.096dc","type":"function","z":"a891dc25.73993","name":"","func":"// Just a helper variable to use below\n // DataRate: msg.metadata.data_rate,\n // msg.payload = {humidity: msg.humidity, temp: msg.temp}\n\n \n msg.topic = \"Data\"\n\n var gateways = msg.metadata.gateways;\n \n msg.payload = {DataRate: msg.metadata.data_rate,\n rssi: gateways.map(gw => gw.rssi),\n snr: gateways.map(gw => gw.snr),\n Gw: gateways.map(gw => gw.gtw_id),\n \n }\n \nreturn msg\n\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":240,"y":220,"wires":[["a3d96c31.7a581"],["ef47ed18.99dfb"]]},{"id":"da513d96.e4097","type":"change","z":"a891dc25.73993","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Delay","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":340,"wires":[["ef47ed18.99dfb","f8196a21.da1b58"]]},{"id":"6495ce5.b08313","type":"csv","z":"a891dc25.73993","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":",","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":770,"y":300,"wires":[[]]},{"id":"d04adb46.0f3c28","type":"file","z":"a891dc25.73993","name":"File Write","filename":"D:\\To_D_Drive\\Konwledge\\Polito_Courses\\Thesis\\WSN\\Lora\\Thesis_Measures\\NodeRed\\CSV\\Couple.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":620,"y":300,"wires":[["6495ce5.b08313"]]},{"id":"a4b65ff0.50628","type":"debug","z":"a891dc25.73993","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":400,"wires":[]},{"id":"f8196a21.da1b58","type":"debug","z":"a891dc25.73993","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":460,"y":500,"wires":[]},{"id":"f73f7950.45c808","type":"ttn app","z":"","appId":"fipy-2020","accessKey":"ttn-account-v2.WqRTYOa1Sfa34PTqj4PnRW5LlTjg8KOIJzAR3a3jr3I","discovery":"discovery.thethingsnetwork.org:1900"}]

```

The Data that comes out on the debuger is the output of the "Function" and "Interval length" Nodes

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/be4b9abc5254731701ff299e6a23afa910a62a13.png)

Kindly inform me what to do , i don't have any experience in javaScript

---

<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:** [7 July 2020 10:58 UTC](https://discourse.nodered.org/t/using-join-node-and-csv-node/29645/2 "2020-07-07T10:58:47Z")

</div>

Your function node has two outputs but you are sending data to output 1 and nothing to output 2. Set the number of outputs to 1 and join both wires to that output.

---

<div class="post-metadata">

**Author:** ![Amir](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Amir](https://discourse.nodered.org/u/Amir)\
**Post date:** [7 July 2020 11:51 UTC](https://discourse.nodered.org/t/using-join-node-and-csv-node/29645/3 "2020-07-07T11:51:09Z")

</div>

Thanks Colin, it works well now.....

---

<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:** [21 July 2020 11:51 UTC](https://discourse.nodered.org/t/using-join-node-and-csv-node/29645/4 "2020-07-21T11:51:11Z")

</div>

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