Download as pdf
Download as pdf
You are on page 1of 2

LEARNING CUMULUS (POWER TIP):

Using Formulas to Create a History of Metadata Edits


A simple field formula enables Cumulus to time stamp metadata edits, so you’ll know who edited what, and when.

Ever wonder who’s been editing your asset records? Cumulus automatically records the most recent record modification
date, but you can add an easy field formula to your catalogs that will enable you to see a historical record of edits that you
can search, review and refer to when needed.

An overview of the basics. Before we get into the setup details, let’s cover about this special catalog, but refer to the
Even if you don’t know how to program, or you’re some of the things you need to know up front. “What’s the $Users catalog?” sidebar if you’re
not familiar with field formulas in Cumulus, you’ll curious. The date and time come from a simple
Adding catalog fields You’ll need to know how to
be able to make use of this simple tip. Once we’re formula function call.
add a new field to your catalog.
done, what you’ll end up with is a catalog field
To handle any situations in which there might not
that’s automatically updated each time an asset Adding fields to view sets You’ll need to know
be a user login value available, we’ll check for a
record is saved. Figure 1 shows how the field how to add a field to a view set.
value in that field before we use it. If we don’t find
might appear in use.
Armed with these skills, let’s get started. one, we’ll mention that in our time stamp.
The formula starts with:
The Edit History field.
The field we’ll use is a standard String type. The userFieldHasValue("Login Name")
only difference between this field and any other If a value exists, the function returns 1; otherwise
you might create, is that the contents of our field we get 0 (zero). If we get a 1, we start building
will be entered by a formula, not by user input. our time stamp, starting with the date/time:
Create the new field and configure it using the now()
settings shown in figure 2.
We add a space after that (for readability) and
The magic of the formula then get the user login:
Our formula grabs the login name of the current
user, along with the current date/time, and userFieldValue("Login Name")
inserts those values at the top of the Edit History After that we add a line break and “paste” in the
field, resulting in a reverse chronological history. old field value:
FIGURE 1: The Edit History field added to an info The formula gets the user’s login name from the fieldValue("Edit History")
window.
$Users catalog. It’s not important to know much

FIGURE 2: Create the new


field using the settings
shown. You can name the
field anything you like.
(Left)

Once the field has been


created, access its Proper-
ties window (right) and
configure it as shown. The
Use Fallback Value option is
useful for debugging, but
because it would wipe out
our previous history if an
error occurs, we don’t
want to use it here.

Canto, the Canto logo and Cumulus are registered trademarks of Canto. Other company and product names might be trademarks of their respective owners.
EDU/mkTIP-EditTimeStamps/2010.07 Copyright ©2010 Canto GmbH. All rights reserved. www.canto.com Page 1 of 2
LEARNING CUMULUS (POWER TIP): Using Formulas to Create a History of Metadata Edits

FIGURE 3: When first What’s the $Users catalog?


added to a view, a field When you log into Cumulus as the adminis-
defaults to being only a
single line high. Access trator, you seen the $Users catalog listed.
the field’s properties to
adjust that value so that
more can be seen on the
view.

The field configured here


is what’s seen in figure 1.

Cumulus stores your Cumulus Server’s user


accounts in this catalog. Each account is rep-
resented by a record that includes fields for
user name, email address, etc. Formulas can
get user information from these fields.
To see the fields you can use, open a user
account in the Cumulus Server Console, as
shown below. The Login Name field used in
our formula is highlighted. Click the Addi-
tional Fields tab for more fields you can use.

If we checking for a value in the “Login Name” If you copy and paste this formula into the for-
field we got a zero instead of a 1 (indicating the mula editor in your catalog, make sure the field
field had no value), we’d just add “Unknown names used match the ones in your catalog.
User” in place of the current user name.
When we combine these various functions (with View set considerations.
some additional stuff thrown in for formatting You can add your Edit History field to any view
and logic flow), we get what’s seen in figure 1, sets and views you like, but the Info View and
with a new entry added each time the asset Info Window work best, because scroll bars will
record is saved. appear when needed.

In its entirety, the formula is: When adding the field to a new view, access the
field’s properties to set the height to a suitable
userFieldHasValue("Login Name") value. Figure 3 shows how you can set the field
? height to 5 lines, which is a good starting value
for this purpose.
now() + " "
If you want to see the field when using the Web
+ userFieldValue("Login Name") + "\n” Client, add it to the Info View, because the Info Want to log user actions too?
Window is not available in the Web Client. Cumulus 8 enables you to log user actions, such
+ fieldValue("Edit History") as previews, downloads, etc., via usage statistics.
: Keep in mind, the field is edited via formula and Search for “Asset Usage History” in the the
not by users, so it will always appear in a read- Cumulus Admin guide PDF for info.
now() + " " only state, regardless of the connected user’s
+ "User Unknown" + "\n” permissions.
This Power Tip is intended to work in all editions of
NOTE: Metadata edits made via the Cumulus Cumulus 7.0 or later.
+ fieldValue("Edit History")
Web Client update Edit History too. (Meta-
NOTE: (“\n” inserts a line break.) data edits are not possible in Cumulus Sites.)

About Canto Professional Services For more information, contact your


Canto Professional Services is dedicated to helping customers maximize their Cumulus invest- local Canto partner, or Canto:
ments through expert training, needs assessments, and configuration and customization ser- In the U.S.
vices. Available worldwide, Canto Professional Services affordably transforms Cumulus +1 (415) 495-6545
systems into tailored solutions perfect for each customer.
In the E.U.
The Learning Cumulus: Power Tips series is published by Canto Professional Services to help +49 (0) 30 390 485 0
Canto customers and partners make the most of Canto Cumulus.
Everywhere
Learn more: www.canto.com info@canto.com

Canto, the Canto logo and Cumulus are registered trademarks of Canto. Other company and product names might be trademarks of their respective owners. Some product
claims and features are not included in all versions of the software and/or might require additional Cumulus Add-ons or Plug-ins.
EDU/mkTIP-EditTimeStamps/2010.07 Copyright ©2010 Canto GmbH. All rights reserved. www.canto.com Page 2 of 2

You might also like