Quote:
Originally Posted by jwahome2002
Hello - very new to Calibre, but very familiar with data manipulation. I am trying to create a custom field using if-then-else. I have spent days searching and cannot figure out the correct syntax.
Here is what I am trying to solve for:
IF {universe} isempty
THEN concatenate({universe},{book#})
ELSE concatenate ("1",{author},{saga},{Book#}
Any help is greatly appreciated!!
|
You didn't give the real column lookup names so I am guessing. And what you wrote doesn't make a lot of sense. For example, why are you concatenating an empty field (universe) with book#? And what is book#?
Assuming you meant not isempty on the IF, that "universe" is a custom column with the lookup key #universe, that "saga" is a custom column with the lookup name #saga, and "book#" is the calibre book id, I think you want something like this in
General Program Mode:
Code:
program:
if $#universe then
strcat($#universe, $id)
else
strcat('1', $authors, $#saga, $id)
fi