Scripts
Seal allows you to write and execute your own custom Python code within the platform, enabling powerful custom solutions and automations.
Scripts can contain code that can be then executed. This is useful for automating data transformation and creation. For example, scripts can ingest a machine output CSV file, do some data cleaning and other transformation, and store the results in Seal as Records.
Scripts enable you to transform your data in more powerful and flexible ways.
For general information about writing code in Seal, and the Seal Module — see this page.
Fields
Fields are stored as an object called fields
, keyed by the unique field names. Every field object has the following fields:
id
- a unique UUID given to every field, so it can be referenced. When a Data Record is created from a Data Step, it will have the same fields with matchingid
sthe field's
type
the field's
dataType
(usually the same as the type, but multiple field types may use the same underlying data type).type
is how it appears in the UI,dataType
refers to the underlying data typevalue
- the actual data. All field values are nullable - they are usually null in Data Steps (unless you want a default value for produced Records), and then populated in Data Records when a lab technician is doing data entry, for example.config
- certain field have additional config, for example specifying a number display format, or whether the field can contain multiple values.
For example:
Field Types
The columns in the dataframe are converted to fields in each Record. Seal infers the field types based on the data provided:
a number or None
NUMBER
a boolean
BOOLEAN
an ISO date string
DATE
an ISO datetime string (must be timezone aware)
DATETIME
any other string
STRING
an array of UUID strings
UPLOAD (i.e. an array of File ids)
an array of non-UUID strings
SELECT (a select field aka dropdown)
an array of {id, version} objects
REFERENCE (an entity reference field)
Title shortcut
If the column name is 'title' in the dataframe, Seal will automatically output this as the title of the Record, rather than creating a field called 'title'.
Seal's AI Co-Pilot
Seal comes with a built in AI agent to write code for you. Navigate to the 'Co-pilot' tab on the right hand side, and start chatting with the AI to describe what you need. The AI is also able to de-bug and add to your existing code.
Note that the generated code may not fully be fit for your purpose - we recommend checking over the results.
Last updated