1. Introduction
What are Datasources?
Datasources in OmmaSign are tools that provide dynamic data, such as prices or weather, from external or internal sources.
Why Use Datasources in Display Rules?
Integrating datasources with display rules allows your content to update in real-time based on live data, ensuring that your displays are always relevant.
2. How to Integrate Datasources with Display Rules
Step 1: Accessing Datasources
Step 2: Creating a Datasource
Step 3: Attaching Datasources to Display Rules
3. Use Cases for Datasources in Display Rules
1. Price-Based Display Rule
1. Price-Based Display Rule
Use Case: Show different content based on product price.
{
"products": [
{
"name": "Coffee Latte",
"price": 4.99
},
{
"name": "Espresso",
"price": 2.99
},
{
"name": "Cappuccino",
"price": 3.99
}
]
}
2. Weather-Based Display Rule
2. Weather-Based Display Rule
Use Case: Display content based on current weather conditions.
{
"weather": {
"city": "Istanbul",
"temperature": 25,
"condition": "sunny",
"humidity": 60
}
}
Example Rule:
If
condition == "sunny"
, display summer promotions.If
temperature < 10
, display winter gear.
3. Event-Based Display Rule
3. Event-Based Display Rule
Use Case: Change content based on upcoming events.
{
"events": [
{
"title": "Black Friday Sale",
"date": "2024-11-29",
"promotion": "50% off on all items"
},
{
"title": "Christmas Special",
"date": "2024-12-25",
"promotion": "Buy 1 Get 1 Free"
}
]
}
Example Rule:
If
date == "2024-11-29"
, show Black Friday content.If
date == "2024-12-25"
, show Christmas special content.
4. Inventory-Based Display Rule
4. Inventory-Based Display Rule
Use Case: Display content based on inventory levels.
{
"inventory": [
{
"product": "Laptop",
"stock": 15
},
{
"product": "Smartphone",
"stock": 5
},
{
"product": "Tablet",
"stock": 0
}
]
}
Example Rule:
If
stock == 0
, show "Out of Stock" content.If
stock > 10
, show "In Stock" content with promotion.
5. Traffic-Based Display Rule
5. Traffic-Based Display Rule
Use Case: Adjust content based on real-time traffic data.
{
"traffic": {
"city": "London",
"status": "heavy",
"average_speed": 20
}
}
Example Rule:
If
status == "heavy"
, display content encouraging public transport.If
average_speed > 40
, show fast travel options.
_______
Next: 7.8 Data Attributes
Previous: 7.6 Frequency
_______
Related