Data Mapping
Map data from one variable or table to another variable or table while preserving the values but allowing key changes.
Data Source
The data source for mapping can be a table or a variable.
Edit data Map
The data map is where I match source fields to destination fields using dot notation. A source can have multiple destinations.
Assign to Variable
Assign the mapped value to a Variable.
- Variable Name: Name of the variable to assign the value to. This field appears when I select
Assign to Variable
.
Insert into Table
Insert the mapped value into a column in a Table.
- Select Column: The column where the value will be inserted. This field appears when I select
Insert into Table
.
Practical Example
I have an array of data in Global Data
as follows:
I want to assign the values of the address
and name
fields to a variable b
, but rename the fields to Address
and fullName
.
First, I use the Insert Data
node to assign the values from Global Data
to a variable a
:
Then, in the Data Mapping
node, I configure the data source as the variable a
, select Edit Data Map
to rename the address
key to Address
and the name
key to fullName
, and assign the mapped values to the variable b
. The node configuration looks like this:
The node cluster is as follows:
After running, the result shows variable a
with the original values and variable b
with the mapped data from variable a
as follows: