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,

1
In the Preview tab, Go to the Popups & panels settings and select Custom
2
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.

3
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

4
Your popups should now no longer display for those regions that don't have corresponding data.
5
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.

6
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.
7
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.