Using SelectedRows in a where clause

I am trying to have a table that shows its content based on the multi-selections of a parent table.
The parent table currently has 1 column, but theoretically could have more.
The query is basically as follows:
Select * from SQLTableName where filtercolumn = ANY ( ?)
or
Select * from SQLTableName where filtercolumn IN ( ?)

To see the selected rows I believe I need to use {{table.selectedRows}} but I cannot work out the rest to resolve down to an array of values that can be used. Effectively I want to get all the values from the first key-value pair. If I was looking for just the selected row (not multiple), the equivalent would be table.selectedRow.column_name

There's a post that points to the SQL cheatsheet but I cannot see the answer there. It tells me I want this format:
SELECT
*
FROM
users
WHERE
id = ANY({{ [1, 2, 3] }})

but not how to use table.selectedRows to get there.

Appreciate the help...!

1 Like

Hello, you can achieve that like this:
image
image
Animation

table on the right side is populated by query1
table on left side is populated by query2

query1

select * from table2 order by id

query2

select *
from table1
where fk_id = ANY({{ table1.selectedRowKeys }})
order by id

image
image

2 Likes

if you have a primary key you can do it, is not necessary an ID like a number or so

1 Like

Ah, gotcha. That's perfect. Really appreciate the help.

3 Likes