How to hide popups when there is no data

WARNING: Please note that this help doc uses an older version of our Projection map template. If you are using version 13.0.0 or newer of the template, the visualization will automatically disable popups for regions with no data.

To hide popups for regions that don't have any data associated with them,

In the Preview tab, Go to the Popups & panels settings and select Custom
Update the Popup custom header and the Popup custom main content with the content you would like to display. You can use curly brackets ({{}}) to pull through information from a column.

Head over to the  Data tab and remove the data in the columns corresponding with the  Name binding of the popups that don't have any data

Your popups should now no longer display for those regions that don't have corresponding data.
If you're using more custom content than just the name and the value, for example some text before or after a value, that will currently still display. We will look at hiding that next.

To hide all custom content where there is no data, you can use if statements. These should look something like this:
{{#if Alcohol consumption (in litres)}}{{Formal name}} drinks {{Alcohol consumption (in litres)}} litres{{/if}}
To create a similar if statement, simply wrap your custom content in curly brackets starting with {{#if}} and ending with {{/if}}. Then, in the opening brackets, type the name of the column that needs to contain content in order to display something in the popup.
You can even create advanced {{#if}} structures by chaining multiple statements that relate to different columns next to each other. This allows you to create conditional content along the lines of "If this has a value, put this… If it has something in another column, put this…", and so on.