Needing Help with IF ELSE THEN

I have the below relevance spitting out data I am happy with but I would like it return a result such as ‘FALSE’ if nothing is found. I think I need to wrap it in an IF ELSE THEN but I cant seem to wrap my head around how. Any help would be greatly appreciated.

unique values of ( value “DisplayName” of it as string as trimmed string ) of keys whose(exists (value “DisplayName” of it as string as trimmed string as lowercase) whose(it contains “java 8”) AND exists (value “DisplayVersion” of it) ) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry; x32 registry)

There are a lot of ways to do that; since your query is returning strings, I’d group them in a ‘set’ and check the size of that set…I’m not at a computer now but give this a try:

(if size of it > 0 then elements of it else "false") of set of ( value “DisplayName” of it as string as trimmed string ) of keys whose(exists (value “DisplayName” of it as string as trimmed string as lowercase) whose(it contains “java 8”) AND exists (value “DisplayVersion” of it) ) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry; x32 registry)

Edit: removed ‘unique values of’ - a set already makes it unique.

3 Likes

Thank you Jason. That worked perfectly!

1 Like