Problem with MQTT - How to configure the item?

Use a JAVASCRIPT transform instead of the JSON transform:

See:

In the script you can check if uid exists before forwarding the info