Field Properties Reference

Sample Manager Help

Each field in a data-structure design is associated with a set of properties of that field. This topic covers the options available and specific to fields of each data type. In addition, fields of all types have name and linking options and most include validation options, described in the common topic: Field Editor.

Type Specific Formatting Options

Text Options

Text Choice Options

A Text Choice field lets you define a set of values that will be presented to the user as a dropdown list. For example, you might offer a "Tube Type" field and let the user choose Heparin, EDTA, or Unknown.

  • Text Choice Options:
    • Add and manage the set of drop-down values offered for this field, as shown below.
  • Name and Linking Options
Click Add Values to enter the values to be presented for this field. Users will be able to choose from dropdown lists when entering or editing data.

Learn more about populating, editing, and managing text choice fields in the main LabKey documentation topic for Text Choice fields.

  • Up to 200 values can be included in the drop-down options. Values can be single- or multi-word.
  • You can change an existing Text field to the Text Choice type; the list of drop down values will be populated for you.
  • Values that are in use cannot be deleted. If they are in use by read-only data, they can neither be edited nor deleted.
  • All changes to the set of values for a text choice field are audited.

Multi-Line Text and Flag Options

  • Multi-line Text Field Options (or Flag Options):
    • Maximum Text Length. Sets the maximum character count for the field. Choose either "Unlimited" or "No longer than X characters", providing a value in the box. The default is 4000.
  • Name and Linking Options
  • Validation Options: Regular expression validators.

Boolean Options

  • Boolean Field Options: Format for Boolean Values: Use boolean formatting to specify the text to show when a value is true and false. Text can optionally be shown for null values. For example, "Yes;No;Blank" would output "Yes" if the value is true, "No" if false, and "Blank" for a null value.
  • Name and Linking Options

Integer/Decimal Options

Date, Time, and Date Time Options

For samples, sources, assay results and assay runs, three different field types are available, letting you choose how best to represent the data needed. Other types of fields in Sample Manager only support the DateTime combined field.

  • Date Time: Both date and time are included in the field. Fields of this type can be changed to either "Date-only" or "Time-only" fields, though this change will drop the data in the other part of the stored value.
  • Date: Only the date is included. Fields of this type can be changed to be "Date Time" fields.
  • Time: Only the time portion is represented. Fields of this type cannot be changed to be either "Date" or "Date Time" fields.

Calculation Options (Available in the Professional Edition)

A calculation field lets you include SQL expressions using values in other fields in the same row to provide calculated values. The Expression provided must be valid LabKey SQL and can use the default system fields, custom fields, constants, and operators. Examples:

OperationExample
AdditionnumericField1 + numericField2
SubtractionnumericField1 - numericField2
MultiplicationnumericField1 * numericField2
Division by value known never to be zeronumericField1 / nonZeroField1
Division by value that might be zeroCASE WHEN numericField2 <> 0 THEN (numericField1 / numericField2 * 100) ELSE NULL END
Subtraction of dates/datetimes (ex: difference in days)TIMESTAMPDIFF('SQL_TSI_DAY', CURDATE(), MaterialExpDate)
Relative date (ex: 1 week later)TIMESTAMPADD('SQL_TSI_WEEK', 1, dateField)
Conditional calculation based on another fieldCASE WHEN FreezeThawCount < 2 THEN 'Viable' ELSE 'Questionable' END
Conditional calculation based on a text matchCASE WHEN ColorField = 'Blue' THEN 'Abnormal' ELSE 'Normal' END
Text value for every row (ex: to use with a URL property)'clickMe'
Text concatenation (use fields and/or strings)City || ', ' || State

Once you've provided the expression, use Click to validate to confirm that your expression is valid. The data type will be calculated. If you would like to change what type is calculated, you can use casting in your SQL. For example, an integer field divided by an integer field will remain an integer inferred type, leading to unexpected "truncated" results without casting to a numeric type.

File/Attachment Options

Sources, samples, and assay designs (run and batch fields) support including file attachments, known in different structures as either File or Attachment fields.

  • Source Types use Attachment
  • Sample Types use File
  • Assay Designs allow File fields in batch and run field sections

Both field types offer:

In practice, these field types are very similar: both can accept files like PDF documents or images. The contents of these fields will display as thumbnails, open in a larger panel when clicked, and include a download option. Learn more about how these fields are used in this topic: The differences between File and Attachment include:

User Options

Sample Options

  • Sample Options: Select where to look up samples for this field.
    • You can choose All Samples to reference any sample in the container, or select a specific sample type to filter by.
    • This selection will be used to validate and link incoming data, populate lists for data entry, etc.
  • Name and Linking Options

Unique ID Options

A field of type "Unique ID" is read-only and used to house barcode values generated by LabKey. Learn more in this topic: Barcode Fields

Related Topics

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand allcollapse all