View Single Post
Old 12-09-2020, 04:45 PM   #1
kaufman
Calibre Companion Fanatic
kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.
 
kaufman's Avatar
 
Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
Problem programming a custom Column

I've been using this program for a column for ages:


program:
first_non_empty(
str_in_list(field('tags'),",", "_List.Active", "Active", ""),
str_in_list(field('tags'),",", "_List.Collections","Collections", ""),
str_in_list(field('tags'),",","_List.Favorites", "Favorites","")
)

I recently upgraded from. few version ago, and now for the columns that don't match any of the options above I get an error that says:

TEMPLATE ERROR expected string or bytes-like object.

If I change it to:

program:
first_non_empty(
str_in_list(field('tags'),",", "_List.Active", "Active", ""),
str_in_list(field('tags'),",", "_List.Collections","Collections", ""),
str_in_list(field('tags'),",","_List.Favorites", "Favorites",""),
"Z"
)

It work as before, except that now I have a non-empty value where I don't want it.

Is there some rules where custom columns can't be empty any more? Is there an option I need to set to allow this?

Any help would be appreciated. Thanks.
kaufman is offline   Reply With Quote