Activities
Collection of Objects From String
This activity splits the InputString parameter based on the Separator parameter and builds a collection of Object items as output.
Activity Parameters
The Collection of Objects From String activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Input String (text box editor type) (type: string): the input string that you wish to separate with Separator parameter to obtain a collection. It can be manually written or bound to a declared variable.
- Separator (text box editor type with "¥" as the default value) (type: string): the separator used to separate the input string to obtain a collection. In the example above there can be seen the ; (semicolon) used as separator.
The Read Only Output variable are the possible output values that the activity will provide:
- Output Collection (type: collection<object>): outputs a collection of type object containing the separated elements from the input string.
- Output Count (type: int32): outputs an integer equal to the collection count.
Execution and activity usage:
- the activity splits the input string based on the given separator:
- the activity will output a collection, which will contain the elements retrieved after the split operation. The output collection can be iterated using a ForEach activity and the results displayed using Log Track Data activities:
- For Each: takes as input the output Collection from the Collection Of Objects From String activity:
- Log Track Data activities can output values for Key and Value items:
- For Each: takes as input the output Collection from the Collection Of Objects From String activity:
- The results will be displayed in the Track Data area:
Get Element From Collection
This activity returns an element from a specified index from the given Input Collection.
Activity Parameters
The Get Element from Collection activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Filter Index (text box editor type) (type: string): the index of the column from where you wish to extract the element (can be an integer or one of the name indexes specified in the 'Name indexes' parameter). If no value is specified, '0' is set by default.
- Input Collection (text box editor type) (type: collection<string>, string, any collection type): the input collection. This parameter can be bound to a collection type Output parameter from another activity. In the example above the Output Collection from a Select From Database activity is used.
- Name Indexes (text box editor type) (type: string): the name of the column indexes of the current collection, separated by comma ','. In this example, only the Company value is desired to be output separately from the Collection.
The Read Only Output variable are the possible output values that the activity will provide:
- Collection Count (type: int32): outputs an integer equal to the collection count.
- CSV String (type: string): outputs a string containing the elements of the collection separated by ','.
- Element (type: string): outputs the string value of the element indicated by the 'Filter index' parameter.
- Element Object (type: object): outputs the element indicated by the 'Filter index' parameter.
- the activity will extract the entire element from a collection, by default outputting the value into a CSV string:
- a next step is to extract different information if the Filter Index and Name Indexes fields have values (Filter Index field is the one with priority) and outputting the values into the Element variable (the variable's value was displayed using a Log Track Data activity). In our example, the value for the Company item should be displayed:
Initialize Collection
This activity initializes the specified collection (extended to any IEnumerable arguments/variables , e.g. List<T> , String[] , Collection<T>). This activity should be used prior to activities that add items to a specified collection, e.g. system activity AddToCollection
Activity Parameters
The Initialize Collection activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Items Collection (text box editor type) (type: selected collection type): specify the collection to be initialized. E.g. UsersArray is an IN argument of type String[] (array of strings). The type of the collection is selected when the activity is dragged from Activity tree panel to Designer panel.
- Number Of Items (text box editor type) (type: Int32): enter the length of the array (the number of items) to be initialized. Note: this parameter is only needed if type is array, like in the example mentioned above.