Newer Version Available
Decision Table Actions
Decision tables provide outcomes based on your business rules. For more information about invoking decision tables, see Invoke a Decision Table in Salesforce Help.
This object is available in API version 51.0 and later.
Supported REST HTTP Methods
- Formats
- JSON
- HTTP Methods
- GET, POST
- Authentication
- Authorization: Bearer token
The specific URI endpoint and the structure of the JSON payload depend on whether a dataset link is configured for your decision table. To check if a dataset link is enabled for your decision table, you can query the DecisionTableDataLink table. If an entry for your decision table exists in this table, a dataset link is active. For more information about dataset links, see DecisionTableDatasetLink.
Decision Table Without Dataset Link
If your decisionTableId isn't found in the DecisionTableDatasetLink table, you must append _Default to your decision table's API name to construct the endpoint URI.
- URI without dataset link
- /services/data/vXX.X/actions/custom/decisionTableAction/dtapi_Default
Decision Table With Dataset Link
If your decisionTableId is present in the DecisionTableDatasetLink table, the endpoint URI uses the API name of the dataset link.
- URI with dataset link
- /services/data/vXX.X/actions/custom/decisionTableAction/dslapiname
Inputs
You can choose to invoke a decision table with or without dataset link.
To execute a Decision Table with dataset link, specify the list that contains the source object and its corresponding field to be used in the dataset link that is associated with the decision table.
| Input | Details |
|---|---|
| sObjectType |
|
Outputs
| Output | Details |
|---|---|
| outcomeList |
|
| outcomeType |
|
| singleOutcome |
|
Usage
JSON Sample Request without dataset link
When you invoke a decisionTableAction without a dataset link, the request contains an array of input objects.
1{
2 "inputs" : [
3 {
4 "Product__c": "Cloud Kicks",
5 "Price__c": 1000
6 }
7 ]
8}JSON Sample Request with dataset Link
When you invoke a decisionTableAction with a dataset link, the input objects in the request are nested within another object, which is typically the name of the transaction object.
1{
2 "inputs" : [
3 {
4 "Transaction__c" : {
5 "Product__c": "Cloud Kicks",
6 "Price__c": 1000
7 }
8 }
9 ]
10}JSON Sample Request with dataset Link containing multiple source objects
1{
2 "inputs" : [
3 {
4 "Transaction__c" : {
5 "Product__c": "Cloud Kicks",
6 "Price__c": 1000
7 }
8 }
9 {
10 "Catalog__c" : {
11 "name": "Highest_Price_Point_c",
12 "value": "500",
13 }
14 }
15 ]
16}JSON Sample Response
1[{
2 “outcomeType” : “SINGLE MATCH”,
3 “singleOutcome”: { “Points”: 100 },
4 "outcomeList" : [
5 {
6 “Points”: 100
7 }
8 ]
9}]