View Single Post
Old 03-22-2021, 03:33 PM   #4
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,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Yes, i want to replace the search & replaces in my action chains with templates.
I think you can do this as I described, but using from_search() instead of from_selection(). The chain_vars action would do the search and compute the result for each of the three cases. You would then need do 1 selection modifier to select all books and run a single field edit on each book, returning the value you want in identifiers.

There is some complexity if the same book can have multiple identifiers changed. In the second and subsequent searches you would need to see if a book_var for that book had already been set and, if so, use that instead of what is in the metadata.

A possible worthwhile addition to ask of capink would be to have the single field edit run over any book with any book_var set. That would eliminate the need to modify any selection. The chain vars action would compute what is needed and the single field action would run over any books with new data.
chaley is offline   Reply With Quote