Changed method for checking field existence in object

The current method would leave out fields that were empty. In my case I had a field called description and if it were empty, it would not be part of the output.