How to Use the Splitter Component to Create Multiple Shipments
The Splitter component lets you split orders into categories by using one or more of the attributes on the line items to identify the categories to use for the split. The default distinguishers for splitting orders are shipping_method_id and shipping_address_id keys. You can specify other keys to use as criteria in the Input Distinguishers box on the Component Properties tab that you can display by double-clicking the Splittercomponent in the Pipeline Editor.
Each line in the following table represents a dictionary to which an element of the SimpleListobject is pointing. The dictionaries also include a key, ItemIndexes, that is a reference to a SimpleListobject. Each element in the SimpleListobject is an index into the LineItems dictionary that contains line items in the actual order.
The following example has four line items, numbered zero through three. The following table contains a list of some of their attributes.
shipping_method_id |
shipping_address_id |
shipping_date |
catalog |
vendor |
---|---|---|---|---|
A |
Home |
ASAP |
A |
A |
A |
Home |
ASAP |
A |
A |
B |
Work |
ASAP |
B |
B |
A |
Work |
3/1 |
C |
B |
If you split the previous information by the distinguishers shipping_method_id and shipping_address_id, to an output structure called _shipments, a SimpleList of dictionaries will be on your order form named ""shipments"" with the following entries.
shipping_method_id |
shipping_address_id |
ItemIndexes |
---|---|---|
A |
Home |
0,1 |
B |
Work |
2 |
A |
Work |
3 |
If you sort the four line items by vendor, to an output structure called "_Vendors", a SimpleList of dictionaries will be on your order form named ""_Vendors"" with the following entries.
vendor |
ItemIndexes |
---|---|
A |
0,1 |
B |
2,3 |