![]() |
#1 |
Junior Member
![]() 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> |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 ![]() |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |