Ask AI
Skip to main content

Add column to datatable

Function: Add column to datatable

This action allows you to enhance an existing data table component on your application page by adding a brand new column. You can define a unique identifier for this column, set its display name, and decide if it should be immediately visible to your users. This is useful for displaying new pieces of information in your tables without needing to write any code.

Input

  • UI element (PART): This is the specific data table component on your page where you want to add the new column. You'll select it directly from your application's user interface.
  • Code (STRING): A unique, short identifier for your new column. Think of it as the internal name for the column. This is required.
  • Label (STRING): The user-friendly name that will be displayed as the column header in your data table. This is required.
  • Visible (BOOLEAN): Determines whether this new column should be immediately visible to users when the data table loads. By default, it will be set to True (visible).

Output

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

Execution Flow

Real-Life Examples

Example 1: Adding a "Status" column to an "Orders" table

  • Inputs:
    • UI element: Orders_Table (a data table component displaying customer orders)
    • Code: orderStatus
    • Label: Order Status
    • Visible: True
  • Result: A new column titled "Order Status" is added to the Orders_Table and is immediately visible to users. This column can then be populated with data like "Pending", "Shipped", or "Delivered".

Example 2: Adding a "Last Modified Date" column to a "Products" table, initially hidden

  • Inputs:
    • UI element: Products_List_Table (a data table component showing product details)
    • Code: lastModifiedDate
    • Label: Last Modified
    • Visible: False
  • Result: A new column titled "Last Modified" is added to the Products_List_Table. It is not immediately visible to users but can be enabled later through user preferences or other actions. This is useful for internal tracking without cluttering the default view.

Example 3: Adding a "Department" column to an "Employees" table

  • Inputs:
    • UI element: Employee_Directory_Table (a data table component listing employees)
    • Code: employeeDepartment
    • Label: Department
    • Visible: True
  • Result: A new column titled "Department" is added to the Employee_Directory_Table and is visible to users. This allows for displaying which department each employee belongs to.