# Flow doesnt read data from xlsx

**URL:** <https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538>\
**Category:** General\
**Tags:** database\
**Created:** [8 March 2022 14:06 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538 "2022-03-08T14:06:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![milner236](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@milner236](https://discourse.nodered.org/u/milner236)\
**Post date:** [8 March 2022 14:06 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/1 "2022-03-08T14:06:24Z")

</div>

Hello everyone. I have created a flow that watches for excel files in a folder, then writes the data from the excel file to an MSSQL database.  
For a strange reason, my flow does not read the data from the excel file. It appears to be "empty".  
This is the flow-

 ![Screenshot_2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06e6abb8553eb18e5a53ccf4ba82ef9957906f95.png)

When I attach a debug node to the "sheet" node I receive a msg.payload undefined response.  
When I attach the debugger to the "sheet to json" node I receive a msg.payload empty response.

What am I missing? I use the same flow construction on other flows and they work great.  
I highly appreciate any help.

Edit:  
Just tested it with other excel formats that I use and it works. That means something off in my file. Cant seem to lay my finger on it. Any advice?

---

<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:** [8 March 2022 15:07 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/2 "2022-03-08T15:07:58Z")

</div>

Can you show us how you have configured the Watch node?

Also connect a debug node to the watch node, set it to Output Complete Message and show us what it sees.

Edit: Also see what is coming out of the File node.

---

<div class="post-metadata">

**Author:** ![milner236](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@milner236](https://discourse.nodered.org/u/milner236)\
**Post date:** [8 March 2022 15:21 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/3 "2022-03-08T15:21:58Z")

</div>

This is the watch node-  
It actually does manage to identify the file, the issue is that it says that msg.payload is empty eventhough there is data in it.

![Screenshot_3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/1/e1408473ac0e0e041a041a4057fddbafe5c14d62.png)

This is the full message debug from the watch node.

![Screenshot_4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/6/e6e8f60b6355172929bac3d6396f51a02f1373a0.png)

---

<div class="post-metadata">

**Author:** ![milner236](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@milner236](https://discourse.nodered.org/u/milner236)\
**Post date:** [8 March 2022 15:25 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/4 "2022-03-08T15:25:33Z")

</div>

Also attached a full msg debug to the "sheet to json" node-  
 ![Screenshot_5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a4dd3e51b296e26bf7a1a2db4a0997aa9258ccfd.png)

msg debug from File node-

 ![Screenshot_6](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/6/3626366313303f021aba29c780e861a6b00ce812.png)

---

<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:** [8 March 2022 15:39 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/5 "2022-03-08T15:39:44Z")

</div>

Did you see the comment at the bottom of the watch node image that you posted?

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

Though I am surprised it worked at all without them.

Why is the filename different in the message from the Watch node and the output from the File node?

---

<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:** [8 March 2022 15:42 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/6 "2022-03-08T15:42:10Z")

</div>

Are you getting multiple messages from the Watch node? That can happen because it tells you about the generation of temporary files, and in addition it can tell you before the file write is fully complete, so you may get multiple messages for the same file.

---

<div class="post-metadata">

**Author:** ![milner236](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@milner236](https://discourse.nodered.org/u/milner236)\
**Post date:** [8 March 2022 15:52 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/7 "2022-03-08T15:52:06Z")

</div>

Thats because the other part of my flow adds a timestamp to the filename and then moves it to another folder.  
For the sake of the screenshot I copied and pasted the file from the other folder back to the watched folder.

---

<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:** [8 March 2022 15:53 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/8 "2022-03-08T15:53:16Z")

</div>

Did you see my second post?

---

<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:** [8 March 2022 15:55 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/9 "2022-03-08T15:55:31Z")

</div>

> [@milner236](#):
>
> Thats because the other part of my flow adds a timestamp to the filename and then moves it to another folder.

I don't understand in that case. The File node is connected directly to the Watch node.

---

<div class="post-metadata">

**Author:** ![milner236](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@milner236](https://discourse.nodered.org/u/milner236)\
**Post date:** [8 March 2022 16:10 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/10 "2022-03-08T16:10:30Z")

</div>

Yes I am getting multiple messages from the watch node.

What happened is that I copied a used file from the "archive" folder. The file had the original file name + timestamp.  
I then pasted it to the watched folder. That explains why the name is different in the File node output.

After approximatly 4 hours of trying to figure out whats wrong, I came to the realization that theres nothing wrong in the flow. The problem is in the specific Excel file I had been working with.  
After copying the format to a new excel file, it worked.

Much thanks Colin for all the help and advice!

---

<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:** [7 May 2022 16:10 UTC](https://discourse.nodered.org/t/flow-doesnt-read-data-from-xlsx/59538/11 "2022-05-07T16:10:53Z")

</div>

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