Make Column Editable Using Script

I have a table that is populated by a query that returns a variable set of columns based on a drop down filter. For example if the drop down shows A then the query returns columns 1,2,3 and if the dropdown is B then the query returns columns 3,4,5.

Through other actions users can change the columns that are returned in the query and new columns can be added. All newly added columns should be editable.

My struggle is that I can only seem to update a column to be editable as an administrator who can edit the app. I would like to be able to default columns to editable but that doesn't seem to be an option. My next best guess was to edit the table columnsEditable list to dynamically add columns as editable but I cannot figure that one out. Is this a possible solution, basically updating columns dynamically to be editable?

Thanks

Going to give this one bump before I give up. Thanks in advance.

Hey @illumination,

Interesting use case.

I would try implementing "Dynamic column settings" to only "display" columns conditionally vs having the query return data conditionally. This way the settings, like an editable column, would stay constant in your UI.

Would that work for you? I've created a very simple demo if that helps.

Thanks for the response. The problem I'm trying to solve is for a new column, one that was just added to the database, to be editable without an administrator marking it as editable. This appears to be a different approach to visibility, but I'm looking for something similar but with edit-ability.

  1. new column added to table
  2. new column automatically picked up in table
  3. new column in table is editable automatically - this is the part where I'm stuck

Gotcha,

not aware of how to make a new column coming through automatically editable unfortunately.

May I ask what the use-case is with frequently adding new columns to a table? If the data collected in a row is arbitrary you could add a json field and save your values there.