Product Metadata Configuration
Introduction
This guide explains how to configure custom metadata for your IoT products and devices in the Data Engine platform. Metadata allows you to track additional product-specific information without modifying the database schema.
Use Cases:
- Track environmental sensor readings (temperature, humidity, pressure)
- Store device location information
- Record maintenance schedules and status
- Manage custom business-specific attributes
- Store certification or compliance information
Two-Step Process:
- Define the structure at the product level (what fields and types)
- Fill in values for each device
Prerequisites
For Product Metadata Configuration:
- Access to the Data Engine Backoffice
- Superadmin role (only superadmins can define product metadata structures)
- An existing product in the system
For Device Metadata Values:
- Access to the Data Engine Backoffice
- Authenticated user account
- A product with defined metadata structure
- An existing device associated with that product
Step-by-Step Guide
Part 1: Configure Product Metadata Structure
This defines what metadata fields will be available for all devices of this product type.
Step 1: Navigate to Product Settings
- Log in to the Data Engine Backoffice as a superadmin
- Navigate to Dashboard → Products
- Select the product you want to configure
- Click on the Settings tab
Step 2: Access Product Metadata Section
- Scroll down to the "Product Metadata Structure" section
- This section appears below the main product form
- Only visible to users with superadmin role
Step 3: Add Metadata Fields
- Click the "Add Field" button
- A new row appears with two inputs:
- Key: The identifier for this metadata field (e.g., "temperature")
- Type: The data type for this field
Available Types:
| Type | Description | Example Use Case |
|------|-------------|------------------|
| string | Text data | Location, serial number, description |
| number | Numeric data | Temperature, humidity, battery level |
| boolean | Yes/No data | Is active, maintenance required, certified |
| date | Date data | Last maintenance, installation date, expiry date |
Example Configuration:
Key: temperature Type: number
Key: location Type: string
Key: isActive Type: boolean
Key: lastMaintenance Type: date
Step 4: Save the Structure
- Click "Save" button at the bottom of the form
- A success message confirms the metadata structure is saved
- All devices of this product can now use these metadata fields
Important Notes:
- Field keys should be descriptive and use camelCase (e.g., "lastMaintenance")
- Avoid spaces in keys
- Choose the most specific type (use
numberfor numeric data, notstring) - All fields are required when filling device values
Step 5: Modify or Remove Fields (Optional)
To remove a field:
- Click the trash icon (🗑️) next to the field
- Click "Save"
- Warning: This will remove this field from ALL devices of this product
To modify a field:
- Change the key or type directly in the form
- Click "Save"
- Warning: Changing keys creates a new field and removes the old one from all devices
Part 2: Fill Device Metadata Values
Once the product metadata structure is defined, you can fill in values for individual devices.
Step 1: Navigate to Device Settings
- Navigate to Dashboard → Devices
- Select the device you want to configure
- Click on the Settings tab
Step 2: Open Metadata Drawer
- Scroll down to find the "Manage Metadata" button
- Click the button
- A drawer slides in from the right side showing the metadata form
Step 3: Fill in Metadata Values
The form automatically generates input fields based on the product's metadata structure:
Field Types and Inputs:
String fields:
- Text input box
- Enter any text value
- Required (cannot be empty)
Number fields:
- Number input box
- Enter numeric values only
- Can include decimals (e.g., 25.5)
- Validation prevents non-numeric input
Boolean fields:
- Checkbox
- Check for "true", uncheck for "false"
Date fields:
- Date picker
- Select date from calendar
- Format: YYYY-MM-DD
Example Values:
temperature: 25.5
location: Building A, Room 101
isActive: ✓ (checked)
lastMaintenance: 2025-11-01
Step 4: Save Metadata Values
- Click the "Save Metadata" button at the bottom of the form
- A success toast notification appears
- The drawer closes automatically
- Values are immediately saved to the database
Step 5: Edit Existing Values (Optional)
- Click "Manage Metadata" button again
- Form loads with existing values pre-filled
- Modify any values
- Click "Save Metadata"
- Updated values replace previous ones
Examples
Example 1: Environmental Sensor Product
Product Metadata Structure:
Key: temperature Type: number
Key: humidity Type: number
Key: pressure Type: number
Key: location Type: string
Key: calibrationDate Type: date
Device #1 Values:
temperature: 22.5
humidity: 45.2
pressure: 1013.25
location: Warehouse North, Shelf A3
calibrationDate: 2025-10-15
Device #2 Values:
temperature: 19.8
humidity: 52.0
pressure: 1012.80
location: Warehouse South, Shelf B7
calibrationDate: 2025-10-20
Example 2: Smart Lock Product
Product Metadata Structure:
Key: serialNumber Type: string
Key: isActive Type: boolean
Key: batteryLevel Type: number
Key: installDate Type: date
Key: firmwareVersion Type: string
Device Values:
serialNumber: SL-2025-001234
isActive: ✓
batteryLevel: 85
installDate: 2025-01-15
firmwareVersion: 2.3.1
Example 3: GPS Tracker Product
Product Metadata Structure:
Key: trackingInterval Type: number
Key: geoFenceEnabled Type: boolean
Key: simCardNumber Type: string
Key: activationDate Type: date
Device Values:
trackingInterval: 30
geoFenceEnabled: ✓
simCardNumber: 89012345678901234567
activationDate: 2025-02-01
Best Practices
Naming Conventions
Good Key Names:
temperature- clear and conciselastMaintenance- descriptive camelCaseisActive- boolean prefixbatteryLevel- clear measurement
Avoid:
temp- too abbreviatedLast Maintenance- contains spacesdata1- not descriptivevalue- too generic
Type Selection
Choose the right type:
- Use
numberfor any numeric measurements (temperature, battery level, intervals) - Use
stringfor text, IDs, descriptions, and version numbers - Use
booleanfor yes/no, on/off, active/inactive states - Use
datefor timestamps, schedules, and date tracking
Why types matter:
- Correct type enables proper validation
- Number fields prevent invalid input
- Boolean fields provide checkbox UI
- Date fields provide date picker
Planning Your Structure
Before creating fields:
- List all information you need to track
- Group related information
- Choose appropriate types
- Use consistent naming conventions
- Consider future needs (but don't over-engineer)
Recommended limits:
- Keep metadata fields under 20 for usability
- Use descriptive but concise key names
- Group related products with similar structures
Handling Changes
Adding new fields:
- Safe to add at any time
- Existing devices will show empty values for new fields
- Users must manually fill in values
Removing fields:
- ⚠️ Permanent action - removes data from ALL devices
- Cannot be undone
- Export device data before removing important fields
Changing field types:
- Creates a new field, removes old one
- ⚠️ Existing values are lost
- Instead: create new field with different key, migrate data, then remove old field
Troubleshooting
Problem: "No metadata fields defined" message appears
Cause: The product doesn't have a metadata structure defined yet
Solution:
- Ensure you're logged in as superadmin
- Navigate to product settings
- Add metadata fields using "Add Field" button
- Save the structure
Problem: Can't see "Product Metadata Structure" section
Cause: Your account doesn't have superadmin role
Solution:
- Contact your system administrator to upgrade your role
- Only superadmins can configure product metadata structures
- Regular users can only fill device values
Problem: "Manage Metadata" button doesn't appear on device page
Cause: The product associated with this device doesn't have metadata structure defined
Solution:
- First configure the product metadata structure (as superadmin)
- Then the button will appear on device settings pages
Problem: Metadata values disappear after saving
Cause: The keys you entered don't match the product metadata structure (auto-cleanup removed them)
Solution:
- Check the product metadata structure
- Ensure you're only filling fields that exist in the structure
- If you need different fields, update the product structure first (as superadmin)
Problem: Can't save numeric value in number field
Cause: Value contains non-numeric characters
Solution:
- Enter numbers only (digits 0-9)
- Decimals allowed with period (e.g., 25.5)
- No commas, spaces, or text
- Negative numbers allowed with minus sign
Problem: Date picker shows wrong format
Cause: Browser locale settings
Solution:
- Date is stored in ISO format (YYYY-MM-DD) regardless of display
- Select date from picker rather than typing
- System handles conversion automatically
Problem: Checkbox value not saving correctly
Cause: Form state issue
Solution:
- Try refreshing the page
- Re-open the metadata drawer
- If persists, check browser console for errors
Advanced Topics
Understanding Auto-Cleanup
When you save device metadata, the system automatically:
- Validates all keys against product metadata structure
- Removes any keys not in the product structure
- Keeps only valid metadata fields
Example:
- Product has:
["temperature", "location"] - You try to save:
["temperature", "location", "customField"] - System saves:
["temperature", "location"](customField removed)
This ensures data consistency across all devices.
Metadata Storage
- All metadata values stored as strings in the database
- Type information comes from product structure
- UI converts strings to appropriate types for display
- Example:
"true"(string) displayed as checkbox,"25.5"(string) displayed as number input
API Integration
If you're integrating with the API directly:
Get device with metadata:
GET /device/:id
Returns device object including metadata array.
Update device metadata:
PUT /device/:id/metadata
Content-Type: application/json
[
{ "key": "temperature", "value": "25.5" },
{ "key": "location", "value": "Building A" }
]
See Product Metadata API Documentation for full details.
Related Documentation
- Product Metadata Technical Documentation - Full technical details
- User Roles and Permissions - Understanding role-based access
- Backoffice Frontend - Frontend application overview
Support
For technical issues or questions:
- Check the Product Metadata Technical Documentation
- Contact your system administrator
- Review the troubleshooting section above