User defined columns

Hi there. I’m new to app sheet and never coded anything before.

I’m trying to create an app where the user in one view defines the columns to a table (habits to track) and in another view adds entries to that table (reports on those habits every day or at various intervals).

How do I dynamically update the column headers? I created a slice that is called “active behaviors” where the status is set to “active,” but how do I pull those in as columns for the other table?

Thanks for your help!

EDIT: Now I am thinking dynamic column headers doesn’t make sense since each previous entry wouldn’t apply any more. So to clarify, I am thinking just to add new columns to a table when a user makes an entry in another table. Could I then do a lookup for the column headers?

What do you mean by this?

Hello and welcome @pr0digy1 can you be more explicit ?
but know that the columns are updated according to the data entered from a form that you will have created.

I mean the column headings. In other words, can the data entry in a form become a column header in a new table? Then every time a new entry is made in one table it can become a column header in another. Does that make sense?

The app cannot add columns to a table; the app can only add rows.

If you have preexisting columns and want to use user-supplied values to identify those columns, you can use a Display Name expression for the column to generate the column name shown to the user:

1 Like

Thanks Steve, but that’s not exactly what I’m after. I want the user to define in one table the parameters they will be tracking in the other table.

I was able to accomplish this once by using Zapier and creating a new column on one sheet when a new entry is made to the other.

It seems like something reasonable to ask, but maybe I am thinking in spreadsheets not databases.

1 Like

Perhaps if elaborate more what you want the app to actually do in more specific terms (and none of the spreadsheet/database talk), then someone might be able to better suggest how to structure your data to accomplish that.

Chances are your spreadsheet has relatively static rows, with more dynamic changing columns. Or at least, columns are where most of your new data happens. A lot of spreadsheet users do this, and I totally understand why. Especially since most people have widescreen monitors, it’s useful visual real estate. So more than likely, if you were to rotate your data 90°, you’d already be further along. But, of course, it’s not always that simple either.


Yep. :slight_smile:

Haha ok fair enough. Thanks for your help in thinking differently so far!

Thanks for your comment. Let me try explaining what I’m trying to do.

It’s a habit tracking and evaluation app. Every day, I will track whether (and how much) I do certain behaviors. I’m talking dozens of behaviors throughout different parts of the day. Then at the end of the week, I want to review how I did (and maybe compare to previous weeks), and set targets for the next week.

Then there are some interesting things I want to layer on top of that. For example, when I plan on doing certain behaviors, I want to schedule them out. Or another example is varying the frequencies to daily, weekly, fortnightly, monthly, etc… Then I’d want a pre-planned list of behaviors for each day. For example, I only lift weights on MWF, but go for a run on Tu Th. Then see that as a daily calendar to plan my day around.

It’s a practice I’ve done with spreadsheets for years so that must be why I’m stuck thinking that way!