Problem with Dropdown and Button

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


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
And this's code in Addional Row


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;

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