Ask AI
Skip to main content

Add column to datatable

Function: Add column to datatable

This action allows you to dynamically add a new column to an existing data table component on your page. This is useful when you need to display additional information that wasn't part of the original table design, or when you want to customize the table's appearance based on user actions or data.

Input

  • UI element (Datatable): The specific data table component on your page where you want to add the new column.
  • Code (Text): A unique identifier for the new column. This is used internally by the platform to reference the column.
  • Label (Text): The display name for the column that users will see in the table header.
  • Visible (True/False): Determines whether the new column should be immediately visible to users. If set to 'True' (default), the column will appear. If 'False', it will be hidden but still part of the table structure.

Output

This action does not produce a direct output value. Instead, it modifies the specified data table by adding the new column to its structure.

Execution Flow

Real-Life Examples

Example 1: Adding a "Status" column to a "Tasks" table

  • Scenario: You have a "Tasks" data table displaying project tasks. You want to add a new column to show the current "Status" of each task (e.g., "Pending", "In Progress", "Completed").
  • Inputs:
    • UI element (Datatable): Tasks_Table
    • Code (Text): task_status
    • Label (Text): Status
    • Visible (True/False): True
  • Result: A new column titled "Status" is added to the Tasks_Table, ready to display status information for each task.

Example 2: Adding a hidden "Internal ID" column for administrative purposes

  • Scenario: Your "Customers" data table needs to store an internal customer ID for backend processes, but you don't want this ID to be visible to regular users.
  • Inputs:
    • UI element (Datatable): Customers_List_Table
    • Code (Text): internal_customer_id
    • Label (Text): Internal ID
    • Visible (True/False): False
  • Result: A new column named "Internal ID" is added to the Customers_List_Table. This column is not visible to users but can be accessed and used by other actions or logic within the application.

Example 3: Adding a "Last Modified Date" column to a "Documents" table

  • Scenario: You manage a "Documents" data table and want to track when each document was last updated.
  • Inputs:
    • UI element (Datatable): Documents_Overview_Table
    • Code (Text): last_modified_date
    • Label (Text): Last Modified
    • Visible (True/False): True
  • Result: A new column labeled "Last Modified" is added to the Documents_Overview_Table, providing a place to display the last modification timestamp for each document.