# Select value from CSV file

**URL:** https://discourse.nodered.org/t/select-value-from-csv-file/45058
**Category:** General
**Created:** [2 May 2021 14:37 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058 "2021-05-02T14:37:09Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [5 May 2021 17:34 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058/22 "2021-05-05T17:34:33Z")

</div>

expand the options in that debug and then post flow un edited.

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [5 May 2021 17:55 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058/23 "2021-05-05T17:55:47Z")

</div>

You mean like this?

 ![Schermafbeelding 2021-05-05 om 19.55.15](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/52b363518dc6d52be3c44fe51889d16d7c9d6b52.jpeg)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [5 May 2021 18:05 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058/24 "2021-05-05T18:05:16Z")

</div>

> [@E1cid](#):
>
> post flow un edited.

post the flow please.  
everything looks fine so may be an setting in the dropdown node.  
What version of Node-red are you using? and Dashboard?

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [5 May 2021 18:24 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058/25 "2021-05-05T18:24:46Z")

</div>

I have node red version v1.1.3.  
node-red-dashboard 2.23.3

The flow:

```auto
[{"id":"c4bf66.1cb1f098","type":"inject","z":"b4370c04.a6c7d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":1780,"wires":[["4387474c.b83518"]]},{"id":"4387474c.b83518","type":"template","z":"b4370c04.a6c7d","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"product,takt\nball,20\ntrain,30\nhat,60","output":"str","x":200,"y":1860,"wires":[["ea6d82b9.900608"]]},{"id":"ea6d82b9.900608","type":"csv","z":"b4370c04.a6c7d","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":320,"y":1900,"wires":[["6cf510bb.a9b408"]]},{"id":"6cf510bb.a9b408","type":"change","z":"b4370c04.a6c7d","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload.{product: $}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":1900,"wires":[["791af232.1e9dcc","224de115.06a916"]]},{"id":"791af232.1e9dcc","type":"ui_dropdown","z":"b4370c04.a6c7d","name":"","label":"test","tooltip":"","place":"Select option","group":"a01cca30.f7142","order":4,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"topic","x":720,"y":1900,"wires":[["224de115.06a916"]]},{"id":"224de115.06a916","type":"debug","z":"b4370c04.a6c7d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":1820,"wires":[]},{"id":"a01cca30.f7142","type":"ui_group","name":"","tab":"4da6c120.9c3648","order":1,"disp":true,"width":"6","collapse":false},{"id":"4da6c120.9c3648","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [5 May 2021 18:42 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058/26 "2021-05-05T18:42:02Z")

</div>

May be your versions are to old. try updating dashboard to 2.29.0. If that does not work then you will have to update node-red.  
also test this flow for possible workaround.

```auto
[{"id":"ea6d82b9.900608","type":"csv","z":"9b3f9f31.c45298","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":370,"y":2120,"wires":[["6cf510bb.a9b408"]]},{"id":"4387474c.b83518","type":"template","z":"9b3f9f31.c45298","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"product,takt\nball,20\ntrain,30\nhat,60","output":"str","x":250,"y":2080,"wires":[["ea6d82b9.900608"]]},{"id":"6cf510bb.a9b408","type":"change","z":"9b3f9f31.c45298","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload.{product: $string($)}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":2120,"wires":[["791af232.1e9dcc","224de115.06a916"]]},{"id":"c4bf66.1cb1f098","type":"inject","z":"9b3f9f31.c45298","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":2000,"wires":[["4387474c.b83518"]]},{"id":"791af232.1e9dcc","type":"ui_dropdown","z":"9b3f9f31.c45298","name":"","label":"test","tooltip":"","place":"Select option","group":"a01cca30.f7142","order":4,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"topic","x":770,"y":2120,"wires":[["224de115.06a916"]]},{"id":"224de115.06a916","type":"debug","z":"9b3f9f31.c45298","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":700,"y":2040,"wires":[]},{"id":"a01cca30.f7142","type":"ui_group","name":"","tab":"4da6c120.9c3648","order":1,"disp":true,"width":"6","collapse":false},{"id":"4da6c120.9c3648","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [5 May 2021 19:03 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058/27 "2021-05-05T19:03:50Z")

</div>

I updated the dashboard node to 2.29.0 and now it is working!  
Thank you very much!

 ![Schermafbeelding 2021-05-05 om 21.01.01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/47cc4b6ed3fad4b82f18effec679c92d60c135c0.jpeg)

---

<div class="post-metadata">

### Author: ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)
#### Post date: [10 May 2021 16:45 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058/28 "2021-05-10T16:45:57Z")

</div>

Hello @E1cid,

I want to extend the options with a second dropdown menu.  
When I select product "ball" I want to select in another dropdown node the type of the ball.

 ![Schermafbeelding 2021-05-10 om 18.13.53](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e2daa0f5420981409af3496a7ac2c713f222f348.png)

This is the flow that I created::

```auto
[{"id":"8c0623de.87ca1","type":"inject","z":"b4370c04.a6c7d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":2640,"wires":[["3ce8055d.54a18a"]]},{"id":"3ce8055d.54a18a","type":"template","z":"b4370c04.a6c7d","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"product,ball,train,hat\nball,baseball,yellowtrain,bighat\ntrain ,football,bluetrain,smallhat\nhat,tennisball,redtrain,mediumhat","output":"str","x":280,"y":2680,"wires":[["a1092c24.2d9c8"]]},{"id":"a1092c24.2d9c8","type":"csv","z":"b4370c04.a6c7d","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":430,"y":2680,"wires":[["710b3dda.63a9b4","36d6405f.fb078","c348b469.19c818"]]},{"id":"710b3dda.63a9b4","type":"change","z":"b4370c04.a6c7d","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload.{product: product}","tot":"jsonata"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":2680,"wires":[["41316f23.24fc1"]]},{"id":"41316f23.24fc1","type":"ui_dropdown","z":"b4370c04.a6c7d","name":"","label":"product","tooltip":"","place":"Select option","group":"7da9517d.305a1","order":4,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"topic","topicType":"msg","x":820,"y":2680,"wires":[["3fbad61f.c17efa","8835f550.6d4fb"]]},{"id":"3fbad61f.c17efa","type":"debug","z":"b4370c04.a6c7d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":970,"y":2620,"wires":[]},{"id":"36d6405f.fb078","type":"debug","z":"b4370c04.a6c7d","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":2620,"wires":[]},{"id":"c348b469.19c818","type":"change","z":"b4370c04.a6c7d","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload.{msg.product: msg.product}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":2760,"wires":[["28949ca7.79c294","6def0228.d2382c"]]},{"id":"28949ca7.79c294","type":"ui_dropdown","z":"b4370c04.a6c7d","name":"","label":"type","tooltip":"","place":"Select option","group":"7da9517d.305a1","order":4,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"topic","topicType":"msg","x":850,"y":2760,"wires":[[]]},{"id":"6def0228.d2382c","type":"debug","z":"b4370c04.a6c7d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":910,"y":2840,"wires":[]},{"id":"8835f550.6d4fb","type":"change","z":"b4370c04.a6c7d","name":"","rules":[{"t":"set","p":"product","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":2700,"wires":[["a34961c7.b9cb78","c348b469.19c818"]]},{"id":"a34961c7.b9cb78","type":"debug","z":"b4370c04.a6c7d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"product","targetType":"msg","statusVal":"","statusType":"auto","x":1310,"y":2680,"wires":[]},{"id":"7da9517d.305a1","type":"ui_group","name":"","tab":"1ea6ab39.e574b5","order":1,"disp":true,"width":"6","collapse":false},{"id":"1ea6ab39.e574b5","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

.

Below are the options from a CSV file I want to choose from.

When I select product 'ball', I tried to use the string 'ball' in msg.product to use msg.product as a selector from the dropdown menu. But that doesn't works.

What am I doing wrong?

![Schermafbeelding 2021-05-10 om 18.10.55](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/4149cb80a477590c15aaa83995b3049f8e21151f.png)

---

<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: [24 May 2021 16:46 UTC](https://discourse.nodered.org/t/select-value-from-csv-file/45058/29 "2021-05-24T16:46:21Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/select-value-from-csv-file/45058.md?page=1)
