How to Create a Dynamic Grid with Month-Year Columns Based on Date Range selection in Appian?

Certified Associate Developer

Hi Community,

I’m working on a requirement where I need to create dynamic columns in read-only grid in Appian and would appreciate some guidance.

Problem Statement:

I have a database table with the following columns:

  • ActivityName

  • ForecastDate (Date field)

  • ForecastAmount (Decimal)

Requirement:

I want to display a grid where:

  • Each row represents an ActivityName.

  • Columns dynamically represent Month-Year values (like Jan-2025, Feb-2025, etc.), based on the date range selected from interface.

  • Each cell should show the corresponding ForecastAmount for that activity and month, if available.

So the table should “pivot” the data such that ForecastDate drives the column structure dynamically.

Note: Any Date range between 2020 to 2030 can be selected and searched.

Questions:

  1. What’s the best approach to dynamically generate these month-year columns in an Appian interface?

  2. Should I preprocess the data in an expression rule or CDT before passing it to the grid?

  3. Any examples, ideas, or plug-ins that might help achieve this?

Any help or guidance would be highly appreciated!

Thanks in advance,

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    If you plan to use a normal read only grid, you can create any number of columns dynamically. 

    My approach to such tasks is, to first build a small prototype, assuring myself that I understand the challenge and I have solutions to all the tiny problems making up the whole thing.

    E.g. to get the dynamic list of months, you can use code like this:

    a!localVariables(
      local!start: today(),
      local!end: date(2026, 11, 15),
      local!numMonths: (12 * year(local!end) + month(local!end)) - (12 * year(local!start) + month(local!start)),
      local!months: a!forEach(
        items: enumerate(local!numMonths),
        expression: a!addDateTime(
          startDateTime: local!start,
          months: fv!item
        )
      ),
      local!months
    )

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Hi  Thanks for the support so far!

    I’ve made good progress — I’m able to:

    White check mark Generate all dates between the selected date range

    White check mark Display dynamic Month-Year columns in a grid

    White check mark Populate each cell with the correct ForecastAmount for its respective ActivityName and Month-Year, using an expression rule

    However, I’m facing a performance issue now.

    Since the dataset contains millions of records, and each cell in the Month-Year columns is calling an expression rule to get its value, the performance has become very slow.

    My Question:

    Is there a better or more efficient way to display these Month-Year forecast values without making individual rule calls for each cell?

    Would it be better to:

    • Preprocess and pivot the data in a single rule before binding it to the grid?
    • Use a different design approach or plug-in to optimize performance?

    Any suggestions or best practices for handling large datasets with dynamic grids would be really helpful.

Reply
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    Hi  Thanks for the support so far!

    I’ve made good progress — I’m able to:

    White check mark Generate all dates between the selected date range

    White check mark Display dynamic Month-Year columns in a grid

    White check mark Populate each cell with the correct ForecastAmount for its respective ActivityName and Month-Year, using an expression rule

    However, I’m facing a performance issue now.

    Since the dataset contains millions of records, and each cell in the Month-Year columns is calling an expression rule to get its value, the performance has become very slow.

    My Question:

    Is there a better or more efficient way to display these Month-Year forecast values without making individual rule calls for each cell?

    Would it be better to:

    • Preprocess and pivot the data in a single rule before binding it to the grid?
    • Use a different design approach or plug-in to optimize performance?

    Any suggestions or best practices for handling large datasets with dynamic grids would be really helpful.

Children
No Data