Supported Data Types

Data types in Decision Tables

All data in a decision table is stored as string values and is automatically cast when needed. Therefore, you don’t need to specify any data format for your input and output models. The automatic casting of conditions and results is described in the following sections.

Condition Data Types

Conditions can be created using the following scalar data types:

  • Number

  • Boolean

  • String

  • Date

Conditions

Solver Request Data Example

The inputs below demonstrate the format in which you can send a request to match a particular row:

  1. Number:

    {
      "input": "2.31"
    }

    or

    {
      "input": 2.31
    }
  2. Boolean (True):

    {
      "input": true
    }

    or

    {
      "input": "true"
    }
  3. Boolean (False):

    {
      "input": false
    }

    or

    {
      "input": "false"
    }
  4. String:

    {
      "input": "hello world"
    }
  5. Date and Time:

    {
      "input": "2024-09-23 13:27 +02:00"
    }

    or as extended ISO-8601:

    {
      "input": "2024-09-23T13:27:00+02:00"
    }
  6. Empty Value:

    {
      "input": ""
    }

Examples:

Condition [value in decision table]
Solver Request Value [value send on API]
Result

2.31

2.31

Equal

2.31

"2.31"

Equal

true

true

Equal

true

"true"

Equal

false

false

Equal

true

2

Not Equal

hello world

"hello world"

Equal

"2024-09-23 13:27 +02:00"

"2024-09-23 13:27 +02:00"

Equal

"2024-09-23 13:27 +02:00"

"2024-09-23T13:27:00+02:00"

Equal

"2024-09-23 13:27 +02:00"

{
  "input": {
    "date": "2024-09-23",
    "time": "13:27",
    "timezone": "+02:00"
  }
}

Equal

"2021-03-17T13:17-09:00"

"2024-09-23 13:27 +02:00"

Equal

"2021-03-17T13:17-09:00"

{
  "input": {
    "date": "2024-09-23",
    "time": "13:27",
    "timezone": "+02:00"
  }
}

Not Equal!

<empty>

""

Equal

<empty>

Value not presented in input JSON

Not Equal

Calculation Data Types

Calculation columns support all the data types used by result columns.

Result Data Types

When calling the Solver API, the response returns an array of results based on the decision table setup. Response values are automatically cast to the following data types:

  • Boolean

  • Number

  • String

  • Date

  • JSON Object

  • JSON Arrays

Casting examples:

Decision Table Result Value
Solver Response Value

true

true

false

false

"true"

\"true\"

25

25

25.0

25

25.01

25.01

""

""

Empty

""

hello world

"hello world"

DATE(09.23.2024)

"2024-09-22T22:00"

{}

{}

{"data":123 }

{"data":123 }

{"data": "123" }

{"data": "123" }

[12,36,"542"]

[12,36,"542"]

[12,36,"542"

"[12,36,\"542\""

[12, 36, "542", [1,2] ]

[12, 36, "542", [1,2] ]

Last updated

Was this helpful?