Add row to datatable
Function: Add row to datatable
This action allows you to add a new row of information to an existing data table within your application. You can specify a unique identifier for the row and provide the data for each column in that row.
Input
- Datatable: The specific data table where you want to add the new row. This is a required input.
- Code: A unique identifier for the new row. This is often used to link the row to external data or provide a meaningful reference. For example, a product SKU or a customer ID. This is a required input.
- Row data: This is a collection of information for the new row, where you specify the data for each column. For each piece of data, you need to provide:
- Column code: The unique identifier of the column in the data table where this data should be placed.
- Data: The actual value you want to store in that column for the new row.
Output
- Row id: The unique identifier that the system assigns to the newly created row in the data table. You can store this ID in a variable (by default named "ADDED_ROW_ID") to use it in subsequent actions.
Execution Flow
Real-Life Examples
Example 1: Adding a New Product to Inventory
Imagine you have an inventory management application and want to add a new product.
- Inputs:
- Datatable:
Products - Code:
PROD-LAPTOP-001 - Row data:
Column code:ProductName,Data:UltraBook X1Column code:SKU,Data:UBX1-2023Column code:Price,Data:1499.99Column code:StockQuantity,Data:150
- Datatable:
- Result: A new row representing "UltraBook X1" is added to your
Productsdata table. The unique ID of this new row (e.g.,a1b2c3d4-e5f6-7890-1234-567890abcdef) is stored in a variable namedADDED_ROW_ID.
Example 2: Registering a New Customer
You're building a CRM system and need to add a new customer record when a user signs up.
- Inputs:
- Datatable:
Customers - Code:
CUST-98765 - Row data:
Column code:FirstName,Data:MariaColumn code:LastName,Data:GonzalesColumn code:Email,Data:[email protected]Column code:SignUpDate,Data:2023-10-26
- Datatable:
- Result: A new customer record for Maria Gonzales is created in your
Customersdata table. The unique ID of this new row (e.g.,f0e9d8c7-b6a5-4321-fedc-ba9876543210) is stored in a variable namedADDED_ROW_ID.
Example 3: Logging a System Event
Your application needs to log specific events, such as a user login attempt, into an audit trail.
- Inputs:
- Datatable:
SystemLogs - Code:
LOGIN-ATTEMPT-USER123-202310261030 - Row data:
Column code:EventType,Data:User LoginColumn code:Username,Data:user123Column code:Timestamp,Data:2023-10-26 10:30:00Column code:Status,Data:SuccessColumn code:IPAddress,Data:192.168.1.100
- Datatable:
- Result: A new log entry detailing the user login attempt is added to the
SystemLogsdata table. The unique ID of this new row (e.g.,1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d) is stored in a variable namedADDED_ROW_ID.