A Database Widget presents your data in a structured, spreadsheet-like format with rows and column headers allowing you to easily add new entries, delete existing ones, or modify data as needed. Each row in the widget corresponds to a form where the database widget is populated with data. The Chemical Inventory and Plasmid Database are two default database widgets that can easily be added from the Widget menu or you can create your own custom database widgets using the Import CSV option.
From the Add New Entry menu, select Widget, and then choose Chemical Inventory or Plasmid Database from the menu. Click Use to add the Widget to your LabArchives page.
Each row in the database corresponds to a form that includes the column labels as a field for entering data and populating the database.
The Database Widget toolbar includes options to help easily add, edit, delete, copy, and search for entries. Additional tools are also available to export the data into a CSV, PDF, Excel, and to print the widget. Use Show/hide columns to customize the column display and the Show menu to adjust how many rows are on display.
Creating a Database Widget by Importing a CSV File
If you need to support database columns and values other than what are supplied through the Chemical Inventory or Plasmid Database, the CSV import option can be used to customize your own Database Widgets. Most Excel files (or similar spreadsheet files) can be saved in CSV format with UTF-8 encoding. See the sample Database Widget CSV file at the end of this article for an example of how to format your CSV.
Before uploading the CSV, there are formatting requirements that must be followed to ensure the CSV file can be read and the data correctly added to the Database Widget:
- Every column of data must have a unique header in row 1 of the file. Each header will become a column in the Database and a field in the form.
- When complete, save your spreadsheet as a CSV file to upload into your LabArchives Notebook.
Using the formatted spreadsheet example above, will create a Database Widget with a similar form menu below. The menu will be used to add entries into the Database Widget.
After saving your CSV file, it can now easily be uploaded into your LabArchives Notebook to create a Database Widget. From the Add New Entry menu, select Import CSV File. From the Import CSV File window, select Database and add a Title to your Database. From there select Choose File to browse for your CSV file and click Continue to upload.
A preview of the form's fields for entering data will appear within the Import CSV window. If the form is correct, click Yes, this form is correct. Now, your Database widget will be available as an entry on the page and as a selectable Widget in your notebook.
If your CSV does not meet the given requirements, you will see an error message describing the problem after attempting to upload. The system will also provide suggestions for formatting issues.
Warning messages are only suggestions and you may not have to comply with all of them to successfully upload your CSV into a widget. Please see the Index of Error and Warning Messages for additional information.
Index of Error and Warning Messages
This section contains two tables designed to help you identify and resolve issues with your CSV Import. Use these tables as a quick reference to understand the meaning of each message and the recommended action.
Error Conditions
| Field | Error Condition | Description |
|---|---|---|
| _mandatory | Data is empty | _mandatory fields must contain a value. |
| _number | Data contains characters other than numbers, periods, commas and dash | _number fields must contain only numbers. |
| _calculator | Data contains characters other than numbers, periods, commas and dash | _calculator fields must contain only numbers. |
| _date | Data contains text that is not in a date format | _date fields must be in the format mm/dd/yyyy. |
| _date | Date not in correct format but another date format | _date field is not in the recommended format. We suggest you change it to mm/dd/yyyy. |
| _color | Data contains text that is not a color | _color fields must contain a valid color name. |
| _radio | Data has 20 choices, suggest to make a ‘select’ | _radio fields may have at most 20 choices. We suggest you make it a _select field. |
| Misc | The given CSV is not saved with UTF-8 encoding | Your file must be saved in UTF-8 encoding to work properly. |
| Misc | An error occurred parsing the CSV file | Check that the header for each column is correct. Check that the file is comma-delimited |
Warning Conditions
| Field | Warning Condition | Description |
|---|---|---|
| _text | Data has only numbers | We noticed this field contains only numbers. We suggest you make it a _number or _calculator field. |
| _select | Data has 100 choices | This field has over 100 choices. Verify the choices listed are correct. |
| (blank) | Header name is empty | Header is blank. We recommend specifying a name or it will default to "Column #". |