just the modified data should go to the response. the file should be the original request, with the response
Please supply examples as asked for, so there is no ambiguity.
When you send data:0 to the in node
what object should the response get, and what object should the file get.
eg
file
{
"data":0,
"body":{
"sourceSummary":1,
"errorNumbers":"errorNumbers",
"missingNumbers":"missingNumbers"
}
}
Response
{
"data":1
}
Then it is clear to all
[edit]
I think you would do better with to oupts also
e.g.
[{"id":"fa6e50458ab28f21","type":"http in","z":"667cec54c048503c","name":"","url":"/t","method":"post","upload":true,"swaggerDoc":"","x":510,"y":1880,"wires":[["ba1ab5782646f971"]]},{"id":"ba1ab5782646f971","type":"function","z":"667cec54c048503c","name":"store todo in todolist ","func":"let msgfile = {payload: RED.util.cloneMessage(msg.payload)}; // clone payload so no referencing and no res, req object\n\nlet something = {};\nsomething.data = msg.payload.data + 1\n\n// update file object\nmsgfile.payload.body = {\n sourceSummary: something.data,\n errorNumbers: \"errorNumbers\",\n missingNumbers: \"missingNumbers\"\n};\nmsg.payload.data = something.data; // set response payload to ne figure\n\nreturn [msg, msgfile]; //return the two objects to separte outputs","outputs":2,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":1880,"wires":[["4a02c0966170e3fc","79597d782ee66032"],["76545b5b7e680c59"]]},{"id":"4a02c0966170e3fc","type":"http response","z":"667cec54c048503c","name":"","statusCode":"201","headers":{},"x":920,"y":1860,"wires":[]},{"id":"79597d782ee66032","type":"debug","z":"667cec54c048503c","name":"res","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":890,"y":1800,"wires":[]},{"id":"76545b5b7e680c59","type":"debug","z":"667cec54c048503c","name":"file","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":1920,"wires":[]}]
Wow I sure feel stupid. I was a sleep bit deprived and my mind was thinking you get something in and you get something out and I wanted to end on the thing I wanted out. That got me fixed thanks for the help.