Hide individual row that contains a null value in field

I’ve been searching for a solution for this issue for the past 6 hours.

I have a table setup to call data from a collection, one of which is concatenated data that is parsed from a data hook: ‘${firstNameThen}’ ‘${lastNameThen}’ → ‘${firstLastNameThen}’.

When a user registers for an account, they are requested to setup their profile, but sometimes they navigate to the site registry to view all users. When they first register, if their email is not contained within the main DB, an entry is created for them, inserting their email and creating ‘_id’. By this method, the entry is created and the table on the main user index search page displays “undefined undefined” (first and last name") if they have not setup their profile completely.

I’m attempting to hide() or collapse() this row if the value ‘null’, ‘0’ or ‘undefined’ registers. I’ve followed every walk-through on this forum that I have searched for, but mostly pertain to repeaters and elements. Since this is a table and I need to collapse or hide a row, I’ve yet to find anything remotely useful. Any assistance is GREATLY appreciated :smiley:

Hi,
You can use setFilter method:
Try to combine this code:

$w.onReady(() => {
	$w('#yourDataSet').onReady(() => {
		$w('#yourDataSet').setFilter(wixData.filter()
			.isNotEmpty('field1')
			.isNotEmpty('field2')
		)
	});
});

For more information:

Good luck!
Roi.

Good afternoon Roi! I tried with the .isNotEmpty function, which works for non-empty cells, however during the concatenation of two fields, when the data hook reads the values and they’re empty, ‘undefined undefined’ (firstNameThen and lastNameThen values) show up. Thus, .isNotEmpty would not apply.

I’ve attempted declaring .not('FirstLastNameThen: ‘undefined undefined’), .contains and an IF conditional with .hide() flags, but nothing seems to work. Even thought about declaring a function on both values that are merged, but then I remembered that what is showing up on the page is the queried result of the data hook afterQuery, so that was an illogical resolution.

$w.onReady(() => {
$w(‘#dynamicDataset’).onReady(() => {
$w(‘#dynamicDataset’).setFilter(wixData.filter()
.not(‘FirstLastNameThen’: ‘undefined undefined’)
)
});
});

Any further suggestions?

@drumchakra08
Hello sir …
I’m facing the same problem…did you get the answer? If so, please let me know the answer…
Have a good day