Quote:
Originally Posted by crnirg
How can I make my column in which the length (size) of the COMMENTS column will be in characters or maybe just whether it is more or less than say 50?
|
Make a "Column built from other columns" with the heading and lookup name whatever you want.
To show the length, set the template to this
Single Function Mode template and set the column's Sort/search type to "Number".
Code:
{comments:strlen()}
To make it say "Yes" if the length is greater than or equal to 50, otherwise "No" use this
Template Program Mode template
Code:
{comments:'cmp(strlen($), 50, 'No', 'Yes', 'Yes')'}
or this
General Program Mode template
Code:
program:
if strlen($comments) >=# 50 then 'Yes' else 'No' fi
or this
Python Template Mode template
Code:
python:
def evaluate(book, context):
comments = book.get('comments')
return 'Yes' if comments and len(book.get('comments')) >= 50 else 'No'