[OutSystems Data Grid Web] Saving user configuration in a grid with a variable number of columns leads to errors
Web icon
Forge component by Platform Maintenance
Application Type
Traditional Web


We have a DataGrid that has a variable number of columns depending on the selection that the user makes. The column headers are also dependent on this selection. When users save their grid configuration that leads to errors:

  • The actual data in the columns do not always match the header anymore. 
  • When the new selection includes more columns than there were in the saved configuration, the grid hangs during rendering.

How can I resolve these issues?
Or otherwise: what is a better approach for this use case?

Alfio Esposito

Hi Alfio,

I am also struggling with this issue myself. Please let me know if you found an resolution!



2020-08-05 09-00-16
Gabriel Lundgren


Thank you for bringing this issue into discussion.

In order to better understand the problem, can you send us a sample?


Gabriel Lundgren

Hi Gabriel,

Thanks for looking into this. I have attached a oml-file with an example that is similar to what we have in our actual system.

Notice how the columns, headers and the content of the grid change when you click Show All, Show First 2 and Show Last 2.

Click Show All and then click Save configuration.
Next click Show first 2. Notice that still all columns are shown with the headers that correspond to the All-view instead of just the columns and headers that correspond to the First2-view. The data fields show the values of the first 2 data columns.

Clear the configuration and switch to Show First 2. Then save the configuration again.
Next click Show Last 2. Notice that the headers still correspond to the First2-view instead of the headers that correspond to the Last2-view. The data fields show the values of the last 2 data columns.

Clear the configuration and switch to Show First 2. Then save the configuration again. Then click Show All. You will now see that the grid 'hangs'.



2020-11-26 09-30-54
Ricardo Valim

Hi Alfio,

The "Save Configs" as far I could see, works considering User and Page, as you are using the same page to handle different columns definition, right after grids renderization, the configuration feature note that you have a config saved and tries to apply it .

As we change grids structure, some of the columns are no more available.

The save configs will save your grid configuration per column (header, sort and filter definitions, position, visibility etc), the key used to do it is the JSONField, in your case "Col1", "Col2", "Col3", "Col4" and "Col5".

So when you save configuration for a grid with 5 columns, and you change to 2 columns, the code will render untill "Col2", when the configs are applied the "Col3" isn't available, and we have an error.

I will open a Support case so your case can be analyzed, by now, not to let you stuck waiting for us, I would suggest one of the solutions bellow:

  1. Create different pages depending on the structure you want. In this case the Save configs will work just perfectly
  2. Maintain the different structures on the same page, but remove the "Save Config" button

Hope I could help you

Hi Ricardo,

Thanks for your response and thanks for opening the support case.

I have looked into your first suggestion for the workaround. Unfortunately this will not work for us, because the column header text is also saved when you save the user config. In our real system these texts are dependent on user selection as well, so there is no way for us to know in advance which text will end up in which column header (this is not part of the example I made because I thought that would not be required to demonstrate the issue).

Is there any way to circumvent the saving of the header text when you save the user config?

Alfio Esposito

Hello @Alfio Esposito ,

We've been trying to come up with another workaround, but couldn't find something that could fit your needs.

Meanwhile, we'll keep you posted about this issue.

Best regards,

Bruno Martinho


Is it possible to auto save configurations when moving to detail page and back from a grid?

Is there any update on this? I am having a similar situation happen to me:

-Users are saving data grid configurations in the production environment

-I added a new column to the data grid in our development environment

-pushed this through to the production environment

-Users with saved configurations on the data grid table are no longer able to load are getting the error: "uncaought TypeError: cannot read property 'header' of null'

I am looking for a workaround to get this new column into my production environment data grid. For now I have removed the column from the production environment and users are able to load the grid again. 

I've been playing around with this and it looks like if you add a new element to the screen where the data grid is broken (so the screen has technically "changed") then the saved configurations will go away and the data grid will load with the new column fine.

Is there any update on this?  We're having the same issue as Clayton describes, and it sounds like the issue that Alfio is having.  You don't even need a production environment like Clayton mentions:

  • In a Dev environment, save a configuration for a grid
  • Add a new column to show for that grid
  • Go back to the screen where the grid is with the saved configuration
  • Error is thrown just like Clayton said, "cannot read property 'header' of 'null"

The problem resides in a new column being added, but the saved configuration doesn't know anything about that column.  This is a completely normal situation that will happen all the time in production environments and it's happening to us.  The workaround is add all the columns you'll ever want so when new configurations are saved that they will always work.  The instant you add a column all previous saved configurations for all users are completely broken.  This isn't good.

It seems like there needs to be some way to use default values for a column if it's supposed to be rendered but it's not in the saved configuration.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.