Variables
Use variables as dynamic placeholders to substitute specific values within parameters
Overview
Labii variables are dynamic placeholders that enable you to substitute specific values within parameters automatically. Variables streamline data management by allowing you to create reusable templates and configurations that adapt to different contexts without manual reconfiguration. This powerful feature enhances automation, reduces errors, and improves productivity in laboratory workflows.
Variables are enclosed in double curly braces: {{VARIABLE_NAME}}. They are automatically replaced with their corresponding values when processed.
Record Properties
Access properties of the current record using these variables:
{{SID}}
System identifier of the current record
abc123xyz
{{UID}}
Unique identifier of the current record
EXP-001
{{NAME}}
Name of the current record
My Experiment
{{DESCRIPTION}}
Description of the current record
Testing compound efficacy
{{PROJECTS}}
Projects associated with the current record
Project data array
{{OWNER.SID}}
System identifier of the record owner
user456
{{OWNER.NAME}}
Name of the record owner
John Doe
{{DATECREATED}}
Date and time the record was created
2026-03-17 10:30:00
{{VERSION}}
Version number of the current record
3
{{LINK}}
Direct link to the record's detail view
Full URL to record
{{SHARABLELINK:<URL>}}
Sharable link for external access
Formatted sharable URL
For {{SHARABLELINK:<URL>}}, the URL must contain an api_key parameter to allow access by users without Labii authentication.
URL Variables
Access information about the current page URL:
{{URL}}
Complete current URL
https://labii.com/records/123
{{DOMAINFRONTEND}}
Current domain
https://labii.com
Date Variables
Generate dynamic dates for time-sensitive operations:
Current Date
{{TODAY}}- Returns today's date inYYYY-MM-DDformatExample:
2026-03-17
Formatted Current Date/Time
{{CURRENT:<FORMAT>}}- Returns current date/time with custom formattingJavaScript: Use Moment.js format patterns
Example:
{{CURRENT:MMMM Do YYYY, h:mm:ss a}}→March 17th 2026, 2:30:45 pm
Python: Use Strftime format codes
Example:
{{CURRENT:%B %d, %Y}}→March 17, 2026
Relative Dates
Calculate dates relative to today using the pattern: {{[+/-][#][DAY/WEEK/MONTH/YEAR]:<FORMAT>}}
Syntax:
+or-: Add or subtract time#: Number of units (1, 2, 3, etc.)Unit:
DAY,WEEK,MONTH, orYEAR<FORMAT>: Optional format (defaults toYYYY-MM-DD)
Examples:
{{-5WEEK}}- 5 weeks ago →2026-02-10{{+30DAY}}- 30 days from now →2026-04-16{{-1YEAR:YYYY}}- Year value from 1 year ago →2025{{+2MONTH:MMM YYYY}}- 2 months from now →May 2026
JavaScript: Supports custom formatting using Moment.js patterns
Python: Format support is currently not available for relative dates; returns YYYY-MM-DD format only
Column Variables
Reference and process data from table columns:
Basic Column Reference
{{[COLUMN_SID]}}- Returns the value of a column using its SIDExample:
{{nqtw0a40x1d58puzEJOTY}}returns the column's stored value
Processed Column Values
{{[COLUMN_SID]:<CODE>}}- Returns column value processed through custom code
JavaScript Processing
Execute any JavaScript code to transform column data. The column value is available as the data variable.
Basic Operations:
Built-in Statistical Functions:
sum
Calculate sum of number array
{{column_sid:sum(data)}}
mean
Calculate mean (average)
{{column_sid:mean(data)}}
se
Calculate standard error
{{column_sid:se(data)}}
sd
Calculate standard deviation
{{column_sid:sd(data)}}
encodeStringForURL
URL-encode a string
{{column_sid:encodeStringForURL(data)}}
decodeStringFromURL
URL-decode a string
{{column_sid:decodeStringFromURL(data)}}
Labii
Access Labii utility functions
{{column_sid:Labii.functionName(data)}}
Complex Examples:
Python Processing
Access nested dictionary values using dot notation to specify keys:
Syntax: {{[COLUMN_SID]:key1.key2.key3}}
Examples:
Python code processing is limited to dictionary key access only. Full Python expressions are not supported.
User Variables
Access information about the current logged-in user:
{{USER.SID}}
System identifier of current user
user789
{{USER.NAME}}
Full name of current user
Jane Smith
Metadata Variables
Use metadata labels as variables to dynamically reference organization-level or project-level settings:
Syntax: Define metadata with labels wrapped in {{...}}, then reference them as variables.
Example:
Once defined, use {{API_KEY}} anywhere to substitute the value automatically.
Common Use Cases:
Store shared API keys for generating sharable links
Define organization-wide constants
Maintain environment-specific configuration values
Reference project-specific parameters
Best Practice: Store sensitive values like API keys as metadata at the organization level, then reference them using variables. This centralizes management and improves security.
Escaping Variables
To prevent a string from being interpreted as a variable, escape the curly braces with backslashes:
Escaped Format: \\{\\{string\\}\\}
Example:
Without escaping:
{{TEST}}→ Replaced with TEST variable valueWith escaping:
\\{\\{TEST\\}\\}→ Displays as{{TEST}}(literal text)
Use escaping when you need to display variable syntax as literal text in documentation or when the curly braces are part of your actual data format.
Usage Examples
Example 1: Dynamic Record Title
Output: Experiment EXP-001 - Compound Testing (Version 3)
Example 2: Date Range Query
Output: Records from 2026-02-15 to 2026-03-17
Example 3: Sharable Report Link
Output: Complete sharable URL with authentication
Example 4: Statistical Summary
Output: Mean Concentration: 45.67 μM, Standard Deviation: 3.21 μM
Last updated