Ask AI
Skip to main content

Set visibility of a column

Function: Set visibility of a column

This action allows you to dynamically show or hide a specific column within a Data Table component on your application's page. This is useful for tailoring the information displayed to different users or based on certain conditions, without changing the underlying data. For example, you might want to hide sensitive information from some users or reveal additional details only when relevant.

Input

  • Datatable: The specific Data Table component on your page where you want to adjust a column's visibility. You select this directly from your application's UI elements.
  • Column: The unique identifier (often called a 'code' or 'ID') of the column within the selected Data Table whose visibility you wish to change. This ensures the action targets the correct column.
  • Visible?: A simple choice of 'True' or 'False'.
    • Select 'True' to make the column visible.
    • Select 'False' to hide the column.
    • By default, this is set to 'True'.

Output

This action directly modifies the display of your Data Table on the application page. It does not produce any direct output values that can be used in subsequent actions.

Execution Flow

Real-Life Examples

  1. Hide a "Cost" column for regular users:

    • Scenario: You have a product catalog displayed in a Data Table. Only managers should see the internal cost of products.
    • Inputs:
      • Datatable: Product Catalog Table
      • Column: Cost
      • Visible?: False
    • Result: When a regular user views the product catalog, the "Cost" column will be hidden, preventing them from seeing sensitive pricing information.
  2. Show an "Admin Notes" column for administrators:

    • Scenario: A Data Table displays customer orders. There's an "Admin Notes" column that should only be visible to users with an 'Administrator' role.
    • Inputs: (This action would be triggered conditionally, e.g., IF Current User Role is "Administrator" THEN)
      • Datatable: Customer Orders Table
      • Column: AdminNotes
      • Visible?: True
    • Result: When an administrator logs in and views the customer orders, the "Admin Notes" column will appear, allowing them to see internal comments. For other users, this column remains hidden.
  3. Toggle a "Discount Code" column based on a checkbox:

    • Scenario: On an order form, you have a Data Table listing items. You want to show a "Discount Code" column only if the user checks an "Apply Discount" checkbox.
    • Inputs: (This action would be triggered when the "Apply Discount" checkbox changes, using the checkbox's value)
      • Datatable: Order Items Table
      • Column: DiscountCode
      • Visible?: [Value of 'Apply Discount' checkbox] (e.g., if the checkbox is checked, the value is True; if unchecked, the value is False)
    • Result: If the user checks the "Apply Discount" box, the "Discount Code" column will immediately become visible in the "Order Items Table". If they uncheck it, the column will disappear.