View Single Post
Old 04-04-2016, 10:10 PM   #9
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by iienderii View Post
I have a column which shows the title of the publication (in this case, it's a magazine library). Of those collected, I have a custom column called 'Category.' That field is based on a separate lookup-type table where I just decided which magazines are either 'primary,' 'secondary,' or 'other.' I'd like the 'Category' column to automatically populate with a pre-determined 'primary,' 'secondary,' or 'other' based on what I choose for 'Magazine Title.'
So, in pseudo code terms this is:
Code:
primary_mags = ('New Scientist', 'PC Advisor', 'PC Magazine')
secondary_mags = ('World', 'Some other Magazine')

if magazine_title in primary_mags:
   return "Primary"
else if magazine_title in secondary_mags:
   return "Secondary"

return "Other"
I don't use the template language enough to write it without some experimentation. I can do that tonight.

But, is this really worth it? If you have to manually set the magazine title, I'm not sure that automatically setting the category gains you much. Especially as you have to maintain the template with the list titles in each category.
davidfor is offline   Reply With Quote