Please help me to resolve this issue, that would be a great support of yours to me !!!
var grad=msg.payload
if (grad>85)
{
msg.grade="S";
}
else if (grad<=85 && grad>80)
{
msg.grade="A";
}
You are putting the value in msg.grade not msg.payload. Add a debug node showing the output and set it to Show Complete Message and you will see what is there. Also I suggest watching the videos 'node red essentials' which will save you a lot of time. Also read the the docs Working With Messages and the one on Writing Functions.