Modifying Fields
Your collection has a set of fields that you defined when you first created the collection. This set of fields - their names and data-types - is called the collection's schema. But the schema is not fixed. You can change it at any time. In particular, you can:
- rename fields
- change the data-type of any field
- add new fields
- add derived fields
- delete fields that you decide you no longer need
(Note: The order of fields is not part of the schema. You set the order in which fields are displayed - both when viewing the collection as a list and when viewing an individual record's item details - through menu choices on Recollector's Options menu.)
To modify your collection's schema, pick Edit > Modify Fields or Image Directory from Recollector's menu. This will bring up the Modify Fields dialog.
View the Modify Fields dialog ... |
|
The list of fields is shown in the order in which the fields appear in the Item Details view. If your collection contains many fields, you may find it easier to locate a particular field name if the fields are ordered alphabetically. Turn on the A-Z checkbox above the list to re-order the field names alphabetically. (The state of the A-Z checkbox is remembered
within a session, and if you invoke Modify Fields more than once in a
session, the last setting for this checkbox will be restored when you return to
this dialog.)
To modify a field's name or its data-type, select the field in the list and click the Modify field button. A field's name can be as simple ("Price") or as complicated ("Date of last official valuation") as you want. (However, a very, very long field name might result in a somewhat awkward visual layout for the display of the collection's data.) If you enclose a field name in parentheses - for example: (Image) - this will suppress the display of the field name in the Item Details view. This is often appropriate for image-data fields, since thumbnail images are usually self-explanatory, and don't need a label in front of them. The collection templates provided by Recollector follow this practice of putting parentheses around the name of fields whose data-type is image/audio/video.
You can also specify a default value for a field. If you do so, then when you add a new record, the field will be initialized with the default value. This can be particularly useful with fields that use an associated picklist, since you can cause the picklist to be initially set to the most commonly occuring value.
View the Modify Field dialog, and information on Recollector's data types ... |
|
Recollector supports a variety of data-types for fields.
All data are actually stored as text strings, but a field's
data type affects how the field is displayed, how it is presented when adding or
editing data, and how data values are compared when searching or sorting.
-
short text - for text fields that typically contain either a single word or a short phrase.
-
one-line text - for text fields that are longer than a short text, but that can usually be viewed in a single line, such as a multi-word phrase or a short sentence.
-
multi-line text - for text fields that contain longer texts (long sentences, multi-sentence texts, or multiple paragraphs).
-
currency - for fields containing numbers that are to be interpeted as currency values.
-
dimension - for fields containing numbers that are to be interpeted as distance values, such as lengths, widths or heights.
-
number - for fields containing numbers other than currency or dimension values.
-
date - for fields containing date values (for example: July 14, 1976 or 09/12/2005) or simply whole-year dates (such as 1976). If using a Date field to describe ancient material, you can represent a year followed (or preceded) by BC or BCE (e.g.: 350 BC) to represent years prior to the year zero. Recollector will properly recognize these ancient dates for purposes of sorting or comparison. You can also append (or precede) AD or CE with a year (e.g. 500 AD), though this is not needed, since Recollector assumes that any single numeric value represents a year of zero or later.
-
image/audio/video - for fields containing references to image and media files.
To add a new field, click the Add a new field button, and specify a name, data-type for the new field, and, if you want, a default value. (Expand the section just above [View the Modify Field dialog, and information on Recollector's data types] for a view of the dialog - which is the same, for adding new fields, as for modifying existing fields - and for information on Recollector's data types.)
Special default values for Date fields: If you specifyToday or Updated as the default value for a Date field, then, when you add a new record, this field will be initialized to today’s date. If you specify Updated as the default value for a Date field, then, when you edit an existing record and make any changes to the record, when the record is saved, the Date field whose default value is Updated will have its value automatically changed to today's date. This allows you to have a field that automatically keeps track of when a record was last modified. If you manually change the Date field’s value in the editor, your manual change will be preserved, and automatic updating of the field will not occur. This allows you to manually correct an incorrect last-modified date. Note: No more than one Date field in a collection should have a default value of Updated.
To delete a field, select a field in the list and click the Delete field button. You will be warned that deleting a field will result in the loss of any data values in that field that currently exist in records in your collection.
You can also add derived fields to your collection. A derived field is like a formula in a spreadsheet: rather than representing a single data value, a derived field contains a formula for computing a value from the values in other, non-derived, fields in the record. Compared to spreadsheets, Recollector's formulas - referred to in the program as derivations - are very simple and much more restricted. Derivations can only refer to numeric-type fields (which includes currency, dimension and numeric fields) or to date fields.
Here are some simple examples of how derived fields can be useful:
- If you have multiple fields relating to cost (for example, a purchase-price field, a shipping-cost field and a restoration-expense field), you could create a "Total cost" derived field that sums up the values in the individual cost fields.
- If you have a price field and a sales-amount field, you could create a "Profit" derived field that is the sales-amount minus the price.
- If you have an acquisition-date field, you can create a derived field that displays the length of time that the item has been in your collection.
- If you have an appraisal-date field, and you plan to update your appraisals annually, you could create a derived field that displays the date you expect the appraisal to be updated. Or you could create a derived field that shows how much time (in years and days) is left before reappraisal comes due (or how late the reappraisal is, if it is overdue).
View the Add New Derived Field dialog, and information on how to use it ... |
|
Enter a name for the derived field. The name must be different from the name being used for any other field (both normal and derived fields).
Use the buttons in the dialog to enter a derivation. A derivation consists of one or more field specifications (or one of the two of the special specifiers, NOW and NUMIMAGES), connected together with arithmetic operators. You can type a formula directly into the Derivation field, but to avoid errors it is much better to use the buttons as much as possible.
- To add a field to the derivation, choose the field name from the Field reference dropdown, and then click the Add button. Only numeric, currency, dimension and date fields can be used in derivations, so only those fields appear in the dropdown. The field will appear in the derivation as the field name bracketed by curly braces and preceded by a dollar-sign. For example: ${Acquisition Date}
-
To add an arithmetic operator to the derivation, click one of the four arithmetic operator buttons (+, -, * or /).
-
To add a reference to the current day, use the Add 'Now' date button. This will add the text $[NOW] to the derivation. $[NOW] is just like a date field, but its value, when evaluating the derivation, is always today's date.
View the example, below, to see how the $[Now] value can be used to generate a derived field that displays a time duration.
-
To generate a count of the number of images associated with the record, use the Add 'Image Count' button. This will add the text $[NUMIMAGES] to the Derivation. This can be useful, all by itself, as the entire derivation, when you want an easy way to see how many images you have with each record. For example, if you have a coin collection, and you always expect to have two photos, one for each side of a coin, you could sort your List View by a derived field that displays the NUMIMAGES value, and quickly locate the records that don't yet have both images provided.
-
To enter numbers as part of the derivation, simply type them into the Derivation text box. For example, if you have a field ('Diameter') that records the diameter of a coin, you could create a 'Circumference' field by first using the buttons to add the field reference (${Diameter}) and the multiplication operator (*), and then type in the value of pi (3.14) at the end of the derivation.
-
If you make a mistake entering the derivation, you can use the Clear button to erase the contents of the Derivation text box, and start again.
It is useful to remember that derivations are not part of your collection data. They are simply on-the-fly values that are generated when displaying your collection. So even if you create an incorrectly designed derived variable, this will not pose any danger to the integrity of the actual data in your collection.
Some additional information about derived fields:
-
Recollector checks the syntax of your derivation before saving it. So if you have a malformed derivation (for example, trying to add a date field to a currency field), an error message will be displayed, and you will have to correct the error (or cancel out of the dialog) before you can continue.
-
Recollector evaluates the derivation formula from left to right. You can use parentheses (which can be typed in or entered using the ‘(‘ and ‘)’ buttons) to control the evaluation order of parts of the derivation expression. For example, to compute a derived full perimeter length, when you have Height and Width fields, you could use the following expression: (${Height} * 2) + (${Width} * 2) If, for a given record, Height is 20 and Width is 8, the resulting derived field would have a value of 56 [(20 * 2) + (8 * 2)]. If the parentheses were left out, with the derivation specified as ${Height} * 2 + ${Width} * 2, then the derived field would have an incorrect value of 96 (20 * 2 + 8 * 2), since evaluation would be performed left to right.
-
Derived fields can be used for sorting, for searching, for subsetting, and they can be included in field profiles. The derived fields are also included when exporting your collection for downloading to the Recollector App. Derived fields can also be included in generated reports and generated web sites, as well as when exporting to file. However, derived field data cannot be imported.
-
Totals for currency and numeric derived fields are displayed in the Summary window, along with the totals for normal currency and numeric fields.
-
Derived fields based on currency fields are displayed like normal currency-type fields. So, for example, if you have the preference set for always displaying currency values with two fractional digits, this preference will apply to the derived field as well.
-
Derived fields are not shown in the editor, since derived fields have no separate data that can be entered or modified.
-
Derived fields that compute durations (like the example shown below), display those durations in years and days; for example, 3 years, 122 days. If the duration is less than a year, just the days value is shown. If you compute a negative duration, it is displayed within parentheses; for example, (63 days). Alternatively, you can specify a text that should appear when a negative duration is computed. After the derivation expression, enter a semi-colon, followed by whatever text you want to appear when the derived duration is negative.
- Though the default words used for displaying durations are the English words (day/days/year/years), you can use the Other Preferences tab on the Preferences dialog to provide the words you want to use when displaying durations.
-
Numbers in derivations that include date fields are interpreted in units of days. So to add one year to a date-field value, add 365 (not 1).
-
You can modify an existing derived field by selecting it from the list of fields in the Modify Fields dialog and then clicking the Modify button. You will be shown the same dialog as when adding a new derived field, but the name and derivation will be filled in, and you can make whatever changes you want.
Below is an example of a filled-in
Derived Field dialog.
The Modify Fields dialog also lets you:
- rename your collection
- rename the ID # field
- change the default currency units
- change the default dimension units
- specify, or modify, the Image Directory. See help on the Image Directory for more information.
When you exit from the Modify Fields dialog, by clicking the OK button, you will return to the collection window, where you will be able to see the schema changes that you have just made.