# Problem with Dropdown and Button

**URL:** <https://discourse.nodered.org/t/problem-with-dropdown-and-button/87984>\
**Category:** Dashboard\
**Created:** [15 May 2024 15:26 UTC](https://discourse.nodered.org/t/problem-with-dropdown-and-button/87984 "2024-05-15T15:26:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoyLPL2002](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/roylpl2002/32/90928_2.png) [@RoyLPL2002](https://discourse.nodered.org/u/RoyLPL2002)\
**Post date:** [15 May 2024 15:26 UTC](https://discourse.nodered.org/t/problem-with-dropdown-and-button/87984/1 "2024-05-15T15:26:39Z")

</div>

Hi,  
I'm using node-red and want to create an interface as follows:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f677acc311036b2d71e26de9de6026cf8f79d913.png)  
When selecting machine 1 and then clicking Load Report, it should display a table. However, when clicking Load Report, the "date" and "shift" data received from Firebase are not passed into the table. Interestingly, if I create the table without the dropdown and button, the "date" and "shift" data can still be passed into the table.  
This is my node-red:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c1c364ee7377ffd660ca32e86ff6fb12bcf19b7b.png)  
And this's code in Addional Row

```auto

var showTable = false;
if (msg.payload === "Machine 1") {
    showTable = true; 
} else {
    showTable = false; 
}

if (showTable === true ) {
    var tableData
    tableData = flow.get('savedData') || [];

    tableData.unshift (
        {
            date : msg.payload.date,
            shift : msg.payload.shift
        }
    );
    msg.payload = tableData;
    flow.set('savedData', tableData);
}
    return msg;

```

---

<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:** [14 June 2024 15:27 UTC](https://discourse.nodered.org/t/problem-with-dropdown-and-button/87984/2 "2024-06-14T15:27:12Z")

</div>

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