Creating and Configuring Columns

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 10 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Lesson: Creating and Configuring Columns in Customer Service Data Models

Introduction: The Foundation of Data Representation

When we talk about extending customer service platforms, we are fundamentally talking about how we organize, store, and present information. At the heart of any customer service interface is the "data grid" or "list view"—the screen that support agents look at for eight hours a day to manage tickets, track customer history, and prioritize tasks. Creating and configuring columns is not merely a task of UI design; it is an exercise in information architecture. If you provide too little information, agents have to click into every single record to find what they need, which destroys productivity. If you provide too much information, the screen becomes cluttered, overwhelming, and impossible to scan.

Mastering the art of column configuration allows you to tailor the system to the specific workflows of your team. Whether you are building a custom view for a high-volume email queue or a specialized dashboard for VIP account management, the columns you choose and the way you configure them define the effectiveness of your support organization. This lesson will guide you through the technical implementation of data columns, the logic behind choosing the right data types, and the best practices for ensuring that your UI remains performant and user-friendly.


Not read yet

Understanding the Data Model: The Source of Truth

Before a column can appear on a screen, it must exist in the underlying data model. In most modern customer service platforms, columns are essentially projections of fields defined in your database schema. If you want to show a "Customer Satisfaction Score" (CSAT) column, you first need a field in your database that stores that integer or decimal value.

Defining Field Attributes

When you create a field that will eventually become a column, you are defining its metadata. This metadata determines how the UI component handles the data. Key attributes include:

  • Data Type: Is it a String, Integer, Boolean, Date, or Lookup (relationship)?
  • Accessibility: Who can see this field? Is it read-only, or can agents edit it directly from the list view?
  • Validation Rules: Does the data need to conform to a specific format, like a phone number or an email address?
  • Display Label: What is the human-readable name of the column, as opposed to the internal API name?

Callout: Data Types and UI Behavior The data type you choose for a backend field dictates the UI component that is rendered. For example, a boolean field (True/False) might automatically render as a checkbox or a toggle switch in a column, whereas a date field will trigger a calendar picker. Understanding this mapping is critical because choosing the wrong data type can force you to write complex custom code later just to make the UI behave as expected.


Not read yet

Configuring Columns in the UI Component

Once the data exists in the model, we move to the UI component layer. This is where we decide how that data is displayed, sorted, and filtered. Most modern frameworks use a configuration object to define columns. This object typically follows a pattern where you define the header, the field mapping, and the formatting function.

The Anatomy of a Column Configuration Object

A typical configuration object looks like this:

const columns = [
  {
    label: 'Ticket ID',
    fieldName: 'ticketNumber',
    type: 'text',
    sortable: true,
    fixedWidth: 100
  },
  {
    label: 'Priority',
    fieldName: 'priority',
    type: 'badge',
    cellAttributes: { class: 'priority-badge' },
    sortable: true
  },
  {
    label: 'Created Date',
    fieldName: 'createdAt',
    type: 'date',
    typeAttributes: { month: '2-digit', day: '2-digit', year: 'numeric' },
    sortable: true
  }
];

In this example, we see how the label maps to the UI header, the fieldName maps to the data source, and the type tells the component how to render the data.

Step-by-Step: Adding a New Column to a View

  1. Identify the Requirement: Determine exactly what information the agent needs to see. Do not add columns "just in case."
  2. Verify Data Availability: Ensure the field is available in the object model and that the current user has permission to access that data.
  3. Define the Column Object: Create the configuration object as shown above, paying close attention to the type attribute.
  4. Implement Sorting and Filtering: If the column is meant to be used for sorting, ensure the backend query supports sorting on that specific field.
  5. Test for Responsiveness: Check how the column behaves on different screen sizes. If you have ten columns, they will likely overflow on a laptop screen.

Note: Always prioritize the most important columns to the left. Human eyes scan from left to right. If a support agent has to scroll horizontally to see the "Status" of a ticket, you have failed the UX design requirement.


Not read yet

Advanced Formatting and Dynamic Components

Sometimes, a simple text field is not enough. You might need a column that changes color based on the value (e.g., a "High Priority" label in red), or a column that includes a link to another record. This is where formatting functions come into play.

Conditional Formatting

Conditional formatting allows you to inject logic into the rendering process. Instead of just displaying "High," you can display a styled pill or badge.

