Create Table

POST {{_endpoint}}/services/data/v{{version}}/connect/business-rules/decision-table/definitions

Decision Table Definitions (POST)

Create a decision table definition. A decision table definition contains all the details required to create a decision table.Resource

/connect/business-rules/decision-table/definitions

Resource Example

https://yourInstance.salesforce.com/services/data/v59.0/connect/business-rules/decision-table/definitions

Available version

58.0

Requires Chatter

No

HTTP methods

POST

JSON example for a single object source

{
   "setupName":"Product Qualificiation eligibility",
   "fullName":"ProductQualificationEligibility",
   "description":"Eligiblity of Products using Qualification Rules",
   "usageType":"ProductEligibility",
   "sourceType":"SingleSobject",
   "sourceObject":"AccountFeed",
   "status":"Draft",
   "decisionResultPolicy":"UniqueValues",
   "collectOperator":"Count",
   "conditionType":"Any",
   "conditionCriteria":"1 OR 2 OR 3",
   "parameters":[
      {
         "fieldName":"IsDeleted",
         "usage":"INPUT",
         "operator":"Equals",
         "sequence":"1"
      },
      {
         "fieldName":"Id",
         "usage":"INPUT",
         "operator":"Equals",
         "sequence":"2"
      },
      {
         "fieldName":"Title",
         "usage":"INPUT",
         "operator":"Equals",
         "sequence":"3"
      },
      {
         "fieldName":"CreatedById",
         "usage":"OUTPUT"
      }
   ]
}

JSON example for a multi-object source

{
   "setupName":"Jumbo Pricing Definition",
   "fullName":"JumboPricingDefinition",
   "description":"Join all the DT definitions into one jumbo pricing definition",
   "usageType":"ProductEligibility",
   "type":"LowVolume",
   "sourceType":"MultipleSobjects",
   "sourceObject":"AccountFeed",
   "status":"Draft",
   "decisionResultPolicy":"UniqueValues",
   "collectOperator":"Count",
   "sourceconditionLogic":"1 AND 2 AND 3",
   "conditionType":"Any",
   "conditionCriteria":"1 OR 2 OR 3 OR 4 OR 5",
   "parameters":[
      {
         "fieldName":"IsDeleted",
         "usage":"INPUT",
         "operator":"Equals",
         "sequence":"1",
         "columnMapping":"IsDeleted"
      },
      {
         "fieldName":"Id",
         "usage":"INPUT",
         "operator":"Equals",
         "sequence":"2",
         "columnMapping":"Id"
      },
      {
         "fieldName":"Title",
         "usage":"INPUT",
         "operator":"Equals",
         "sequence":"3",
         "columnMapping":"Title"
      },
      {
         "fieldName":"OldvalNumber",
         "usage":"INPUT",
         "operator":"Equals",
         "sequence":"4",
         "columnMapping":"AccountHistory.OldvalNumber"
      },
      {
         "fieldName":"OldvalString",
         "usage":"INPUT",
         "operator":"Equals",
         "sequence":"5",
         "columnMapping":"AccountHistory.OldvalString"
      },
      {
         "fieldName":"CreatedById",
         "usage":"OUTPUT",
         "columnMapping":"CreatedById"
      },
      {
         "fieldName":"NewvalNumber",
         "usage":"OUTPUT",
         "columnMapping":"AccountHistory.NewvalNumber"
      },
      {
         "fieldName":"NewvalString",
         "usage":"OUTPUT",
         "columnMapping":"AccountHistory.NewvalString"
      }
   ]
   "sourceCriteria":[
      {
         "sourceFieldName":"OldvalString",
         "value":"5",
         "operator":"Equals",
         "valueType":"Parameter",
         "sequenceNumber":"1"
      }
   ]
}

Request body for POSTProperties

NameTypeDescriptionRequired or OptionalAvailable Version
collectOperatorStringOperator to apply a filter to outputs. Possible values are:

- Count

- Maximum

- Minimum

- None

- Sum
Optional58.0
conditionCriteriaStringCustom logic applied on the decision table columns to decide how the input fields are processed.Optional

Required when the condition type is Custom.
58.0
conditionTypeStringCondition logic for input fields. Possible values are:

- All

- Any

- Custom
Optional58.0
descriptionStringDescription of the decision table.Optional58.0
decisionResultPolicyStringResults policy to filter results of the decision table. Possible values are:

- AnyValue

- CollectOperator

- FirstMatch

- OutputOrder

- Priority

- RuleOrder

- UniqueValues
Optional
fullNameStringUnique name of the rule definition.Required58.0
isSetCollectOperatorBooleanFor internal use only.

Indicates whether the collectOperator is enabled (true) or not (false).
Optional58.0
isSetConditionCriteriaBooleanFor internal use only.

Indicates whether the conditionCriteria field is enabled (true) or not (false).
Optional58.0
isSetConditionTypeBooleanFor internal use only.

Indicates whether the conditionType field is enabled (true) or not (false).
Optional58.0
isSetDescriptionBooleanFor internal use only.

Indicates whether the description field is enabled (true) or not (false).
Optional58.0
isSetDecisionResultPolicyBooleanFor internal use only.

