Data mapping
Copy chosen properties of the table or a variable into new names.
In both apps
WarpX Browser
WarpX Phone
Data mapping reshapes data: it copies each source property you name to one or more destination properties, and drops the rest. Use it to rename table columns into the field names an API expects before you send them.
Settings
- Data source
Map every row of the workflow's table, or the value of a variable.
ExampleTable- Variable namewhen Data source is Variable
The variable to map. It must hold an object or a list of objects.
Exampleorders- Edit data map
Opens the map. Each row is a Source property and a Destination property; click Add source and Add destination to build it. Dots make nested paths, and one source can feed several destinations.
Examplename | customer.fullName email | customer.email email | contactEmail
- Assign to variable
Store the result in a variable.
ExampleChecked- Variable namewhen Assign to variable is ticked
The variable that receives the result.
Examplecustomers- Insert to table
Put the whole result into one cell of the table.
ExampleUnchecked- Select columnwhen Insert to table is ticked
The column that receives the result.
Examplemapped
Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.
What it hands on
For the table or a list, a list with one mapped object per item; for an object, one mapped object. It goes to the variable or column you chose, and on as {{prevBlockData}}. The source itself is not changed.
Example: Rename scraped columns for an API
- Start
- Open URL
- Get text
- Data mapping
- HTTP request
- Collect rows into table columns
nameandemail, for example with Get text and Insert to table. - Add Data mapping and keep Data source on Table.
- Click Edit data map. Add source
namewith destinationcustomer.fullName, and sourceemailwith destinationscustomer.emailandcontactEmail. - Tick Assign to variable and type
customers. - Add HTTP request and send
{{variables.customers}}as the body.
Good to know
- A source property an item does not have is skipped for that item, so its destinations are missing from the result.
- A variable source that does not exist stops the block with
Cant find "orders" variable. Text or a number stops it too: only objects and lists can be mapped. - The source variable name is used exactly as typed; references are not filled in there.
See also
- Sort data — Sort the table's rows or a list variable, up or down.
- HTTP request — Sends an HTTP request to a URL and can store the response.
- Insert data — Set variables and add values to the workflow's table, several at once.