Home / JSON Structure / uiOptions
| uiRule | Description | Example |
description |
Used internally, as a comment for a person, who is configuring a JSON file. This uiRule is optional. |
|
trigger |
Describes event, which will trigger the action on an element. This uiRule is mandatory. Possible triggers:
|
|
action |
Defines the action to be performed on an element. For more information, see Actions. This uiRule is mandatory. | |
target |
Element, that will be affected by the action. A full path to the element file has to be defined. This uiRule is mandatory. | |
parameters |
Set of parameters, which are specific to the action. For more information, see Actions. This uiRule is optional. | |
condition |
Sets in what circumstances the target will be affected. This uiRule is optional. | |
source |
Element, from which data, properties and parameters are taken for action. This uiRule is optional. |
Switches visibility of the target element when the toggler value is changed.
{
"properties": {
"totalPremium": {
"label": "Total Premium",
"uiType": "money",
"uiOptions": {
"class": "col-4"
}
},
"claimsHandler": {
"label": "Will MGA be handling the claims?",
"uiType": "toggler",
"default": true,
"uiOptions": {
"required": true,
"class": "col-4"
},
"uiRules": [
{
"trigger": "onChange",
"action": "toggleVisibility",
"target": "quote.totalPremium"
}
]
}
}
}
Sets the value as defined in the parameter array or takes the value from the defined source. It can be used with the condition key, with a math expression in brackets. The argument is taken from the action source field. Also, the evaluate expression might be useful. For more information on math expression, click here.
{
"trigger": "onChange",
"action": "setValue",
"target": "quote.fieldB",
"condition": "equal(quote.fieldC)",
"parameters": 10
},
{
"trigger": "onChange",
"action": "setValue",
"target": "quote.fieldC",
"condition": "range(100, 120)",
"parameters": 11
},
Sets the today date for target.
{
"entryDate": {
"label": "Entry Date",
"uiType": "date",
"uiOptions": {
"readonly": true,
"class": "col-4",
"quoteField": "issue_date"
},
"uiRules": [
{
"trigger": "onLoad",
"action": "setToday",
"target": "quote.entryDate"
}
]
}
}
Sets the target element when the source value is equal to the value defined in parameters.
{
"entryDate": {
"label": "Entry Date",
"uiType": "date",
"uiOptions": {
"class": "col-4",
"quoteField": "created_at"
},
"uiRules": [
{
"trigger": "onLoad",
"action": "setToday",
"target": "submission.entryDate"
},
{
"trigger": "onLoad",
"action": "setDate",
"target": "submission.inceptionDate",
"source": "submission.entryDate",
"parameters": {
"days": 1
}
}
]
}
Shows the target element when the source value is equal to the value defined in parameters.
{
"totalPremium": {
"label": "Total Premium",
"uiType": "money",
"uiOptions": {
"class": "col-4"
},
"uiRules": [
{
"trigger": "onChange",
"source": "source.professionalLiability",
"action": "showByValue",
"target": "quote.claims",
"parameters": 5000
}
]
},
}
}
Shows the target element when the source value is lower then the value defined in parameters.
{
"totalPremium": {
"label": "Total Premium",
"uiType": "money",
"uiOptions": {
"class": "col-4"
},
"uiRules": [
{
"trigger": "onChange",
"source": "source.professionalLiability",
"action": "showByValueLt",
"target": "quote.claims",
"parameters": 5000
}
]
},
}
Shows the target element when the source value is lower or equal then the value defined in parameters.
{
"totalPremium": {
"label": "Total Premium",
"uiType": "money",
"uiOptions": {
"class": "col-4"
},
"uiRules": [
{
"trigger": "onChange",
"source": "source.professionalLiability",
"action": "showByValueLte",
"target": "quote.claims",
"parameters": 5000
}
]
},
}
Shows the target element when the source value is greater then the value defined in parameters.
{
"totalPremium": {
"label": "Total Premium",
"uiType": "money",
"uiOptions": {
"class": "col-4"
},
"uiRules": [
{
"trigger": "onChange",
"source": "source.professionalLiability",
"action": "showByValueGt",
"target": "quote.claims",
"parameters": 5000
}
]
},
}
Shows the target element when the source value is greater or equal then the value defined in parameters.
{
"totalPremium": {
"label": "Total Premium",
"uiType": "money",
"uiOptions": {
"class": "col-4"
},
"uiRules": [
{
"trigger": "onChange",
"source": "source.professionalLiability",
"action": "showByValueGte",
"target": "quote.claims",
"parameters": 5000
}
]
},
}
Shows a field when a condition is met. It can be used with the condition key, with a math expression in brackets. The argument is taken from the action source field. Also, the evaluate expression might be useful. For more information on math expression, click here.
{
"trigger": "onLoad",
"action": "showField",
"target": "quote.fieldD",
"condition": "largerEq(121)"
},
{
"trigger": "onChange",
"action": "showField",
"target": "quote.fieldD",
"condition": "largerEq(121)"
},
{
"trigger": "onChange",
"action": "showField",
"target": "quote.fieldD",
"condition": "evaluate(quote.fieldC == quote.fieldA)"
}
Hides the target element when the source value is equal to the value defined in parameters.
{
"totalPremium": {
"label": "Total Premium",
"uiType": "money",
"uiOptions": {
"class": "col-4"
},
"uiRules": [
{
"trigger": "onChange",
"source": "source.professionalLiability",
"action": "hideByValue",
"target": "quote.claims",
"parameters": 5000
}
]
},
}
Calculates the value defined in parameters.
{
"brokerComm": {
"label": "Broker Commission %",
"uiType": "decimal",
"uiOptions": {
"class": "col-3 offset-right-3"
},
"uiRules": [
{
"trigger": "onChange",
"action": "calculate",
"target": "parameters.grossComm",
"parameters": "parameters.humnComm"
}
]
}
}
Takes values from one table with the moneyTable uiType, calculates and displays calculated values on another moneyTable.
{
"mgaPart": {
"label": "MGA Participation",
"uiType": "number",
"default": "100",
"uiOptions": {
"class": "col-3",
"icon": "fe fe-percent"
},
"uiRules": [
{
"trigger": "onChange",
"action": "calculateTable",
"target": "mgasharetable",
"parameters": "premiumtable * quote.mgaPart / 100"
}
]
},
}
Sums up all quote endorsements premiums, deductibles, limits or other fields and assigns the value to the target element. The following parameters are used:
onlyCurrentVersion - not required, defined if all versions of endorsements must be summed up, or just current.amount - required, defined which endorsements field must be summed up.currency - not required, if the target uiType is currency.{
"fleetendorsementsSum": {
"label": "Fleet Endorsements Sum",
"uiType": "money",
"uiOptions": {
"class": "col-6"
},
"uiRules": [
{
"trigger": "onChange",
"action": "sumEndorsements",
"source": "fleetendorsements",
"target": "premium.fleetendorsementsSum",
"parameters": {
"onlyCurrentVersion": true,
"amount": "deductible",
"currency": "eur"
}
}
]
}
}
Sets the target as a difference of year, months, days between to values defined in source.
{
"uiRules": [
{
"trigger": "onChange",
"action": "getDateDiff",
"target": "submission.daysRemaining",
"source": [
"submission.inceptionDate",
"submission.expiryDate"
],
"parameters": "days"
}
]
}