INTERACT FORUM

Please login or register.

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

Author Topic: mapping one field to another  (Read 1439 times)

andrewt

  • World Citizen
  • ***
  • Posts: 137
mapping one field to another
« on: September 13, 2012, 12:58:04 am »

I wasn't sure how to title this, so please bear with me if I got the terminology wrong...

Can MC assign a value to one field based on the value of another field? Example: I type "Bach, Johann Sebastian" into the "composer" field, and MC writes "Germany" in the "country" field. Of course I would have to make a list of some sort to tell it what to do. Can this be done?
Logged

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: mapping one field to another
« Reply #1 on: September 13, 2012, 08:39:02 am »

It is possible but it is a bit ugly.

Make two new custom fields:
ComposerCountry: User data field (Where you input the Country information)
ComposerCountryINTERNAL: Calculated data with this expression: If(IsEmpty([ComposerCountry]),,Save([ComposerCountry],varComposerCountryListItem([Composer],0),1))

In a view with columns display those two fields in columns. The second field should show the correct Country info for the primary (first) composer, if entered once for that composer in the ComposerCountry field.  You could also add an expression column with this expression to show the Country info: Load(varComposerCountryListItem([Composer],0))

In the rules for file display for that view enter this: ([ComposerCountryINTERNAL]=[] or -[ComposerCountryINTERNAL]=[])

This worked for me when I tried it a while ago when the global variables were developed. I have not tried it with recent builds.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: mapping one field to another
« Reply #2 on: September 13, 2012, 11:22:01 am »

Since you are going to enter the country / artist at least once, would it be an option to create a relational (one value / artist) Artist Country field?  You'd set country once for each artist (or composer, or ...).
Logged
The opinions I express represent my own folly.

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: mapping one field to another
« Reply #3 on: September 13, 2012, 11:26:16 am »

Since you are going to enter the country / artist at least once, would it be an option to create a relational (one value / artist) Artist Country field?  You'd set country once for each artist (or composer, or ...).

Yeah, it would certainly be easier if fields could be made relational to the Composer field, not just the Artist, Album and Series fields...
Logged
Pages: [1]   Go Up