# Dynamically Add Column Names to Datagrid

**URL:** <https://forum.novacura.com/t/dynamically-add-column-names-to-datagrid/603>\
**Category:** Flow Classic\
**Created:** [January 12, 2024, 10:33pm UTC](https://forum.novacura.com/t/dynamically-add-column-names-to-datagrid/603 "2024-01-12T22:33:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/daniel/32/708_2.png) [@daniel](https://forum.novacura.com/u/daniel)\
**Post date:** [January 12, 2024, 10:33pm UTC](https://forum.novacura.com/t/dynamically-add-column-names-to-datagrid/603/1 "2024-01-12T22:33:21Z")

</div>

First you need to identify what data is going into those columns. For this example, I will use a table called “Columns” but you could something like activities for time reporting.

Select the Column(s) you want to see in the grid.

Then, using my “Employees” table, show the columns I selected.

Use a decision step to determine which columns to hide/show.

Attached is the concept and flow used to accomplish this. There really is nothing _dynamic_ about it, but it _can_ be done, even if it is pretty hard.

Let me know your thoughts.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/9ce95b38d2fb8aa0ac41fdc1c975fdf785adb03e.png)

[Dynamic Columns.flow](https://forum.novacura.com/uploads/short-url/ubvb3Wo0yOVVxWL3V5HH3KdiBmv.flow) (123.2 KB)

---

<div class="post-metadata">

**Author:** ![wpuymac](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/wpuymac/32/795_2.png) [@wpuymac](https://forum.novacura.com/u/wpuymac)\
**Post date:** [January 15, 2024, 4:27pm UTC](https://forum.novacura.com/t/dynamically-add-column-names-to-datagrid/603/2 "2024-01-15T16:27:44Z")

</div>

Clever! Thanks for sharing.

---

<div class="post-metadata">

**Author:** ![ivstde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.novacura.com/ivstde/32/146_2.png) [@ivstde](https://forum.novacura.com/u/ivstde)\
**Post date:** [January 16, 2024, 10:31am UTC](https://forum.novacura.com/t/dynamically-add-column-names-to-datagrid/603/3 "2024-01-16T10:31:11Z")

</div>

Hi,

just another idea:  
(some history first 🙂 ) way back in the day for a certain project we wanted to display all the days of the month in a datagrid as columns (so that we can show reported hours for each day) and the problem was that number of days varied.  
So our idea was to create a datagrid “template” with 31 columns and then dynamically fill in data (both column names to be days of the week and the hours as values) or leave the last columns empty (if the month has 30, 29 or 28 days)  
So we were gonna do something like this (with a bit of scripting):

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/ffe37dff1851166ca5ab95e1dd2411316702a2ca.png)

At the end we gave up on this idea at that project (customer didnt like how it looked in webclient, with 31 columns webclient added the scroll bar and that was too ugly for them)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/6292b875bed24abea59135f57070a6b40537eb23.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/novacuratalk/original/1X/85d53e154601e0de362758724425453225996b7b.png)

but…the idea lives on 🙂

Hope this helps!

B R  
Ivan  
[Test dynamic columns.flow](https://forum.novacura.com/uploads/short-url/26Yad6hxqwBJvjBoZ1RGwMfJ9CI.flow) (45.6 KB)
