Using selected value from list for dynamin sql query

I have a table that I am using a query to get the data. I want to be able to use WHERE with the value coming from a list. I am very new at this and would appreciate any help. Thanks.

SELECT schedBatch,orderNo,lineNo,seqNo,cartBin,itemNo,description,length,cutQty,totQty,completed
FROM tigerData
WHERE schedBatch = {Root}[{Root Container.List.selectedIndex}, 0]

Within a SQL query you can only use string substitution with braces, not the full expression syntax. So the subscripts with brackets aren’t understood. You’ll have to use a custom property that executes the expression you want, resulting in a string. Then use that property in the SQL.

Thank you that worked