Creating an entry form by fetching inputs from CSV file and saving in another CSV file

Hello! I’m trying to create an entry form where

  1. I select a value in “work center” field which is fetched from a CSV file
  2. After selecting, applies a filter on the same CSV file to show the rows with selected work center and shows it in a table node.
  3. Then feeding the filtered order no. in "Order no" field and selecting it
  4. After filling all fields and clicking submit button, all the selected fields are stored in another CSV file which then shown in another table as an entry confirmation.
    Can anyone help or direct me to a solution.
    Below is the flow:
[{"id":"87ac3b01.909018","type":"tab","label":"Breakdown","disabled":false,"info":""},{"id":"e642510e.a315f","type":"ui_text","z":"87ac3b01.909018","group":"f9e41b13.1fe7a8","order":1,"width":6,"height":1,"name":"","label":"Posting Date  :","format":"{{myymd}}","layout":"row-left","x":820,"y":160,"wires":[]},{"id":"aeae155f.451868","type":"simpletime","z":"87ac3b01.909018","name":"","mydate":true,"myymd":true,"myyear":true,"mymonth":true,"mymonthn":true,"mydom":true,"mydoy":true,"myday":true,"myhourpm":true,"myhour":true,"mytime":true,"mytimes":true,"myminute":true,"myminutes":true,"mysecond":true,"mymillis":true,"myepoch":true,"myrawdate":true,"mypm":true,"x":630,"y":160,"wires":[["e642510e.a315f"]]},{"id":"1096e6ce.85eff9","type":"inject","z":"87ac3b01.909018","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":460,"y":160,"wires":[["aeae155f.451868"]]},{"id":"2ddf0d85.ea1dc2","type":"ui_dropdown","z":"87ac3b01.909018","name":"","label":"Shift","tooltip":"","place":"Select shift","group":"f9e41b13.1fe7a8","order":10,"width":3,"height":1,"passthru":true,"multiple":false,"options":[{"label":"A","value":"A","type":"str"},{"label":"B","value":"B","type":"str"}],"payload":"","topic":"topic","topicType":"msg","x":410,"y":540,"wires":[[]]},{"id":"1635f63b.70501a","type":"inject","z":"87ac3b01.909018","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":440,"y":320,"wires":[["b3f182dc.95637"]]},{"id":"b3f182dc.95637","type":"file in","z":"87ac3b01.909018","name":"","filename":"C:\\Users\\Sahil\\Desktop\\testing\\mt02order.csv","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":710,"y":320,"wires":[["22f4750f.3db1ca"]]},{"id":"22f4750f.3db1ca","type":"csv","z":"87ac3b01.909018","name":"","sep":",","hdrin":true,"hdrout":"all","multi":"mult","ret":"\\r\\n","temp":"","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":950,"y":320,"wires":[["f2a68631.770ad8","264cd440.e8690c","ea66fdd4.ce5d5"]]},{"id":"c8e65eb3.fedd7","type":"debug","z":"87ac3b01.909018","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1510,"y":280,"wires":[]},{"id":"f2a68631.770ad8","type":"function","z":"87ac3b01.909018","name":"transform data","func":"//as per info panel, the data needs to be formatted\n//as [ \"Choice 1\", \"Choice 2\", {\"Choice 3\":\"3\"} ]\n//and sent in msg.options.\nmsg.options = [];//create empty array\nfor(let i = 0; i < msg.payload.length; i++){\n    let row = msg.payload[i]; //get the row\n    let opt = {};//make new opt object\n    opt[row.Work_Center] = row.Work_Center; \n    msg.options.push(opt);//add the opt to array    \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1140,"y":320,"wires":[["f4ed0b9d.66aef8"]]},{"id":"f4ed0b9d.66aef8","type":"ui_dropdown","z":"87ac3b01.909018","name":"","label":"Work center","tooltip":"","place":"Select Machine","group":"f9e41b13.1fe7a8","order":3,"width":6,"height":1,"passthru":false,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"machinecode","topicType":"msg","x":1330,"y":320,"wires":[["c8e65eb3.fedd7","3832c97b.fd3ba6","1c233064.2dd4b"]]},{"id":"264cd440.e8690c","type":"function","z":"87ac3b01.909018","name":"Make lookup","func":"var data = msg.payload;\nvar map = {};\nfor (let index = 0; index < data.length; index++) {\n    const element = data[index];\n    map[element.Work_Center] = element.Order_No;\n}\nmsg.payload = map;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1130,"y":360,"wires":[["2cfb19fd.8863d6","a9532548.208828"]]},{"id":"2cfb19fd.8863d6","type":"debug","z":"87ac3b01.909018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1330,"y":420,"wires":[]},{"id":"a9532548.208828","type":"change","z":"87ac3b01.909018","name":"","rules":[{"t":"set","p":"partLookup","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":380,"wires":[[]]},{"id":"3832c97b.fd3ba6","type":"change","z":"87ac3b01.909018","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"partLookup[msg.payload]","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1520,"y":320,"wires":[["494e47b1.167818","d3a6f345.e0e35","d39c6c93.158dd"]]},{"id":"494e47b1.167818","type":"debug","z":"87ac3b01.909018","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"msg","x":1710,"y":320,"wires":[]},{"id":"d3a6f345.e0e35","type":"ui_dropdown","z":"87ac3b01.909018","name":"","label":"Order No.","tooltip":"","place":"Select","group":"f9e41b13.1fe7a8","order":4,"width":6,"height":1,"passthru":false,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"machinecode","topicType":"msg","x":1720,"y":360,"wires":[[]]},{"id":"d39c6c93.158dd","type":"ui_text","z":"87ac3b01.909018","group":"f9e41b13.1fe7a8","order":5,"width":4,"height":1,"name":"","label":"Order No.","format":"{{msg.payload}}","layout":"row-spread","x":1720,"y":400,"wires":[]},{"id":"ea66fdd4.ce5d5","type":"ui_table","z":"87ac3b01.909018","group":"f9e41b13.1fe7a8","name":"","order":7,"width":28,"height":3,"columns":[],"outputs":0,"cts":false,"x":1110,"y":280,"wires":[]},{"id":"f24d7e50.20701","type":"ui_text_input","z":"87ac3b01.909018","name":"Start Time","label":"Start Time","tooltip":"Start Time","group":"f9e41b13.1fe7a8","order":12,"width":3,"height":1,"passthru":false,"mode":"time","delay":300,"topic":"Start Time","topicType":"str","x":920,"y":540,"wires":[["d0bf4f47.05a94"]]},{"id":"d7e88a39.a6de98","type":"ui_date_picker","z":"87ac3b01.909018","name":"","label":"Start date","group":"f9e41b13.1fe7a8","order":11,"width":5,"height":1,"passthru":false,"topic":"Start date","topicType":"str","x":580,"y":540,"wires":[["b1955da5.c99f6"]]},{"id":"a169e909.f6b518","type":"ui_date_picker","z":"87ac3b01.909018","name":"","label":"End date","group":"f9e41b13.1fe7a8","order":17,"width":5,"height":1,"passthru":false,"topic":"End date","topicType":"str","x":580,"y":580,"wires":[["f089f523.5724c8"]]},{"id":"c2411f69.be4d4","type":"ui_text_input","z":"87ac3b01.909018","name":"End Time","label":"End Time","tooltip":"End Time","group":"f9e41b13.1fe7a8","order":18,"width":3,"height":1,"passthru":true,"mode":"time","delay":300,"topic":"End Time","topicType":"str","x":920,"y":580,"wires":[["99726772.f027f8"]]},{"id":"b1955da5.c99f6","type":"change","z":"87ac3b01.909018","name":"dd-mm-yyyy","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(payload).tz(\"Europe/London\").format(\"DD-MM-YYYY\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":540,"wires":[["1c233064.2dd4b"]]},{"id":"d0bf4f47.05a94","type":"change","z":"87ac3b01.909018","name":"hh:mm","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(payload).tz(\"Europe/London\").format(\"HH:mm\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":540,"wires":[["1c233064.2dd4b"]]},{"id":"f089f523.5724c8","type":"change","z":"87ac3b01.909018","name":"dd-mm-yyyy","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(payload).tz(\"Europe/London\").format(\"DD-MM-YYYY\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":580,"wires":[["1c233064.2dd4b"]]},{"id":"99726772.f027f8","type":"change","z":"87ac3b01.909018","name":"hh:mm","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(payload).tz(\"Europe/London\").format(\"HH:mm\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":580,"wires":[["1c233064.2dd4b"]]},{"id":"c971cce5.88a9c","type":"ui_dropdown","z":"87ac3b01.909018","name":"Breakdown reasons","label":"Breakdown reason","tooltip":"Breakdown reason","place":"Select Breakdown reason","group":"f9e41b13.1fe7a8","order":14,"width":9,"height":2,"passthru":false,"multiple":true,"options":[{"label":"Breakdown reason 1","value":"Reason 1","type":"str"},{"label":"Breakdown reason 2","value":"Reason 2","type":"str"},{"label":"Breakdown reason 3","value":"Reason 3","type":"str"},{"label":"Breakdown reason 4","value":"Reason 4","type":"str"}],"payload":"","topic":"Breakdown reason","topicType":"str","x":930,"y":640,"wires":[["1c233064.2dd4b"]]},{"id":"2d869a98.7e0f16","type":"ui_button","z":"87ac3b01.909018","name":"","group":"f9e41b13.1fe7a8","order":21,"width":4,"height":1,"passthru":false,"label":"Submit","tooltip":"","color":"","bgcolor":"","icon":"","payload":"complete","payloadType":"str","topic":"","topicType":"str","x":1010,"y":760,"wires":[["16c6115f.e5bcbf","ba495f3d.bc474"]]},{"id":"1632493f.a4d6a7","type":"ui_text","z":"87ac3b01.909018","group":"f9e41b13.1fe7a8","order":13,"width":3,"height":2,"name":"","label":"Breakdown time (in hours)","format":"<font size=5>{{msg.payload}}","layout":"col-center","x":950,"y":680,"wires":[]},{"id":"e2741ebc.977cc","type":"inject","z":"87ac3b01.909018","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"num","x":710,"y":740,"wires":[["1632493f.a4d6a7"]]},{"id":"179bd0b8.89044f","type":"ui_table","z":"87ac3b01.909018","group":"f9e41b13.1fe7a8","name":"","order":23,"width":28,"height":2,"columns":[],"outputs":0,"cts":false,"x":1570,"y":940,"wires":[]},{"id":"1c233064.2dd4b","type":"join","z":"87ac3b01.909018","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1670,"y":600,"wires":[["5521cf97.4e1f3"]]},{"id":"41e4ff59.840ee","type":"link in","z":"87ac3b01.909018","name":"","links":["9dc0d65b.64a128"],"x":195,"y":760,"wires":[["2ddf0d85.ea1dc2","91f54c58.30a4f","f24d7e50.20701","c2411f69.be4d4","f4ed0b9d.66aef8","c971cce5.88a9c"]]},{"id":"9dc0d65b.64a128","type":"link out","z":"87ac3b01.909018","name":"","links":["41e4ff59.840ee"],"x":1595,"y":840,"wires":[]},{"id":"16c6115f.e5bcbf","type":"change","z":"87ac3b01.909018","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"complete","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":740,"wires":[["1c233064.2dd4b"]]},{"id":"ba495f3d.bc474","type":"change","z":"87ac3b01.909018","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1260,"y":780,"wires":[["9786f876.7c39f8"]]},{"id":"9786f876.7c39f8","type":"delay","z":"87ac3b01.909018","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1440,"y":780,"wires":[["9dc0d65b.64a128","179bd0b8.89044f"]]},{"id":"91f54c58.30a4f","type":"change","z":"87ac3b01.909018","name":"timestamp","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":440,"wires":[["d7e88a39.a6de98","a169e909.f6b518"]]},{"id":"5521cf97.4e1f3","type":"file","z":"87ac3b01.909018","name":"","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":1850,"y":580,"wires":[[]]},{"id":"1959427e.99693e","type":"file in","z":"87ac3b01.909018","name":"","filename":"C:\\Users\\Sahil\\Desktop\\testing\\breakdown.csv","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":1160,"y":940,"wires":[["d46547e6.219768"]]},{"id":"262688ac.5398c8","type":"inject","z":"87ac3b01.909018","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":840,"y":940,"wires":[["1959427e.99693e"]]},{"id":"d46547e6.219768","type":"csv","z":"87ac3b01.909018","name":"","sep":",","hdrin":true,"hdrout":"all","multi":"mult","ret":"\\r\\n","temp":"","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":1430,"y":940,"wires":[["179bd0b8.89044f"]]},{"id":"f9e41b13.1fe7a8","type":"ui_group","name":"Group 1","tab":"74fd02f9.b99b3c","order":1,"disp":false,"width":28,"collapse":false},{"id":"74fd02f9.b99b3c","type":"ui_tab","name":"Breakdown entry form","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Screenshot

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