# IBM Db2 - Upsert rows action (batch)
This action allows you to perform an upsert (insert or update) of multiple rows in a single step.
The action checks if input data is in the table. If present, the system performs an update. Otherwise, it adds the data as a new row (insert).
# Input
- Table
- Required field
- Select the target table or view. You can also toggle the input to text mode, and enter the table or view name as text.
- Rows > Rows source list
- Required field
- The datapill that is the source of the batch of rows to insert into the table. Can originate from any trigger or action that returns a list datapill.
- Rows > Rows fields
- Optional field
- Dynamically-generated list of input fields, based on the columns in the target table. Map the data from the Rows source list datapill.
- Unique key
- Required field
- Select a unique key column to deduplicate rows.<br/ ><br/ >When you index the selected unique key, it improves the performance of the upsert action.
# Output
- Rows affected
- Number of upserted rows.
Last updated: 1/16/2026, 4:23:47 PM