Indicates whether the DecisionResultPolicy field is enabled (true) or not (false).
Optional58.0
isSetFullNameBooleanFor internal use only.

Indicates whether the FullName field is enabled (true) or not (false).
Optional58.0
isSetParametersBooleanFor internal use only. Indicates whether the parameters field is enabled (true) or not (false).Optional58.0
isSetSetupNameBooleanFor internal use only.

Indicates whether the setupName field is enabled (true) or not (false).
Optional58.0
isSetSourceconditionLogicBooleanFor internal use only.

Indicates whether the sourceConditionLogic field is enabled (true) or not (false).
Optional58.0
isSetSourceCriteriaBooleanFor internal use only.

Indicates whether the sourceCriteria field is enabled (true) or not (false).
Optional58.0
isSetSourceObjectBooleanFor internal use only.

Indicates whether the sourceObject field is enabled (true) or not (false).
Optional58.0
isSetSourceTypeBooleanFor internal use only.

Indicates whether the sourceType is enabled (true) or not (false).
Optional58.0
isSetTypeBooleanFor internal use only.

Indicates whether the type field is enabled (true) or not (false).
Optional58.0
isSetUsageTypeBooleanFor internal use only.

Indicates whether the UsageType field is enabled (true) or not (false).
Optional58.0
parametersDecision Table Parameter Input[]Array of input and output fields for the decision table.Optional58.0
setupNameStringName of the decision table.Required58.0
sourceconditionLogicStringCustom logic to filter the decision table rows.Optional58.0
sourceCriteriaDecision Table Source Criteria Input[]Output array representation of source filters for the decision table rows, such as, fieldName, operators, valueType, and more.Optional58.0
sourceObjectStringObject containing business rules for the decision table to read.Required58.0
sourceTypeStringType of source to obtain decision table data. Possible values are:

- CsvUpload

- MultipleSobjects

- SingleSobject
Required58.0
statusStringStatus of the decision table. Possible values are:

- ActivationInProgress

- ActivationInProgress

- Draft

- Inactive
Required58.0
typeStringType of the decision table. Possible values are:

- HighVolume

- LowVolume
Optional58.0
usageTypeStringProcess type that uses the decision table. Possible values are:

- Pricing

- ProductEligibility
Optional58.0

Response body for POST

Decision Table Output

Decision Table Output

Output representation of the decision table details.JSON example for GET, POST, and PATCH

{
   "code":"200",
   "decisionTable":{
      "collectOperator":"Count",
      "conditionCriteria":"1 OR 2 OR 3",
      "conditionType":"Any",
      "decisionResultPolicy":"UniqueValues",
      "description":"Eligiblity of Products using Qualification Rules",
      "id":"0lDxx00000000BJ",
      "parameters":[
         {
            "fieldName":"IsDeleted",
            "isGroupByField":false,
            "isPriority":false,
            "operator":"Equals",
            "sequence":1,
            "usage":"Input"
         },
         {
            "fieldName":"CreatedById",
            "isGroupByField":false,
            "isPriority":false,
            "usage":"Output"
         },
         {
            "fieldName":"Title",
            "isGroupByField":false,
            "isPriority":false,
            "operator":"Equals",
            "sequence":3,
            "usage":"Input"
         },
         {
            "fieldName":"Id",
            "isGroupByField":false,
            "isPriority":false,
            "operator":"Equals",
            "sequence":2,
            "usage":"Input"
         }
      ],
      "setupName":"Product Qualificiation eligibility3",
      "sourceCriteria":[

      ],
      "sourceObject":"AccountFeed",
      "sourceType":"SingleSobject",
      "sourceconditionLogic":"1 AND 2 AND 3",
      "status":"Draft"
   },
   "isSuccess":true,
   "message":""
}

JSON example for DELETE

{
   "code":"200",
   "isSuccess":true,
   "message":""
}

Property NameTypeDescriptionFilter Group and VersionAvailable Version
codeStringResponse code from the API request.Small, 58.058.0
decisionTableDecision Table Definition OutputDetails of the decision table definition associated with the decision table.Small, 58.058.0
isSuccessBooleanIndicates whether the API request is successful (true) or not (false).Small, 58.058.0
messageStringError message when the API request fails.Small, 58.058.0

Request Body

{"setupName"=>"Product Qualificiation eligibility", "fullName"=>"ProductQualificationEligibility", "description"=>"Eligiblity of Products using Qualification Rules", "sourceObject"=>"AccountFeed", "status"=>"Draft", "conditionType"=>"Any", "conditionCriteria"=>"1 OR 2 OR 3", "parameters"=>[{"fieldName"=>"IsDeleted", "usage"=>"INPUT", "operator"=>"Equals", "sequence"=>"1"}, {"fieldName"=>"Id", "usage"=>"INPUT", "operator"=>"Equals", "sequence"=>"2"}, {"fieldName"=>"Title", "usage"=>"INPUT", "operator"=>"Equals", "sequence"=>"3"}, {"fieldName"=>"CreatedById", "usage"=>"OUTPUT"}]}

RESPONSES

status: Created

{"code":"200","decisionTable":{"id":"0lDHo0000008Pnt","parameters":[],"sourceCriteria":[]},"isSuccess":true,"message":""}