Restructure Lists
Redefine your list structure by reshaping attribute values.
Use case
You have a list where the current structure isn't effectively supporting your data analysis & transition decision making needs. You want to remap fields, flatten nested items, or count instances within your list to provide more meaningful insights.
Overview
The Restructure Lists transform offers versatile functionality to modify the structure of your list. Whether it's remapping fields for better clarity, flattening for easier data extraction, or counting to reveal data trends, this transform is your ally in data restructuring.
Parameters
List to Transform
The list that you would like to restructure.
Input Field
The item in the list you would like to transform.
Transformation Method
The transformation method to be applied on the input field. (options described below)
Output Field
The new field where the transformed value will be stored.
Append Action Type
The type of appending action if the method is set to append
.
Append Value
The value to be added if the Append Action Type
is Append Value
.
Append Field
The field to be joined if the Append Action Type
is Append Field
.
Delimiter for Append
The delimiter to be used in the Append
method
Field for Concatenation
The field to be used in the concatenation operation if the method is Concatenate
.
The parameters listed under Field Actions
are all required. Those listed under Transformation Parameters
are optional and are needed only when append
or concatenate
are selected for the Transformation Method
.
Usage
Let's break this down into specific use-case examples, to show how each of these methods can be used within the Restructure Lists
Transform.
Input List
Assume that we have a list of objects called my_list
that looks like this:
Transformation Methods
Here is the breakdown of the different transformation methods, and when you'd want to use them:
Retain Original Value: The input field remains unchanged in the output. Ideal when you need to preserve the original data.
Append to Existing Value: The output field shows the original input field value appended with specified values or fields. Perfect when you need to combine data from multiple sources.
Count the Number of Elements: The output field displays the correct count of items in the input list. Use this when you need to know the size of your list.
Concatenate Nested Property in List: The output field shows a string which is a concatenation of the specified field values in the input list.
Flatten List of Strings: If your input list contains sub-lists, this method will return a flattened list with no sub-lists.
Let's use the list we declared to define a set of fields we want to restructure for this action, using the different transformation methods, and show how we can match these to their Jinja2 equivalent.
Results Output
After all these actions are performed, your newly transformed list would output looking like this:
Now that you're familiar with the Restructure Lists
transform, you can start applying it to your lists to enhance your data processing. Remember, restructuring is not just about changing the layout of your data, but about making it more useful and accessible for your needs.
Last updated