Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-20-2019, 06:32 PM   #1
BruDeV
Junior Member
BruDeV began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2019
Location: southern California
Device: Kindle Fire, Android tablet, PC
Example please: assign(id, val)

"assign(id, val) -- assigns val to id, then returns val. id must be an identifier, not an expression"

I can't seem to get this to work.
What I'd like to do is assign the data from a column-build-from-other-columns to a text or long-text column.

Basically I want to automatically save some data BEFORE making any changes.

IE: assign(#pre_edit_save, field('#build_pre_edit_save'))

#pre_edit_save being a long text column
#build_pre_edit_save being a column built from other columns

<!--build_pre_edit_save ([bulk edit metadata search & replace] build_pre_edit_save -> pre_edit_save)-->
<div style="font-size: medium; background-color: White; ">
<span style="color: Red; ">{authors}: </span>
<span style="color: Green; ">{#save_title}</span>
<div style="color: Black; ">{#title_extras}{series}{series_index:|: |}</div>
</div>
BruDeV is offline   Reply With Quote
Old 11-20-2019, 07:28 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,490
Karma: 78910112
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
I believe that id is just a variable name; not a column name. Think of it as the equivalent of an assignment statement (id = value) and that the function in turn returns value.

Sent from my SM-T290 using Tapatalk
PeterT is offline   Reply With Quote
Advert
Old 11-20-2019, 07:39 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,046
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
{ID} is a column that belongs to the Library and is Read Only otherwise, you would break lots of things).

ID is also the same number that is part of the Title folder (if you peeked beneath the skirts ). That IS the linkage in the DB (and also breaks any tie when duplicate names get loaded)
theducks is online now   Reply With Quote
Old 11-21-2019, 07:15 AM   #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,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
If you are referring to the calibre template language, you can't do what you are asking. A template cannot modify book metadata. All variables are local, meaning they disappear when the template finishes.

The audit log plugin might give you what you want.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you assign books to TWO or more series? haertig Calibre 10 01-15-2018 09:42 PM
how to assign an ID to every image sbin Sigil 10 12-19-2015 06:00 AM
Assign KB shortcuts phossler Editor 3 08-24-2014 09:42 AM
Hi my name is Val phoenix49 Introduce Yourself 3 01-20-2012 12:07 AM
How do you assign categories?? mrsp Fictionwise eBookwise 5 12-20-2007 12:20 PM


All times are GMT -4. The time now is 02:20 PM.


MobileRead.com is a privately owned, operated and funded community.