Function node with 2 different outputs

hi all
i am interfacing dht sensor with arduino and getting serial data on raspberry pi through node red now i want to create only 1 function to differentiate between temperature and humidity
Now i need the js of function node to to deploy

please help i really need it

Can you publish what you've got so far?

Add a debug node to the serial Node so you can see what you are sending.

If you have been clever then there is a character between the two values that you know. Splitting on a character in a javascript function is easy and a quick google will lead to lots of tutorials for how to do it.

here is my flow

msg.payload gives temperature and msg.humidity gives humidity

so your screenshot shows a red triangle :small_red_triangle: on the serial node which means it’s not configured correctly.

Add a debug to the serial node so you can see what it is sending when configured.
Without seeing what the message is, and what your function is it is difficult to suggest anything else

Taking another look, if you mean you don't know how to send some to output1 and something else to output 2 , the docs have an example https://nodered.org/docs/writing-functions#multiple-outputs

Isn’t the “switch” and “change” nodes enough for your application?