The boolean trick works but as you can see there is still a lot of repetitive code in your example.
A simple function (e.g. getProp(obj,property) )will be able to either return the property value or "", and of course you can expand this into something similar to https://www.npmjs.com/package/jsonpath