Changing text input based on conditional data
Is it possible to display alternative text based on conditional data in Blox? I have a case where if a goal has been achieved, the text should display one thing and when the goal hasn't been achieved, the text would display an alternative. I'm just testing right now, but can't seem to make it work. This is what I tried:
"conditions": [
{
"minRange": "-Infinity",
"maxRange": 49999.99,
"backgroundColor": "#fd6e69",
"text": "Test 1"
},
{
"minRange": 50000,
"maxRange": "Infinity",
"backgroundColor": "#3adcca",
"text": "Test 2"
}
],
"body": [
{
"spacing": "small",
"type": "Container",
"items": [
{
"type": "TextBlock",
"class": "conditional_text",
"text": "Test 1",
"size": "auto",
"spacing": "none",
"horizontalAlignment": "center"
}
]
},
{
"spacing": "none",
"type": "Container",
"items": [
{
"spacing": "small",
"type": "TextBlock",
"class": "condition_data",
"text": "$51,000.00",
"horizontalAlignment": "center",
"size": "large",
"weight": "bold",
"color": "white"
}
]
}
]
}
The background color changes, but the text stays the same.
Any help is appreciated!
Please sign in to leave a comment.
Comments
0 comments