Step Details
|
Introduced in Version | 4.0.0 |
Last Modified in Version | 8.8.71075 |
Location | Data > Text |
The Add Item to List step adds an item to a list if it is the same datatype with an index starting from zero. The step requires both the input item and the list item to be the same datatype; otherwise, an error will be thrown.
Properties
Data
Property | Description | Data Type |
---|
AddToListPosition | The position where the new item will be added. The new item can be added at the start, end, or at a specified index. | --- |
ListType | The datatype for the added list. | --- |
Inputs
Property | Description | Data Type |
---|
Index | Available if AddAtIndex is selected for the AddToListPosition Property | Int32 |
New Item | The item to be inserted into the list. The item must match the datatype of the list, otherwise an error will be thrown. | Varies, dependent on the ListType Property |
Original List | The list that the new item will be added to. | Varies, dependent on the ListType Property |
Outputs
Property | Description | Data Type |
---|
New List | TA list which contains the newly added item | Varies, dependent on the ListType Property. |
Example Inputs and Outputs
New Item | AddToList Position | Original List | Output |
---|
Hello World | AddToBegining | {"FirstItem", "SecondItem", "ThirdItem"} | {"Hello, World", "FirstItem", "SecondItem", "ThirdItem"}
|
Hello World | AddToEnd | {"FirstItem", "SecondItem", "ThirdItem"} | {"FirstItem", "SecondItem", "ThirdItem" Hello, World"} |
Newly Inserted Item | AddAtIndex, 2 | {"FirstItem", "SecondItem", "ThirdItem", "FourthItem"} | {"FirstItem", "SecondItem", "Newly Inserted Item", "ThirdItem", "FourthItem"}
|

Add Item to List
The Add to List Step is used to append a List by adding a new Item of the matching Data Type to that List. A new list with the added Item will be created.
Inputs | Description |
---|
New Item | The new item which will be appended to the List. |
Original List | The inputted list which will be manipulated. |
- From the Decisions Studio, select CREATE FLOW from the Global Action Bar and select Flow. Name the Flow and click CREATE.
- Click SETUP INPUT DATA and select DEFINE.
- On the Input Data window, enter "ListData" under NAME and select String [Text] under TYPE. Select the checkbox for IS LIST.
- Under INPUT, click the pencil icon. Then, select Constant as the mapping type and enter "Test 1", "Test 2", and "Test 3" separating each value by line. Click DONE. Click Save and close the window.

- From the Toolbox panel, navigate to DATA > LIST and add an Add Item to List step to the Start step.
- From the DATA category on the Properties panel, select AddToEnd for the AddToListPosition option and String [Text] for ListType.
The AddToListPosition Property allows users to dictate where the new value is placed in the List. Users have the option to either AddToBeginning or AddToEnd.AddListToPosition | Description |
---|
AddToBeginning | Inserts the item at the beginning of the List. |
AddToEnd | Inserts the item at the end of the List. |

- Under the INPUTS category, click Unknown next to the Original List field and select Select From Flow. Select List Data and click DONE. Enter "Test 4" in the New Item field.
.png)
- From the Flow Designer, select the Debug link from the top Action bar.
- Click START DEBUGGING. Select the step and verify that the New Item was added to the Original List.

Common Errors
Source array was not long enough. Check the source index, length and the array's lower bounds.
This error appears if the array's length is less than the value used for the Index. The step will throw the following error. Ensure that the value for the index is less than or equal to the size of the array.
Exception Message:
Exception Message: Error running step Add Item to List Step 1[AddItemToListStep] in flow [Example Flow]: Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray')
Input Values:
-- No Data --
Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Add Item to List Step 1[AddItemToListStep] in flow [Example Flow]: Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray') ---> System.ArgumentException: Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray')
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
at DecisionsFramework.Design.Flow.CoreSteps.AddItemToListStep.Run(StepStartData data)
at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData)
at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)
--- End of inner exception stack trace ---
Example:
New Item
| AddToList Position
| Original List | Output |
---|
Hello World | AddAtIndex, 5 | {"FirstItem", "SecondItem", "ThirdItem"}
| EXCEPTION MESSAGE
|
