Clear Input Text after saving information

Hi,

I have UI_Text_input on my form to get the user to enter information to be saved in MYSQL. When I click on the button SAVE, data are saved, but I want to clear all the text_input after all by blank data.

What I did to clear them up :

  1. With Change Node, I assign an empty string to msg.payload and send it to the UI_Text_input. That is working and removing the old date but it displayed change in the UI_Text_input once applied.

  2. I tried the same thing, but instead, sending an empty string, I send ' or ''. That's also clean the field but displayed the characters into the Text_input.

I am trying to find a way to clean the text_input once the data is saved and so far, can figure it out a good way to do it.

Hope I have been clear

Best

Yves

1 Like

Try after you save the data, set msg.payload to "" (blank) and send that to the input of the ui_text node.
You might want to add a switch on the output of the ui_text node to ignore msgs with a blank payload

Very good idea, I'll give a try and post the result.

Thanks a lot ,

Yves

Hi,

The solution works well by sending and empty msg.payload once the data are saved.

thanks a lot

Yves

Hello Sir, could you please send your flow? I also want to do the same thing. I made a form which contains drop downs and text inputs.And after clicking save button i want all the fields to be cleared. I am using the change node to store the data after the button click.
Thanks,
Vishakha

Show me your flow and I see what you have tried

1 Like

Also asked here Clear the previous Inputs on ui

GenFirmware.json (73.1 KB)

There’s no point having two threads for the same issue, it just wastes people’s time

@Vishakha - since you have two threads going, I will be ignoring anything else in this thread.

Okay sir! no problem. I am new to node red i apologize.