You could also use $hfind
return $iif($hfind(tablename,item,0),$true,$false)
That is a simple example. The $hfind identifier can handle much more complex searches, including, but not limited to, wildcard, regex, and data.
See /help $hfind for more information.