SQL query for a dynamic WHERE clause

I have a table in vision which I brought by a named query. The table has multiple columns.
One of them is ‘user_id’ which is unique for every row in that column.
I want to get the user_id from a any particular row when I select it and use it in a WHERE clause.

I am writing this script on a button click.

How can I proceed?

Add a custom property to your table with the same datatype as the user_id column, named user_id, perhaps. Use an expression binding on that property like so:

try({Root Container.Table.data}[{Root Container.Table.selectedRow},'user_id'], -1)

Replace the -1 with whatever value you wish to have when no row is selected. (There would be an error from an invalid row when there’s no selection that is captured by the try() function.)

1 Like