// Example of a cell formatter function
function formatPriority(value) {
    if (value === 'High') {
        return '<span class="badge-red">' + value + '</span>';
    } else if (value === 'Medium') {
        return '<span class="badge-yellow">' + value + '</span>';
    }
    return '<span class="badge-green">' + value + '</span>';
}

By using these formatters, you turn a static list of data into a visual dashboard that allows agents to identify critical issues at a glance.

Handling Relationships

When you need to show data from a related object—for example, showing the "Account Name" on a "Ticket" list—you must handle the relationship path. This is often referred to as "dot-notation" in many frameworks.

  • ticket.subject (Direct field)
  • ticket.account.name (Relationship field)

Always be cautious with relationship fields. They can significantly increase the query time because the system has to perform a "join" or an additional database lookup for every row in your list. If you are displaying 100 tickets, you don't want the system to perform 100 extra queries just to get the account name. Use "eager loading" or "join queries" to fetch this data efficiently.


Not read yet

Comparison: Static vs. Dynamic Columns

It is important to understand when to use static column definitions versus dynamic, user-configurable columns.

Feature Static Columns Dynamic/User-Configured
Complexity Low - easier to maintain High - requires state management
Flexibility Rigid - requires code changes High - agent can customize view
Performance High - predictable rendering Lower - requires extra client-side logic
Consistency High - everyone sees the same thing Low - agents might hide critical fields

Tip: If your team has varying roles (e.g., Tier 1 Support vs. Tier 3 Engineering), consider creating "View Presets" rather than giving every user full control to add or remove columns. This keeps the experience consistent across the team while allowing for role-specific needs.


Best Practices for Column Configuration

To ensure your implementation is robust and maintainable, follow these industry-standard practices:

1. Limit the Number of Columns

The "Goldilocks" rule applies here: not too many, not too few. A good rule of thumb is to keep the initial view to 5–7 columns. If you have more, provide a way for the user to select which columns to show or hide, but keep the default view clean.

2. Use Meaningful Labels

Avoid technical jargon in column headers. If the database field is named is_customer_on_hold, label the column "On Hold." Ensure the labels are concise so they don't force the column to be unnecessarily wide.

3. Optimize for Performance

As mentioned earlier, every column you add—especially those requiring calculations or relationship lookups—adds overhead to the page load time. If you notice the list view is lagging, the first step is to remove unnecessary columns or simplify the data being retrieved.

4. Consistent Formatting

Dates, currencies, and percentages should follow a consistent format across the entire application. Do not show dates as MM/DD/YYYY in one view and DD-MM-YYYY in another. Use a centralized formatting library to ensure uniformity.

5. Provide Clear Sort Indicators

If a column is sortable, ensure the UI provides a visual cue (like an arrow icon). If a column is NOT sortable (perhaps due to a complex calculation), make sure the user doesn't waste time trying to click it.


Not read yet

Common Pitfalls and How to Avoid Them

Even experienced developers fall into traps when configuring columns. Here are the most common mistakes and how to steer clear of them.

The "All-Knowing" Column

Developers often try to cram too much information into a single column. For example, concatenating "First Name," "Last Name," and "Email" into one column makes it impossible for an agent to sort by name or search by email.

  • The Fix: Keep distinct pieces of data in their own columns. If space is tight, use a secondary row or an "info" tooltip instead of overloading a single cell.

Ignoring Mobile/Tablet Viewports

Many developers build for desktop 1920x1080 screens and forget that support staff might be using tablets or smaller laptops.

  • The Fix: Use responsive design techniques. Hide non-essential columns on smaller screens and use a "details" drawer or expander to show the hidden info when needed.

Forgetting About Accessibility (a11y)

Screen readers need to understand the relationship between column headers and cell data.

  • The Fix: Use proper HTML table tags (<thead>, <th>, <tbody>) or ensure your component framework is injecting the correct ARIA labels. Never rely on color alone (like red text for "Urgent") to convey meaning; always include a text label or icon.

Over-Fetching Data

Fetching the entire record object when you only need three fields is a massive waste of resources.

  • The Fix: Use "Field Sets" or "Partial Selects" in your API queries. Only request the data that is actually being rendered in the columns.

Not read yet

Deep Dive: The Lifecycle of a Column Render

