Databinding CMS Lists to Form Dropdown Selects - hiding variables not set

Hi guys!

I just created a form where I connected my CMS to a dropdown input selector. I did it using this amazing json query created by Sygnal Technology

(github link to tutorial: GitHub - sygnaltech/webflow-util: WebFlow Utilities).

I added the above library to my before body tag,
I added the code below within a hidden code block in the form to be able to pick the specified fields with the selector
<script type="application/json" data="mydatasource">
{
"id": "slug1",
"text": "name1"
}
</script>
<script type="application/json" data="mydatasource">
{
"id": "slug2",
"text": "name2"
}
</script>

My question is: how can I modify the code above so that if the variable “name2” is not set, the selector will just not pick the field (or hiding it in the selector), instead of picking up an empty space?

Thanks!

Resolved!
<style>#email-form option:empty{display:none}</style>