runDecisionMatrix

POST {{_endpoint}}/services/data/v{{version}}/actions/custom/runDecisionMatrix/:UniqueName

Decision Matrix Actions

Invoke a decision matrix in a flow with the Decision Matrix Actions. A decision matrix is a user-defined table where you can look up an output based on the inputs you provide.

For example, you can look up a candidate’s eligibility to avail medical insurance in a decision matrix based on the candidate’s age and gender.

These actions are available in API version 55.0 and later.

Supported REST HTTP Methods

URI/services/data/v55.0/actions/custom/runDecisionMatrix/{UniqueName}

Note

The value of UniqueName is the unique identifier of the record, which is sourced from the name of a decision matrix.

FormatsJSONHTTP MethodsPOSTAuthenticationAuthorization: Bearer token

Inputs

Vary depending on the selected decision matrix.

Outputs

Vary depending on the inputs of the selected decision matrix.

Usage

Sample Request

Here’s an example POST request that has the inputs, such as, age and state:

{
   "inputs":[
      {
         "age":"25",
         "state":"NY"
      },
      {
         "age":"25",
         "state":"CA"
      },
      {
         "age":"",
         "state":"WA"
      }
   ]
}

Sample Response

Here’s an example response that has the premium and tax values based on the inputs provided in the example request.

[
   {
      "actionName":"premiumTaxLookup",
      "errors":null,
      "isSuccess":true,
      "outputValues":{
         "premium":2400.0,
         "tax":200.0
      }
   },
   {
      "actionName":"premiumTaxLookup",
      "errors":null,
      "isSuccess":true,
      "outputValues":{
         "premium":2400.0,
         "tax":200.0
      }
   },
   {
      "actionName":"premiumTaxLookup",
      "errors":[
         {
            "statusCode":"REQUIRED_FIELD_MISSING",
            "message":"Missing required input parameter: age",
            "fields":[
            ]
         }
      ],
      "isSuccess":false,
      "outputValues":null
   }
]

Request Body

{"inputs"=>[{"myColumnInput"=>"One"}]}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

[{"actionName":"myDecisionMatrix","errors":null,"isSuccess":true,"outputValues":{"myColumnOutput":"1"},"version":1}]