Two Ways to Use Fields
1. URL Templates (Double Curly Braces)
Use{{field.name}} syntax to insert field values into Destination URLs.
Example:
2. Conditional Visibility (Direct References)
Use direct field references in conditions to show/hide Destinations. Example:Available Fields
Item Fields
Items have standard fields (built-in) and custom fields (you define them).Standard Item Fields
| Field | Type | Description | Example |
|---|---|---|---|
item.id | string | Unique identifier | "item-456" |
item.name | string | Display name | "Excavator #203" |
item.description | string | Description text | "CAT 320 Hydraulic Excavator" |
item.image | string | Image URL | "/uploads/exc203.jpg" |
item.item_number | string | Item number/SKU | "EXC-203" |
item.type | string | Type/category | "Heavy Equipment" |
item.subtype | string | Subtype | "Excavator" |
item.status | string | Current status | "operational" |
item.tags | array | Tags array | ["construction", "rental"] |
item.serial_number | string | Serial number | "SN-2024-203" |
item.location | string | Physical location | "Site A" |
item.owner | string | Owner/assignee | "John Smith" |
item.created_at | date | Creation date | "2024-01-15T00:00:00Z" |
item.updated_at | date | Last update date | "2024-01-20T00:00:00Z" |
item.item_number, not item.number.
Custom Item Fields
Any custom fields you define in your Tub are accessible asitem.{fieldName}.
Example:
If you add a custom field called inspectionDue to your Tub, reference it as:
- URL Template:
{{item.inspectionDue}} - Condition:
item.inspectionDue < today
Tub Fields
Access information about the Tub (category/workspace) containing the Item.| Field | Type | Description | Example |
|---|---|---|---|
tub.id | string | Tub unique identifier | "tub-123" |
tub.name | string | Tub display name | "Heavy Equipment" |
tub.description | string | Tub description | "Construction equipment fleet" |
tub.image_url | string | Tub image URL | "/images/equipment-icon.png" |
tub.items_name | string | Items collection name | "Machines" |
tub.created_at | date | Tub creation date | "2024-01-01T00:00:00Z" |
tub.metadata.page.is_public | boolean | Public accessibility | true |
tub.metadata.organizationName | string | Organization name | "BuildCo Inc." |
Session Fields
Access information about the logged-in user (if authenticated).| Field | Type | Description | Example |
|---|---|---|---|
session.user | object | User object (null if not logged in) | {...} |
session.user.id | string | User ID | "user-123" |
session.user.email | string | User email | "john@example.com" |
session.user.name | string | User name | "John Smith" |
Device Fields
Automatically detected when someone scans the QR code.| Field | Type | Description | Example Values |
|---|---|---|---|
device.type | string | Device type | 'mobile', 'tablet', 'desktop' |
device.os | string | Operating system | 'ios', 'android', 'windows', 'macos', 'linux', 'unknown' |
device.browser | string | Browser | 'chrome', 'safari', 'firefox', 'edge', 'opera', 'unknown' |
device.isMobile | boolean | True if mobile phone | true / false |
device.isTablet | boolean | True if tablet | true / false |
device.isDesktop | boolean | True if desktop | true / false |
device.isIOS | boolean | True if iOS device | true / false |
device.isAndroid | boolean | True if Android | true / false |
Theme Fields
Access Profile Page theme configuration.| Field | Type | Description | Example |
|---|---|---|---|
theme.accent | string | Accent color | "sky" |
theme.radius | string | Border radius | "xl" |
URL Template Examples
Basic Field Insertion
Insert serial number into URL:Inspection App Integration
Pre-fill asset ID in inspection:CMMS Integration
Open asset record:Custom Application
Pass all relevant data:Conditional Visibility Examples
Item Status
Show “Start Inspection” only for operational equipment:Tags
Show Destination if Item has specific tag:Equipment Type
Show only for forklifts:Dates and Expiry
Show if inspection is overdue:Combining Multiple Conditions
Heavy equipment that’s operational:Device-Based Conditions
Show only on mobile devices:Common Patterns
Pattern 1: Equipment-Specific Inspections
Different equipment types route to different inspection templates. Destination: “Forklift Inspection”- URL:
https://app.inspectionapp.com/new?template=forklift&asset={{item.serial_number}} - Condition:
item.type == "forklift"
- URL:
https://app.inspectionapp.com/new?template=crane&asset={{item.serial_number}} - Condition:
item.type == "crane"
Pattern 2: Location-Based Routing
Route to different systems based on Item location. Destination: “Site A Work Orders”- URL:
https://sitea.cmms.com/workorders/new?asset={{item.item_number}} - Condition:
item.location == "Site A"
- URL:
https://siteb.cmms.com/workorders/new?asset={{item.item_number}} - Condition:
item.location == "Site B"
Pattern 3: Status-Dependent Actions
Show different Destinations based on Item status. Destination: “Start Inspection” (operational only)- Condition:
item.status == "operational"
- Condition:
item.status != "operational"
- Condition: (none)
Pattern 4: Device + Item Type Routing
Combine device detection with Item data. Destination: “Mobile App Inspection” (mobile + forklifts)- URL:
app://inspect?id={{item.serial_number}} - Condition:
device.isMobile && item.type == "forklift"
- URL:
https://portal.com/equipment/{{item.id}} - Condition:
device.isDesktop
Important Notes
Field Names:- Use exact field names:
item.item_numberNOTitem.number - Custom fields: Whatever name you gave them in Tub configuration
- Case-sensitive:
item.Statuswill NOT work, useitem.status
- qrtub automatically URL-encodes field values
- Spaces become
%20, special characters are escaped - You don’t need to manually encode
- If a field is empty/null, URL templates insert empty string
- Conditions with missing fields evaluate to
false - Check for existence:
item.owner != null
- Use
inoperator:"tag-name" in item.tags - Check size:
size(item.tags) > 0 - Cannot directly insert arrays in URL templates (convert to string first)
- Compare with
<,>,<=,>=,== - Use
todayfor current date:item.inspectionDue < today - Cannot perform date arithmetic beyond simple comparisons
Getting Help
For complex field usage:- Use AI to generate expressions - See Conditional Visibility
- Test with sample Items - Create test Items with different field values
- Check field names - Verify exact field names in your Tub configuration
- Contact support - Email hi@qrtub.com with your use case
Related
- Conditional Visibility - Show/hide Destinations based on conditions
- Device Detection - Device-based routing
- SafetyCulture Integration - Using fields with SafetyCulture
- CMMS Integration - Using fields with maintenance systems
- Profile Pages Overview - Understanding Profile Pages and Destinations