Flatten List
Description
Returns each element of a list as an individual record.
Use
- Include indexes:
- Each Flatten List function with the include indexes box checked adds a new output field with the corresponding list element index starting from 1.
- Input field:
- Select a field. (List)
- Enter a output field name:
- If the Include indexes box has been checked, the first output name is the field name for the indexes.
- The second output name is the name of the flattened list of elements.
- A list of values of data type tuple also extracts the tuple and has as many result output fields as the tuple field count.
Examples
List_example | Flatten list example | element index |
---|---|---|
[Fred, Jackie, Mike] | Fred | 1 |
Jackie | 2 | |
Mike | 3 |
Example 1:
The RegExtract function is used and there are multiple matches which are returned in a list of strings. Use the Flatten List function to break apart the list to see all the results. It is then possible to follow up with Filters or other functions as needed.
Example 2:
The SplitPDF function is used which results in a list of binaries. Use the Flatten List function to separate the list data into individual binary images.
Example 3:
A range of ID values (1-10) is needed. Create a ConstantString with the value "1,2,3,4,5,6,7,8,9,10". Use the function TokenizeList with a "," as the separator which creates a list of the values. Use the Flatten List function to separate the list data into individual values.