Expression Set Creation

POST {{_endpoint}}/services/data/v{{version}}/connect/business-rules/expression-set

https://developer.salesforce.com/docs/atlas.en-us.246.0.industriesreference.meta/industriesreference/connectresourcesbrecreateexpression_set.htm

Expression Set Creation (POST)

Creates an expression set in Business Rules Engine. An expression set performs a series of calculations by using lookup tables and user-defined variables and constants.Resource

/connect/business-rules/expression-set

Resource Example

https://yourInstance.salesforce.com/services/data/v59.0/connect
/business-rules/expression-set

Available version

58.0

Requires Chatter

No

HTTP methods

POST

Request body for POST

Root XML tag

JSON example

{
  "name": "CTX Mapping ES",
  "apiName": "CTX_Mapping_ES_1",
  "description": "...",
  "usageType": "Bre",
  "contextDefinitions": [
    {
      "id": "11Oxx0000006PcLEAU"
    }
  ],
  "versions": [
    {
      "name": "CTX_Mapping_ES_1 V1",
      "apiName": "CTX_Mapping_ES_1_V1",
      "description": "Sample CTX Mapping",
      "startDate": "2022-11-14T20:31:47.000+0000",
      "endDate": "2022-11-14T20:31:47.000+0000",
      "versionNumber": 1,
      "rank": 1,
      "enabled": true,
      "showExplExternally": false,
      "steps": [
        {
          "name": "Condition1",
          "description": "Condition step for conditions w.r.t product",
          "sequenceNumber": 1,
          "resultIncluded": true,
          "stepType": "Condition",
          "conditionExpression": {
            "expression": "productName == 'iPhone' && productColor == 'Red'",
            "resultParameter": "condition_output__1"
          }
        }
      ],
      "variables": [
        {
          "name": "productName",
          "collection": false,
          "dataType": "Text",
          "description": "productName",
          "input": true,
          "output": false,
          "type": "Variable"
        },
        {
          "name": "productColor",
          "collection": false,
          "dataType": "Text",
          "description": "productColor",
          "input": true,
          "output": false,
          "type": "Variable"
        },
        {
          "name": "condition_output__1",
          "dataType": "Boolean",
          "description": "condition_output__1",
          "input": false,
          "output": true,
          "resultStep": "Condition1",
          "type": "Variable"
        }
      ]
    }
  ]
}

Properties

NameTypeDescriptionRequired or OptionalAvailable Version
apiNameStringUnique name of the expression set.Required58.0
context​DefinitionsContext Definition InputList of context definitions in an expression set.Optional58.0
descriptionStringDescription of the expression set.Optional58.0
nameStringName of the expression set.Required58.0
usage​TypeStringUsage type of the expression set.

Valid values are:

- AiAccelerator​SubscriberChurn​Prediction—Used for Industries Einstein

- Bre—Used for Business Rules Engine

- CustomLoyalty—Used for Loyalty Management

- DefaultPricing—Used for Pricing Plans in Enterprise Product Catalog (EPC) by Communications Cloud

- Qualification—Used for Industries Communications, Media, and Energy (CME)

- RecordAlert—Used for Financial Services Cloud

- ShipAndDebit—Used for Manufacturing Cloud

- TierProcessing—Used for Loyalty Management

- TransactionJournal—Used for Loyalty Management

- WarrantyClaim—Used for Manufacturing Cloud
Required58.0
versionsExpression Set Version Input[]List of the expression set versions.Optional58.0

Response body for POST

Expression Set Output

Request Body

{"apiName"=>"myExpressionSet2", "name"=>"myExpressionSet3", "usageType"=>"Bre", "versions"=>[{"apiName"=>"myExpressionSet_V1", "enabled"=>false, "id"=>"9QMHo000000LBjOOAW", "name"=>"myExpressionSet V1", "showExplExternally"=>false, "startDate"=>"2023-09-06T10:35:11.000Z", "versionNumber"=>1}]}

RESPONSES

status: Created

{"apiName":"myExpressionSet","contextDefinitions":[],"id":"9QLHo000000LBjJOAW","name":"myExpressionSet","usageType":"Bre","versions":[{"apiName":"myExpressionSet_V1","enabled":false,"id":"9QMHo000000LBjOOAW","name":"myExpressionSet V1","showExplExternally":false,"startDate":"2023-09-06T10:35:11.000Z","steps":[],"variables":[],"versionNumber":1}]}