the select statement will take a second optional parameter, which will make it so that it always returns the results to an array. This means that if something is selected, the length of the array will be greater than 0, otherwise it will be 0. Then you can use this to do what you want to do.
Sample code / application taken from http://kynetxappaday.wordpress.com/2011/01/04/day-30-detecting-empty-pick/
ruleset a60x526 { meta { name "hash-pick-detect" description << hash-pick-detect >> author "Mike Grace" logging on } global { dataHash = { "one": { "name": "Mike" }, // number "two": { "random": 8 }, // number "three": { "name": "Alex" } // number }; // dataHash } // global rule detect_the_pick { select when pageview ".*" foreach dataHash setting (key, value) pre { userName = value.pick("$.name", true); length = userName.length(); } if (length > 0) then { notify("Key: #{key}","Name: #{userName}<br/>Length: #{length}") with sticky = true; } notfired { raise explicit event empty_pick with pickedKey = key; } } rule empty_pick_found { select when explicit empty_pick pre { pickedKey = event:param("pickedKey"); results =<< Key:
source share