How can I check if a dataset field is empty?

Fields that are empty usually have falsy values. So you can set an if statement to exclude the value if it is either undefined or ‘’.