View Single Post
Old 12-13-2021, 06:45 AM   #755
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,090
Karma: 76037135
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Named it columnupdate_kobocoll.

All three of the listed columns are taglikes; #genres and #vls are composites (former puiling from tags, latter using the virtual_libraries() function).

Code:
program:
	g = field('#genres');
	k = field('#kobocoll');
	vl = field('#vls');

	v = first_non_empty(
		list_contains(vl, ',', '^Loans$', 'Loans', ''),
		list_contains(g, ',', '^Fanfiction$', 'Fanfiction', ''),
		list_contains(g, ',', '^Horses$', 'Horses', ''),
		list_contains(g, ',', '^Cozy Mystery$', 'Cozy Mysteries', ''),
		list_contains(g, ',', '^(Fantasy|Science Fiction)$', 'Fantasy & Sci-Fi', ''),
	);

	list_union(k, v, ',')
If it matters, I'm trying to update #kobocoll itself without erasing existing values.
Attached Thumbnails
Click image for larger version

Name:	2021-12-13 07_42_50-Template tester.png
Views:	307
Size:	23.1 KB
ID:	190804   Click image for larger version

Name:	2021-12-13 07_43_47-Edit Template.png
Views:	300
Size:	24.6 KB
ID:	190805  

Last edited by ownedbycats; 12-13-2021 at 06:49 AM.
ownedbycats is online now   Reply With Quote