Its because you are defining both variables as objects which have the value under a key called payload within in them. If you actually want to assign the value from the wanted message property directly to the variable in a way that can be used in string concatenation you would just have to do something like this: