INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Expression Language - Bug reading brackets? [solved - user error]  (Read 656 times)

Ferdi

  • World Citizen
  • ***
  • Posts: 195

I am trying to build a field that shows me
  • Song Title, if the rating is 0
  • Song Title (Rating), if the rating is greater 0

I use this to achieve that: IfElse(isequal([Rating], 0, 2),[Name],1,[Name] ([Rating]))

Output is correct when a rating exists, but includes a closing bracket if no rating exist. For example:
  • All Our Songs), with zero star rating
  • Life In Vain (4), with a 4 star rating
Is that a bug or a user error?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9165
Re: Expression Language - Bug reading brackets?
« Reply #1 on: August 22, 2020, 07:33:17 am »

User error :)
brackets are a part of the expression language, so, those that you want to be part of your output must be escaped, like so...

IfElse(isequal([Rating], 0, 2),[Name],1,[Name] /([Rating]/))

https://wiki.jriver.com/index.php/Expression_Language#Expression_Language_Syntax

Ferdi

  • World Citizen
  • ***
  • Posts: 195
Re: Expression Language - Bug reading brackets? [solved - user error]
« Reply #2 on: August 22, 2020, 07:35:09 am »

Thanks for quick reply and help of fixing this (like, within a minute?)!

(and thanks to zybex for Zelda https://yabb.jriver.com/interact/index.php/topic,125975.0.html)
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Expression Language - Bug reading brackets? [solved - user error]
« Reply #3 on: August 22, 2020, 03:05:17 pm »

You're welcome  8)
Logged
Pages: [1]   Go Up