Newer Version Available

This content describes an older version of this product. View Latest

Decision Table Actions

Invoke a decision table.

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 default Decision Table without dataset link, specify the input fields that were defined at the time of the Decision Table creation in the flow. The input fields are optional. However, you must specify at least one field as the input parameter. Use the GET method to retrieve input parameters of a Decision Table definition.

For example, to decide discount percentage for products, you can pass the input parameters, including Brand__c, Highest_Price_Point_c, and Lowest_Price_Point_c.

Note

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
Type
sObject
Description
The name of the dataset link’s object whose records, the decision table must provide an outcome for.

Outputs

Output Details
outcomeList
Type
sObject
Description
Outcome list that stores two or more outcomes provided by the decision table.

A decision table that is invoked by the Decision Table custom invocable action can provide up to 50 outcomes.

Note

outcomeType
Type
string
Description
Indicates the type of outcome provided by the decision table after the request is successful. Valid values are:
  • Multiple Match—Outcome returns multiple matches.
  • No Match—Outcome returns no match.
  • Single Match—Outcome returns single match.
singleOutcome
Type
sObject
Description
Stores the outcome in case a single outcome is provided by the decision table. In case multiple outcomes are provided, it stores one of the outcomes.

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}]