Auto-create columns based on date

Is there a way for Glide to auto-create a column based on dates or other rule? I’m looking for the user to input a number each month, but it seems I’d have to create a new column for each month, correct? Just curious to see if there was an alternate method…

If you are having to create new columns and modify the app for each month, then I think you should consider restructuring your database. Sounds like you should be adding rows instead of columns. In normal databases, columns are only added as necessary, and even then, it should only be done when you are maintaining or restructuring the app. Dynamic data should be in rows and use the same existing columns.

1 Like

Hmm…I didn’t think about it like that :man_facepalming:

Ok, so in my app, I’d like each user to enter a starting number and their desired % goal. Then the database would calculate what the goal is by multiplying the two. But they’d need to do it each month.

Based on your suggestion, I guess I’d make the columns: “Month” “Starting Number” “Goal” and “Goal Amount”? Then have a form so the user would select the month, enter their starting number and goal? And make each column user-specific?

I assume that you would still like to keep track of previous months? A form would work, but I would not make the columns user specific. Instead I would add a column with the user’s email so you can filter or set row owners to secure the data as well as filter it.

If you don’t want to track previous months, then you could use user specic columns and have a single row. Then wouldn’t need an email column since the user specific columns would hold unique values for each user. Also, you wouldn’t need a form in this case. All you would need to do is update the values in the existing row.

I see, thank you! I would want to keep track of previous months so I’ll go with the user email column solution. Then, could this be implemented in the user profile database?

So for selecting months, is there a way to have the user select the month name from a dropdown and it translate into a month-year in the database?

Scratch that question about the user database. :grinning: I was still thinking in terms of columns…

Well, there’s a few ways to handle that. You could select a date with a date picker, and then use a couple of math columns to parse out the year and month from that date, but it might be confusing if you are asking a user to select a random day in a month, just to get only the year and month from it. You could just have a month choice component and maybe a year if you want. With something like that, you could compare the chosen month and year to the month and year that have been parsed out of a date in the actual data.