View Single Post
Old 07-09-2017, 12:17 PM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,462
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Assuming that #shelf is a text-type (perhaps with a fixed set of values) then this advanced rule should work.
Click image for larger version

Name:	Clipboard01.jpg
Views:	163
Size:	59.7 KB
ID:	157846

Here is the text shown in the dialog
Code:
program:
	switch(
		field('#enum2'),
		'^read$', 'success.png',
		'^to-read$', 'play-button.png',
		'^backlog$', 'line.png',
		'^dnf$', 'error.png',
		'^dont-touch$', 'forbidden-light-grey.png',
		'^currently-reading$', 'medical-1.png',
		'^favorite$', 'eye-1.png',
		'')
The search fields (read, to-read, etc) are regular expressions, which is why they are anchored (begin with ^ and end with $).

I used #enum2 because I don't have a column named #shelf.
chaley is offline   Reply With Quote