UpdateDatabase
๐ฏ Purposeโ
Writes input data into a database table. Supports insert, unique insert, and update operations without writing SQL.
โ๏ธ Configurationโ
Database Connectionโ
- Database โ Select a connected database system.
- Table โ Choose the target table within the selected database.
Operation Modeโ
-
Database Operation
- Insert โ Add a new record.
- Insert only if not exists โ Add only if no matching record exists.
- Update with value โ Modify existing records based on a key column.
-
Exclude Properties โ Fields ignored during duplicate checks (only for Insert only if not exists).
-
Clear Table Before Insert โ Optional toggle to truncate (clear) the table before inserting (use cautiously).
-
Key Column Name โ Column used to identify which record to update (only for Update with value).
Data Mappingโ
- Properties โ Map workflow fields to database columns using name-to-column pairs.
- Name - Name of the property in the workflow input.
- Save Into - Name of database table column to save that value into.
๐ค Outputโ
- No output. Updates are written directly to the selected database.
๐ Best Practicesโ
- Mapping Accuracy: Verify field names match column names exactly.
- Operation Choice:
- Use Insert for logging or appending data.
- Use Insert only if not exists for master data.
- Use Update with value for maintaining current states.
- Performance: Avoid truncating large tables during active hours.
- Testing: Always test with sample data before running production updates.
๐งช Test Casesโ
- Given: Insert mode with valid mapping โ Expected: New records created.
- Given: Insert only if not exists with duplicates โ Expected: No duplicate records.
- Given: Update with key column โ Expected: Target records updated correctly.
๐๏ธ Common Use Casesโ
| Scenario | Operation | Outcome |
|---|---|---|
| Order Processing | Insert | Automatically logs new orders into the database. |
| Daily Reports | Insert + Clear Table Before Insert | Replaces prior report data with latest results. |
| Customer Updates | Update with value | Refreshes existing customer information using a unique ID. |
| Product Catalog Sync | Insert only if not exists | Adds only new products from supplier data, prevents duplicates in catalog. |
โ Quick Startโ
- Add UpdateDatabase to your workflow.
- Select your connected database and table.
- Choose an operation type.
- Map workflow fields to table columns.
- Test the workflow and confirm database entries.