Have written some code here to determine in lists and tables if records are connected to the logged in user or not. At the moment in knack we can filter lists and tables but only for records connected to the logged in user. Because this can detect anything also not connected to the user we can filter the users records from a list or table. In knack you need to have the account filed displayed or this won’t work **
It’s recommended if you remove anything from view, use javascript to remove from the DOM instead of hiding with CSS.
I’ve added classes for CSS as well, you may want to style items connected/not connected differently also.
Non connecting records use: .not-loggged-in-user-record
For connected records use: .logged-in-user-record
$(document).on('knack-view-render.any', function(event, page) {
const user = Knack.getUserAttributes().name;
$('.kn-list-item-container, .kn-table tr').each(function() {
var $theListOrTableItem = $(this);
if ($theListOrTableItem.text().indexOf(user) >= 0) {
$theListOrTableItem.addClass('logged-in-user-record')
// here you can remove items
$($theListOrTableItem).remove();
} else {
$theListOrTableItem.addClass('not-loggged-in-user-record')
// here you can remove items
}
});
});