Using MOD Function
Communication Cloud Service lets you use the MOD function using the Data tag. The MOD function allows you calculate the remainder of dividend divided by a divisor. You can use this function for integers and decimal numbers.
Example: Package Assembly Template
{
"$$Id": "ModCalculation",
"Fields": [
{ "Name": "TransactionsLimit",
"Path": "$.TransactionsLimit"
},
{ "Name": "NumberofTransactions",
"Path": "$.NumberofTransactions"
},
{ "Name": "IncrementedTransactionsLimit",
"Path": "$.IncrementedTransactionsLimit"
}
]}
Example: Content Configuration
The additional charge of $100 will be collected since the transactions limit
is increased
by
<comms-data>$Data{"Id":"IncrementedTransactionsLimit"}<comms-transform
type="mod"><comms-data>$Data{"Id":"NumberofTransactions"}</comms-data><comms-data>$Data{"Id":" TransactionsLimit
"}</comms-data></comms-transform></comms-data>.
Example: Sample Input
{"TransactionsLimit": 100,
"NumberofTransactions": 125,
"IncrementedTransactionsLimit": 0}
Example: Package Output
The additional charge of $100 will be collected since the transactions limit is increased by 25.
Note:
If you use 0 for divisor, or if you use the function for any number type other than integer and decimal an error will be displayed.