INTERACT FORUM

Please login or register.

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

Author Topic: Calculated list field prefers to be a String [Solved]  (Read 800 times)

Bccc1

  • Junior Woodchuck
  • **
  • Posts: 75
Calculated list field prefers to be a String [Solved]
« on: June 23, 2013, 05:43:25 am »

Hello,

I'm struggling with calculated list fields. I've created the field ALBUMARTISTSORT which is a List type. If set my view to Categories and only add ALBUMARTISTSORT, an album with ALBUMARTISTSORT="Beethoven, Ludwig van; Berliner Philharmoniker; Karajan, Herbert von" is listed three times with "Beethoven, Ludwig van", "Berliner Philharmoniker" and "Karajan, Herbert von". Everythings fine, till I bring in my field ALBUMARTISTSORT (Auto).

The original expression was If(IsEmpty([ALBUMARTISTSORT]), [Album Artist (auto)], [ALBUMARTISTSORT]), but that resulted in listing the item as "Beethoven, Ludwig van; Berliner Philharmoniker; Karajan, Herbert von". The field is treated as String, and I don't know, how to tell JRiver not to do. Using listbuild(1,;,If(IsEmpty([ALBUMARTISTSORT]), [Album Artist (auto)], [ALBUMARTISTSORT])) didn't help and then I ran out of ideas.

The wiki states
Quote
If these functions are used to create a new 'calculated data' library field, they will not function as 'list type' fields unless the field is first created as a "User Data" field, with "List Type" specified. After creating the field in this way, it is possible to go back and edit the field, changing it to "calculated data" and entering an expression to be used.
But that didn't work for me. After switching to calculated data, closing and reopening the window, the Data Type is reset to String. For some reason the value of the Edit Type got saved though.

So, how do I get my list?

Thanks in advance
Logged

Bccc1

  • Junior Woodchuck
  • **
  • Posts: 75
Re: Calculated list field prefers to be a String
« Reply #1 on: June 23, 2013, 10:16:42 am »

Shame on me, I should have read the whole wiki article. The simple solution is to add
Code: [Select]
&datatype=[list] to the expression. Now it looks like
Code: [Select]
If(IsEmpty([ALBUMARTISTSORT]), [Album Artist (auto)], [ALBUMARTISTSORT])&datatype=[List] and works like a charm.
Logged
Pages: [1]   Go Up