Create/Update Record
1. Overview
The "Create/Update Record" step allows you to add new records or modify existing records in a specific table. This step is ideal for automating and controlling data insertion and updates efficiently.
![](https://framerusercontent.com/images/VHD504TcG9InxCcqiZcZATGjRaM.webp)
2. Initial Configuration
Table Selection: First, select the table where records will be created or updated. This selection determines the structure of the data to be manipulated.
Transformation Method: Choose between using an SQL query or one of Mitra's visual development views (Data Analysis VIEW or Registration VIEW) to define the data to be processed.
3. Update Key Definition
Update Key: Decide whether the affected records will be new or if existing records should be modified.
Key Options:
ID: Use the ID as the key to identify and modify specific records. This option is mandatory for tables with an integer or varchar ID.
Description: Alternatively, you can use the Description as the update key, depending on your table's structure.
4. Attribute Mapping
After defining the query or view that will return the data, map the result columns to the attributes of the selected table.
Column Mapping: The columns from your query or view will be listed, and you can associate them with the corresponding attributes in the table. For instance, if you're working with the "Partners" table, which includes attributes like ID, Description, Monthly Fee, and Entry Date, you can map each result column to its corresponding attribute.
Important Notes:
Adding Records to Tables with Auto-Increment IDs: For tables with auto-increment IDs, the ID field is not mappable, as the system will generate the ID automatically.
Adding Records to Tables with Integer or Varchar IDs: In these cases, the ID must be provided and mapped.
Editing Existing Records: When the update key is the ID, it is mandatory to map the table's ID field to ensure the correct records are updated.
5. Execution Log
The "Create/Update Records" step includes a detailed log that tracks all executions, providing the following information:
Executing User: The user who initiated the action.
Date and Time: When the action was executed.
Execution Time: Duration of the operation.
Summary: Displays what was accepted or rejected during the process.
Rejection Reasons: Details why specific records were not processed, allowing for corrections and adjustments.