JCR query

I have an automated slot that display the articles in a particular locale

query
select rx:sys_contentid from rx:rfhArticles where jcr:path like ‘//Sites/RFH2%’ and rx:sys_lang = :thelocale ORDER BY rx:sys_contentstartdate desc

Binding in the template
$params.thelocale=$sys.item.getProperty(“sys_lang”)

Slot
#slot(“rfhArticlesSlot” '" “” “” $params)

I get the following error
Problem assembling output for item: 2-101-712 with template: rfhPgArticles exception: Cannot represent class com.percussion.utils.jsr170.PSProperty as a value see log for stack trace

I know there is something wrong with rx:sys_lang = :thelocale in the JCR query but I dont know how to fix it.

Thanks
Pallavi

Did you try to get the string value of the property?

$params.thelocale=$sys.item.getProperty("sys_lang").String