Bind the table to a second list that holds only the active items, and keep the full list untouched in its own variable. Filter once when the coach loads and re-filter when the data changes:
// CSHS: variables tw.local.liabilities (all), tw.local.activeLiabilities (shown)
// client-side script task before the coach, or the coach's "load" event:
tw.local.activeLiabilities = tw.local.liabilities.filter(function (l) { return l.status === "ACTIVE"; });
// (in a coach view / control event use the control API)
${ActiveTable}.setData( ${AllHidden}.getData().filter(function (l) { return l.status === "ACTIVE"; }) );When the user edits a row of the active list the edit lands on the same objects (the filter copies references, not values, in the browser), so the full list keeps the change - but only until a server round trip re-serialises the data. If the coach submits, merge back explicitly:
// before submit: write the edited active items back into the full list by id
var full = tw.local.liabilities, act = tw.local.activeLiabilities;
act.forEach(function (a) { for (var i = 0; i < full.length; i++) if (full[i].id === a.id) full[i] = a; });Alternative without a second variable: the UI Toolkit table supports a filter (search box) and, on newer toolkits, a Row filter formula (${Table}.setFilter(...) / "Filter" option) that hides rows without removing them from the bound list. That keeps one variable and no merge, at the price of the full list being sent to the browser.
References