1) what is the default value of a custom field of type integer? it displays as you'd expect as a checkbox but when shown as a plain field, it shows as unset or empty but doesn't respond to ismissing or isempty (or =0)
When such a field is first created it is empty. You can view the raw contents of the field by writing the field as [Rewatch,0].
When you Check the field it is set to 1. When you then uncheck the field it is set to 0. I use such checkbox fields for TV program management, and just test for the field being equal to 1. Depending on the application, it has been recommended to set the field to 0 on import, using Tag on Import, but I haven't found that necessary.
2) what is the actual value behind "never played"?
It is empty. You can view the raw contents of the field by writing the field as [Last Played,0]. When you edit this tag, the only option is to delete an existing value. The Edit Type is "Cealr Only". So IsEmpty(...) will operate on it correctly, using the form IsEmpty([Last Played,0]), and will produce a 0 or 1 result.
So, Lepa's expression could be written differently using the above information;
Or(Compare([Last played,0],=,0),Compare([Rewatch],=,1),Never played or flagged,Watched)
But Lepa's expression doesn't output "Never played or flagged" or "Watched", just 0 or 1.
I went looking for the description in the
Expression functions [HELP WANTED] thread and couldn't find it, even though I know it used to be in there. The Release Notes say:
NEW: Added the expression function Or(...) to test a list of values and output true if any are set.
EDIT: Found it, but no more information there.
https://yabb.jriver.com/interact/index.php/topic,125140.msg866670.html#msg866670So I guess the Or(...) function does just output 0 or 1, so the expression needs an If(...) function:
If(Or(Compare([Last played,0],=,0),Compare([Rewatch],=,1)),Never played or flagged,Watched)
Which works to display "Never played or flagged" or "Watched".
Or if you want to use it in a View or Smartlist definition, in "Set Rules for Display"
[=If(Or(Compare([Last played,0],=,0),Compare([Rewatch],=,1)))]=1
But there are probably simpler expressions that could be used. I just wanted to play with the Or(...) function.
Oh yeah, don't need that If(...) any more;
[=Or(Compare([Last played,0],=,0),Compare([Rewatch],=,1))]=1