http://manual.calibre-ebook.com/temp...-not-found-val
Quote:
str_in_list(val, separator, string, found_val, not_found_val) str_in_list(val, separator, string, found_val, not_found_val) – treat val as a list of items separated by separator, comparing the string against each value in the list. If the string matches a value, return found_val, otherwise return not_found_val. If the string contains separators, then it is also treated as a list and each value is checked.
|
use "," as separator, val will be field('tags') and you want to search for string "First", then return found_val "First". not_found_val should return empty "" which first_non_empty should skip over, I think.
Personally, I think you should use general program mode for this:
Code:
program:
first_non_empty(
str_in_list(
field('tags'),
",",
"First",
"First",
""
),
field('series'),
"Uncategorized"
)