# Visualizing data from Excel sheet with Filter in NodeRed

**URL:** <https://discourse.nodered.org/t/visualizing-data-from-excel-sheet-with-filter-in-nodered/81026>\
**Category:** General\
**Created:** [4 September 2023 08:26 UTC](https://discourse.nodered.org/t/visualizing-data-from-excel-sheet-with-filter-in-nodered/81026 "2023-09-04T08:26:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trma\_chaser](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@Trma\_chaser](https://discourse.nodered.org/u/Trma_chaser)\
**Post date:** [4 September 2023 08:26 UTC](https://discourse.nodered.org/t/visualizing-data-from-excel-sheet-with-filter-in-nodered/81026/1 "2023-09-04T08:26:18Z")

</div>

Hi  
iam looking for a way to exctract/visualize data from a excel sheet or CSV

Aim:  
We have a booking system that wir export a CSV/Excel file very 30min. with new or change bookings.

I want to display the current booking Attandee (i.e the booking @1pm) on a Dashboard next to the Booked activity

For Example  
City Tour New York - Andy Smith

I havent figured out how to filter the "raw" csv to just extract the name next to the activtiy and also to just display the next attandee based on the system time.

Anyone a suggestion on how to get startet or even resolve this eaiser than i thought?

Thanks

---

<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:** [4 September 2023 09:36 UTC](https://discourse.nodered.org/t/visualizing-data-from-excel-sheet-with-filter-in-nodered/81026/2 "2023-09-04T09:36:10Z")

</div>

I would start by using a csv node to convert the data to javascript objects.

---

<div class="post-metadata">

**Author:** ![Trma\_chaser](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@Trma\_chaser](https://discourse.nodered.org/u/Trma_chaser)\
**Post date:** [4 September 2023 10:44 UTC](https://discourse.nodered.org/t/visualizing-data-from-excel-sheet-with-filter-in-nodered/81026/3 "2023-09-04T10:44:41Z")

</div>

Hi Colin

How do you convert it to js objects ?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 September 2023 11:05 UTC](https://discourse.nodered.org/t/visualizing-data-from-excel-sheet-with-filter-in-nodered/81026/4 "2023-09-04T11:05:21Z")

</div>

There are various libraries that can help with this if you really need to use an Excel workbook as the source. Generally, CSV files are easier to work with outside a spreadsheet as in this case but there are libraries that will work direct with Excel workbooks too.

Node-RED isn't brilliant at doing streamed interfaces which means that you need to read in the whole file first, use the CSV node to convert the input to JSON and then you can filter using standard JavaScript.

After conversion, you should end up with a msg.payload that contains an array of objects. Each input record becomes an array element and each column of each record is an object with named (assuming your input CSV has column names) properties.

```auto
msg.payload = [
  {
    "col1": 1,
    "col2": 2,
  },
  {
    "col1": 3,
    "col2": 4,
  }
]

```

From this you can use the `Array.filter` function to create a shallow copy of the input filtered to only the records you need.

[Array.prototype.filter() - JavaScript | MDN (mozilla.org)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)

---

<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:** [4 September 2023 12:57 UTC](https://discourse.nodered.org/t/visualizing-data-from-excel-sheet-with-filter-in-nodered/81026/5 "2023-09-04T12:57:39Z")

</div>

> [@Trma\_chaser](#):
>
> How do you convert it to js objects

Start by reading the help text for the csv 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:** [3 November 2023 12:58 UTC](https://discourse.nodered.org/t/visualizing-data-from-excel-sheet-with-filter-in-nodered/81026/6 "2023-11-03T12:58:24Z")

</div>

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