Hi @yisrael-wix ,
I have a data collection called “PublicProfileManagement” and it has fields outlined in the below code that I wish to link to the page Elements within the code, some of these elements are within Boxes and I would like these to collapse if there is nothing selected from the data collection within them. I have attempted to complete the code but would welcome some guidance on how to achieve this any help or support always greatly welcomed:
wixData.query(“PublicProfileManagement”)
.isNotEmpty(“prefix”, “firstName”, “middleName”, “surname”, “nationality”, “age”, “email”, “mobileNumber”, “firstLine”, “postcode”, “telephone”,“nino”, “cv”, “otac”, “password”,
“attachedDocs1”, “attachedDocs2”, “GovernemtnId”, “proofOfAddress”, “proofOfService”, “relatedPersons”, “facebook”, “twitter”, “instagram”, “socialLink1”, “socialLink2”, “profileImage”)
.find()
.then( (results) => {
if (results.items.length > 0) {
let query = results.query;
if ( $w(“#groupTitle”).expand(),
$w(“#groupFirstName”).expand(),
$w(“#groupMiddleName”).expand(),
$w(“#groupSurname”).expand() )
$w("#box8").expand();
}
else {
$w(“#box8”).collapse();
}
if ( $w(“#groupNationality”).expand(),
$w(“#groupAge”).expand(),
$w(“#groupEmail”).expand(),
$w(“#groupMobile”).expand() ) {
$w("#box9").expand();
}
else {
$w(“#box9”).collapse();
}
if ($w(“#groupFirstLine”).expand(),
$w(“#groupPostcode”).expand(),
$w(“#groupTelephone”).expand(),
$w(“#groupNino”).expand() ) {
$w("#box10").expand();
}
else {
$w(“#box10”).collapse();
}
if ($w(“#buttonCV”).expand(),
$w(“#buttonAtt1”).expand(),
$w(“#buttonAtt2”).expand() ){
$w("#box4").expand();
}
else {
$w(“#box4”).collapse();
}
if ($w(“#buttonGovernmentID”).expand(),
$w(“#buttonPOA”).expand(),
$w(“#buttonPOS”).expand() ){
$w("#box5").expand();
}
else {
$w(“#box5”).collapse();
}
if ($w(“#buttonRelated”).expand() ){
$w("#box6").expand();
}
else {
$w(“#box6”).collapse();
}
if ($w(“#buttonFacebook”).expand(),
$w(“#buttonTwitter”).expand(),
$w(“#buttonInsta”).expand(),
$w(“#buttonSocialLink1”).expand(),
$w(“#buttonSocialLink2”).expand() ){
$w("#box7").expand();
}
else {
$w(“#box7”).collapse();
}
} )
. catch ( (err) => {
let errorMsg = err;
} );
});