Hide a map with no address

Hi everyone. I have tried various discussion threads to try and resolve this but with no luck. I have a dynamic page with 3 possible addresses for a member, Location 1, Location 2 or Location 3. Some members will have one address, some two or three. I would like to hide or show a map based on whether an address exists, eg: there is any text written in the address field (please see image1). As you can see from image1, I would not like to display the maps for Location 2 or Location 3.


My dataset is called = dynamicDataset
My locations are via an address field and are called = Address1, Address2, Address3
The maps are called = googlemaps1, googlemaps2, googlemaps3

I am new to coding (even though I have tried my best and amended a few examples on this community), so please be gentle!
Thanks for any help.

Maybe this would help

$w.onReady(function () {
    $w('#dynamicDataset').onReady(() => {
        const item = $w('#dynamicDataset').getCurrentItem();
        if (!item.columnnameofaddress1) {
            $w('#Address1').collapse();
            $w('#googlemaps1').collapse();
            // this console.log is used for checking if the code is working
            console.log("address1 is empty");
        }
        if (!item.columnnameofaddress2) {
            $w('#Address2').collapse();
            $w('#googlemaps2').collapse();
            // this console.log is used for checking if the code is working
            console.log("address2 is empty");
        }
        if (!item.columnnameofaddress3) {
            $w('#Address3').collapse();
            $w('#googlemaps3').collapse();
            // this console.log is used for checking if the code is working
            console.log("address3 is empty");
        }
    })
});