Trying to make a if function work

Hi @niceguy45 welcome to the forum!

Well assuming that both msg.id & msg.payload arrive at the same time, then your code works for me. See -

[{"id":"157eccae.ee3a93","type":"inject","z":"c53060.842a0fa","name":"","props":[{"p":"payload"},{"p":"id","v":"222","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":140,"y":1350,"wires":[["3b61ed35.e45e42"]]},{"id":"b490915a.67398","type":"debug","z":"c53060.842a0fa","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":540,"y":1350,"wires":[]},{"id":"3b61ed35.e45e42","type":"function","z":"c53060.842a0fa","name":"","func":"msg.test=\"OK\";\nif ( (msg.id == 222 && msg.payload == true) || ( msg.id == 220 && msg.payload == true) ){\nreturn msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":1350,"wires":[["b490915a.67398"]]},{"id":"7b65e10f.83712","type":"inject","z":"c53060.842a0fa","name":"","props":[{"p":"payload"},{"p":"id","v":"222","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":140,"y":1400,"wires":[["3b61ed35.e45e42"]]}]

PS - if you share any code or flows, please see this post which describes how to post it (as the forum software changes it!)