Skip to content
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 ​

  1. Create a ruleset named ProductPrices.

Create manually ​

  1. Create a constant named PercentagesJSON and set the Constant type to JSON.
    ↳ Rulecube enables the Value field for JSON content.

  2. In the Value field, enter these key-value pairs:

    json
    {
      "p1": 10,
      "p2": 15,
      "p3": 20
    }
  3. 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