Retrieving variables from payload object

In a function, you need to be explicit - include msg.

e.g. msg.payload.x.y.x