v2.7 (latest)
JSON Constant ​
A JSON constant lets you create a JSON object, such as a table with discount ratings:
json
{
"percentage_1": 10,
"percentage_2": 15,
"percentage_3": 20
}Procedure ​
- Create a ruleset named
ProductPrices.
Create manually ​
Create a constant named
PercentagesJSONand set the Constant type toJSON.
↳ Rulecube enables the Value field for JSON content.In the Value field, enter these key-value pairs:
json{ "p1": 10, "p2": 15, "p3": 20 }Click Save.
Create by drag and drop ​
If you have a JSON file, you only need to create the constant and set Constant type to JSON. And then drop the JSON file onto the Value field.
Use ​
Refer to an element from a JSON constant by addressing the constant and key whose value you want:
json
PrecentagesJSON.p2