Added checking if the datasetid is empty

Reviewer: Tiff Go

Issue: GCP-9919