Mapper function not applied to dynamically shown columns

Hello, we are facing a bug with dynamically shown columns: the mapper function is not applied after showing a column.

For example, here we are using the switch1 to control the visibility of the name column:

The name column has a Mapper function that extract the first name of users like this:

Unfortunately, this mapper function is not applied when dynamically showing the column.

The expected values are these ones:

It only works after updating the table data.

The problem is actually global to any functionality applied to dynamically shown columns, like for example this issue here: No background color when dynamically showing columns in Table.

We are using On Premise Retool version 2.78.12.

You could manually create a Custom Column and assign it the value using the split function instead for now until this is addressed, no? Don't use self but instead use the query result like query1.data.name.split().... this might make it easier for now.

Thanks @ScottR for the answer. Yes I will applied the mappers beforehand in the data prop of the table. For example like this:

query1.data.map(columns => ({
  ...columns,
  name: columns.name.split(' ')[0]  // <= the mapper function here
}))

Hi @aturiot! Thanks for reaching out. I do see that we had a bug with mappers + dynamic column settings, but it seems to be resolved on my end. I'm no longer able to reproduce this bug. Are you still seeing this behavior in your app?

Hey @Tess, thanks for the update ! I retried it on On Premise Retool version 2.79.13 with a bare new application and we are unfortunately still facing the same issue :confused:

Hi @aturiot! It look's like Everett's fix for this issue may also work here. It's a bit hacky since the Column mapper would be the same if the switch value is true or false.

Engineering has been looking into this bug, as they are working on a lot of new table updates. I believe this will be fixed in the next stable release :crossed_fingers: I hope this workaround helps for the time being:

Hello @Tess, thanks for the update ! I look forward for the new table updates :grinning_face_with_smiling_eyes: