I have a main table (table_data) that pulls in scraped emails for my team to review. Each email has a "message_id" associated with it.
I want my secondary table (table_approver) to pull in just the rows that have a matching "message_id" from the selected row.
Each "message_id" has roughly 5-10 rows associated with it, so if I click on one row in table_data the expected behavior for table_approver is that it will add 5-10 rows that have the same message_id.
Does that make sense? Here are other details:
*Both tables are using a Google sheet as their source data
*I've got the below Javascript transformer firing when a user selects a row
*It returns an error and success at the same time
try {
const selectedRow = test_table_a.selectedRow;
if (selectedRow) {
const messageId = selectedRow.data.message_id;
console.log('Selected Message ID:', messageId);
// Filter test_table_b data to find all rows with matching message_id
const filteredData = test_table_b.data.filter(row => row.message_id === messageId);
console.log('Filtered Data for test_table_b:', filteredData);
// Wait for setData() to complete before logging
await test_table_b.setData(filteredData);
console.log('test_table_b Data after setData:', test_table_b.data);
} else {
console.error('No row is selected in test_table_a.');
}
} catch (error) {
console.error('Error:', error);
}
At a loss for what to do next.