Using the ui datepicker node I can't figure out how to clear it. I dont want the last date to send if its not needed. send a null msg doesn't work.
Any help would be much appreciated.
Using the ui datepicker node I can't figure out how to clear it. I dont want the last date to send if its not needed. send a null msg doesn't work.
Any help would be much appreciated.
One easy way is to use the simple gate node to block the date picker node output if you don't want the date picker node to send out anything.
The gate can be turned on/off easily with your command. The gate node can be paired with a dashboard ui button or ui switch node.
I do want the date to send data though but only when its needed. Id rather not have data just left in the fields that's how error happen because I'm not the only one using it
You can simply open the gate, then the data will go out.
You close the gate, then no data go out.
Where does the error come from?
Not sure it's possible to blank it.
You could set the date to a past date, then check the new picked date is greater than the past date.
But would probably be best after picking a date have a confirmation button appear that has to be pressed to confirm date
[edit]here is a simple example of a confirmation button
[{"id":"95be97ed.eb2","type":"ui_date_picker","z":"b779de97.b1b46","name":"","label":"date","group":"8b5cde76.edd58","order":9,"width":"6","height":"1","passthru":false,"topic":"topic","topicType":"msg","x":150,"y":4880,"wires":[["d03fa4c3.a2565"]]},{"id":"d03fa4c3.a2565","type":"change","z":"b779de97.b1b46","name":"","rules":[{"t":"set","p":"enabled","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"background","pt":"msg","to":"blue","tot":"str"},{"t":"move","p":"payload","pt":"msg","to":"timestamp","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":4880,"wires":[["cdcf2db9.c50ad"]]},{"id":"cdcf2db9.c50ad","type":"ui_button","z":"b779de97.b1b46","name":"","group":"8b5cde76.edd58","order":10,"width":"6","height":"1","passthru":false,"label":"Confirm date {{msg.payload | date : \"dd/MM/yyyy\"}}","tooltip":"","color":"","bgcolor":"{{background}}","icon":"","payload":"1","payloadType":"str","topic":"timestamp","topicType":"msg","x":520,"y":4880,"wires":[["c8cfd38c.cf25a8"]]},{"id":"c8cfd38c.cf25a8","type":"change","z":"b779de97.b1b46","name":"","rules":[{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"},{"t":"move","p":"topic","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"background","pt":"msg","to":"white","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":4880,"wires":[["cdcf2db9.c50ad","12e6d20e.e33c6e"]]},{"id":"f0f4c69.855abb8","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"enabled","v":"false","vt":"bool"},{"p":"background","v":"white","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":210,"y":4820,"wires":[["cdcf2db9.c50ad"]]},{"id":"12e6d20e.e33c6e","type":"debug","z":"b779de97.b1b46","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":4960,"wires":[]},{"id":"8b5cde76.edd58","type":"ui_group","name":"","tab":"8f03e639.85956","order":1,"disp":true,"width":"12","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
[edit] corrected the payload being over wrtten by the button node
@dceejay why can we not set a msg to the button payload?
Dealing with a database. Wrong date could cause errors with receiving shipment.
The gate will discard the data when you close the gate.
Unless you write the flow wrong, there is no reason to cause errors with the gate node.
Try it out and share your flows if you run into problems, so that we can help you more
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.