Quantcast
Channel: MobileRead Forums - Reading and Management
Viewing all articles
Browse latest Browse all 24086

How to build custom column based on other columne (if - then statement)

$
0
0
Hi there people

Background.
I have a Kindle 2/3 and I am planning to let the Kindle Collection plugin handle my collections.

The way I use kindle is that as soon as I am finished reading books in one collection I rename it on the kindle to x_NAME.... or X_NAME where NAME is the original collection name.
This works fine and I can set the plugin to not do anything with collections starting with x_

However, the plugin will try to recreate the original collection when I run it again.

So to handle this I am planning to also cater for the x_ named collection.
To do that, I use the plugin to read all existing collections existing on kindle into a custom column called kindlecollections.
Then I have another custom column called collectionname with following template
{#universe:'ifempty($, field('author_sort'))'}{series:| - |}
The template works the way I want. But does not check anything in #kindlecollections

What I would like is for the #collectionname to check if #kindlecollections start with x_ or X_
If it does, copy the content of #kindlecollections to #collectionname
If it doesn't, use {#universe:'ifempty($, field('author_sort'))'}{series:| - |} to populate #collectionname

I have been playing with the template, but can't seem to get my head around it.
Anyone able to help me?
Or is it another way to do what I want?

Cheers, Atle

Viewing all articles
Browse latest Browse all 24086