You are here:
Find Routes with Fewest Splits Using OCI Action
In Salesforce Order Management, this core action finds the minimum number of fulfillment locations needed to complete an order by evaluating inventory availability across locations. When multiple combinations of locations can fulfill the order, this action returns multiple routing options. To limit the number of returned options, specify a maximum number of allowed location splits.
Required Editions
| Available in: Lightning Experience |
| View supported editions. |
| This feature requires the Salesforce Order Management add-on. To purchase, contact your Salesforce account executive. |
This action combines the Omnichannel Inventory Get Availability action and the Order Management Find Routes with Fewest Splits action. Instead of calling Get Availability and including the output in the Find Routes with Fewest Splits input, call this action and specify a location or location group to fulfill each ordered product.
By default, this action executes up to 1,000,000 times, stopping when it hits 10,000 results. This action handles the inventory check.
In Flow Builder, add an Action element to your flow. Select the Order Management category, and search for Find Routes With Fewest Splits Using OCI.
Set Input Values
Use values from earlier in the flow to set the inputs.
| Input Parameter | Description |
|---|---|
| Find Routes With Fewest Splits Using OCI Input | This input is an Apex-defined variable of class ConnectApi.FindRoutesWithFewestSplitsUsingOCIInputRepresentation. The findRoutesWithFewestSplitsUsingOCIInputs field is a list of Apex-defined variables of class ConnectApi.FindRoutesWithFewestSplitsGroupUsingOCIInputRepresentation. Each of the variables represents one order and includes these fields:
|
Store Output Values
Use output values later in the flow.
| Output Parameter | Description |
|---|---|
| Find Routes With Fewest Splits Using OCI Output | This output is an Apex-defined variable of class ConnectApi.FindRoutesWithFewestSplitsUsingOCIOutputRepresentation, which contains inventory availability data and the sets of fulfillment locations that meet the requirements. The variable has one field: results. This field is a list of Apex-defined variables of class ConnectApi.FindRoutesWithFewestSplitsWithInventoryOutputRepresentation, each of which represents the output for one order, and includes these fields:
|
Usage
To set up the Find Routes With Fewest Splits Using OCI Input:
- Use assignment elements to set the values for the locationGroupIdentifier, quantity, and stockKeepingUnit field values on one or more ConnectApi.FindRoutesWithFewestSplitsUsingOCIItemInputRepresentation variables.
- Use assignment elements to add the ConnectApi.FindRoutesWithFewestSplitsUsingOCIItemInputRepresentation variables to the orderedItems field on a ConnectApi.FindRoutesWithFewestSplitsGroupUsingOCIInputRepresentation variable.
- Optionally, use an assignment element to set the value for the maximumNumberOfSplits field on the ConnectApi.FindRoutesWithFewestSplitsGroupUsingOCIInputRepresentation variable.
- Use an assignment element to add the ConnectApi.FindRoutesWithFewestSplitsGroupUsingOCIInputRepresentation variable to the findRoutesWithFewestSplitsUsingOCIInputs field on a ConnectApi.FindRoutesWithFewestSplitsUsingOCIInputRepresentation variable.
- Repeat steps 1–4 for each order that you want to include in the action, adding the inputs to the same ConnectApi.FindRoutesWithFewestSplitsUsingOCIInputRepresentation variable.
- Use the ConnectApi.FindRoutesWithFewestSplitsUsingOCIInputRepresentation variable in the action input.

