Skip to main content

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โ€‹

ScenarioOperationOutcome
Order ProcessingInsertAutomatically logs new orders into the database.
Daily ReportsInsert + Clear Table Before InsertReplaces prior report data with latest results.
Customer UpdatesUpdate with valueRefreshes existing customer information using a unique ID.
Product Catalog SyncInsert only if not existsAdds only new products from supplier data, prevents duplicates in catalog.

โœ… Quick Startโ€‹

  1. Add UpdateDatabase to your workflow.
  2. Select your connected database and table.
  3. Choose an operation type.
  4. Map workflow fields to table columns.
  5. Test the workflow and confirm database entries.