Here is a template that you can customize to check columns other than authors. Change 'authors' in the line "column = 'authors'" to the lookup name of your choice.
Code:
python:
def evaluate(book, context):
column = 'authors'
db = context.db.new_api
items_with_notes = context.globals.get('items_with_notes')
if items_with_notes is None:
items_with_notes = db.get_all_items_that_have_notes(column)
context.globals['items_with_notes'] = items_with_notes
context.globals['item_name_map'] = db.get_item_name_map(column)
item_name_map = context.globals['item_name_map']
vals = book.get(column)
if vals is None:
return ''
if isinstance(vals, str):
vals = tuple((vals,))
for val in vals:
if item_name_map.get(val) in items_with_notes:
return '1'
return ''