To truly understand how columns work, you should look at the rendering lifecycle. When a component loads, it typically follows these steps:

  1. Fetch Configuration: The component reads the JSON configuration object.
  2. Request Data: It makes an API call to the server, requesting the fields defined in the fieldName properties.
  3. Data Transformation: The raw data is returned. If you have a custom formatter, the component runs that function on the data for every row.
  4. Virtualization: If you have 5,000 tickets, the browser cannot render 5,000 rows at once. It uses "virtualization," meaning it only renders the rows currently visible on the screen. As the user scrolls, it swaps out the data in the existing DOM nodes.
  5. Event Binding: Finally, it attaches event listeners for sorting, clicking, or editing.

Callout: Virtualized Lists vs. Standard Tables When dealing with large datasets, standard HTML tables (<table>) will crash the browser. Always look for "Virtualized" or "Windowed" list components. These components keep the DOM lightweight by only creating nodes for the items currently in the viewport, which is essential for performance when building high-traffic customer service tools.


Not read yet

Step-by-Step: Implementing a Custom Column Header

Sometimes, you need more than just a label in the header. Perhaps you need a filter dropdown or a checkbox for bulk actions.

  1. Define a Custom Header Component: Create a separate UI component that handles the header rendering.
  2. Pass Configuration: Ensure your header component receives the column definition as a prop.
  3. Handle Events: If you have a filter in the header, make sure it emits an event back to the parent component to trigger a data refresh.
  4. Register the Component: In your main grid configuration, map the column to your custom component.
// Example of a column using a custom header component
{
    label: 'Select',
    fieldName: 'checkbox',
    type: 'custom',
    typeAttributes: { 
        componentName: 'c-bulk-action-header' 
    }
}

This approach allows you to build highly complex, interactive interfaces without writing "spaghetti code" inside your main component.


Not read yet

Managing Column State

In a sophisticated application, you want the user's preferences to persist. If an agent hides the "Phone Number" column because they never call customers, that column should stay hidden when they log out and log back in.

Persistence Strategies

  • Local Storage: Save the column configuration to the browser's local storage. This is easy to implement but only works for that specific browser/device.
  • User Preferences Service: Store the configuration in your database associated with the user's ID. This is the professional approach, as it ensures the user's settings follow them from their laptop to their desktop.

When implementing persistence, always include a "Reset to Default" button. Users will inevitably hide a column they actually need, and they will be frustrated if they cannot easily restore the original view.


Security and Permissions

Never assume that because a column is hidden in the UI, the data is secure. If the API returns the "Customer Social Security Number" field just because it's in the data model, a tech-savvy user could inspect the network traffic and see that data even if it isn't rendered on the screen.

  • Server-Side Filtering: Always filter the fields at the API/Database level based on the user's role.
  • Field-Level Security (FLS): Implement a layer in your backend that checks if the user has permission to view a specific field before sending it to the client.
  • Audit Logging: If a column contains sensitive data, log when that data is accessed or exported by an agent.

Not read yet

Summary of Key Takeaways

Creating and configuring columns is a foundational skill that impacts both agent productivity and application performance. By following these principles, you ensure a high-quality experience:

  1. Information Hierarchy is Key: Always place the most critical information to the left of the grid. Agents should be able to make decisions without clicking into the record whenever possible.
  2. Data Type Matters: Choose the correct data type in your backend model to ensure the UI component automatically renders the most useful widget (e.g., toggles for booleans, date pickers for dates).
  3. Performance Over Everything: Use virtualized lists for large datasets and ensure you are only fetching the fields needed for the current view. Avoid unnecessary relationship lookups.
  4. Consistency and Standards: Use standardized formatting for dates and numbers to prevent confusion and maintain a professional aesthetic throughout the application.
  5. User-Centric Flexibility: Allow users to customize their views, but always provide a way to reset to the default configuration. Store these preferences in your database so they persist across devices.
  6. Security is Non-Negotiable: Never rely on UI-side hiding to secure sensitive data. Always enforce field-level security at the API layer to ensure users only receive the data they are authorized to see.
  7. Test for Reality: Always test your column configurations on different screen sizes and with different data volumes to ensure the interface remains functional under all conditions.

By treating column configuration as a deliberate design and engineering process rather than an afterthought, you can significantly improve the efficiency of your support team and the overall quality of your customer service platform. Whether you are adding a simple status field or a complex, interactive custom column, the principles of clarity, performance, and security remain the same.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.