Display Repeater only when data is available

My page is designed in a way that once user submits the form, a thank you message is displayed with a repeater showing the data entered by the user as confirmation.

Say, if my dataset has 30 columns, I show 3 repeaters with 10 column values on each.

There are chances that user might just fill the form with first 10 column values and after submit my other two repeater shows empty values.

I dont want to show the repeater if there are no values returning from dataset that has just been saved. Is there a way I can check the data value and mark repeater.show() or .hide() accordingly.

Here is my current code

function getData() {
let query = wixData.query(“Students”);
return query.limit(1).find().then(results => {
return results.items;
});
}
$w(“#Studentwrite”).onAfterSave(() => {
getData().then((items) => {
$w(“#repeater1”).data = items;
$w(“#repeater2”).data = items;
$w(“#repeater3”).data = items;
});
$w(“#repeater1”).show();
$w(“#repeater2”).show();
$w(“#repeater3”).show();

In the last 3 lines is where I need help in adding a code to determine if the column value is present or not.

Hi,

my warm recommendation for you is to split the data into 3 different collections, connect them by reference.

30 columns is just an arbitrary number, can grow in the future right?! so it will make more sense splitting it into domains/sections in the different collections. it will resolve your challenge by design.

this is question however is more around Coding design then Wix API specifically, so we will not be able to help you very much in the context of this forum. you can if needed get the help of a professional in the Wix-Arena

good luck!
Shlomi