INTERACT FORUM
More => Old Versions => JRiver Media Center 19 for Windows => Topic started by: kensn on November 29, 2013, 01:12:39 pm
-
ifelse(!isempty([My Field 1]), Some Text [My Field 1] if(!isempty([Disc #]), - Disc #[Disc #]), !IsEmpty(([My Field 2]), Some Text [My Field 2] if(!isempty([Disc #]), - Disc #[Disc #]), !isempty([Disc #]), Disc #[Disc #]))
So if [My field 1] is not empty, I would like to show "Some Text [My Field 1] and if [Disc #] is not empty I would like to show it also, same with [My Field 2], or if they are both empty just show the Disc #.
Cant get the syntax.
Ken
-
i think it is more helpful to copy the code you use and put it here.. :b but for now i would say the ( just before using [my field 2] breaks the ifelse thing. and if so take the ) at the end away.
:)
gab
edit: or just change the ifelse in if?
-
If you want to do ANDs and ORs you could try the Math() function:
IfElse(
Math(Compare([Watched], =, 1) & Compare([Number Plays], >, 0)), Watched,
Math(Compare([Watched], =, 0) | Compare([Number Plays], =, 0)), Unwatched,
Math(Compare([Watched], =, 1) & Compare([Number Plays], =, 0)), Special Case,
Math(Compare([Watched], =, 0) | Compare([Number Plays], >, 0)), Started
)
-
I think you should be using delimit() (http://wiki.jriver.com/index.php/Media_Center_expression_language#Delimit.28.E2.80.A6.29:_Outputs_a_value_with_head.2Ftail_strings_when_value_is_non-empty) rather than if statements.
e.g.
if(!isempty([My Field 1]),
Some Text [My Field 1]delimit([Disc #],,/ -/ Disc/ #),
if(!isempty([My Field 2]),
Some Text [My Field 2]delimit([Disc #],,/ -/ Disc/ #),
Disc #[Disc #]))
-
Thanks for all the ideas, I went with the delimit solution as I was trying that already, just could not get the syntax. Will work out what all the / do.
Thanks again..
ken