I can't see how you get that from msg.payload = {deviceId:{"noData":true"}}
I think I am missing something about what you are doing.
Explain again exactly what you are trying to get in the payload, with an example.
Ah, I think I see a bit of what you are trying to do, if you want msg.payload={"21f400":{"noData":True}}
where you already have something like deviceID = "21f400"
Then you can say