Attempting to change the Key Column in a Table

Hi! I am new here but excited to find a community of others who are using AppSheet to it’s full potential!

I am developing an app for my organization - it’s a bit of an experiment, as our company is large and global, but has not used AppSheet in the past (though we use Google Workspace as our primary tech stack, so it only makes sense to use the integrated platform solution, too!) I’m a one person dev team, with limited experience but tons of drive/curiosity so I have figured out quite a bit so far.

Unfortunately, the app is in a deployed state with 30 active users, daily. I have learned a lot, since beginning, and in doing so, I am now aware that the key column I chose originally for the main parent table of the app was a poor choice.

I have tried numerous times to change the key column, in various ways, to anything else, and every time, the whole app breaks. I get the “There’s a problem with your app. Restore a previous version.” error, so no chance to keep fiddling and get it right, I just have to revert back to the old version with the ‘bad’ key column (its a timestamp value :frowning: )

Wondering if anyone else has ever had a similar issue, and hopefully, if there was a way to fix it without starting all the way over?

Thank you!

1 Like

Hey @seven , welcome to the community!

I’ve used timestamp values as keys in the past too, and while they worked for awhile… once I got more than a dozen people using the app simultaneously, we started running into duplicate key issues every once in a blue moon. (And once every month or so is enough, especially when it causes such a headache!)


How to switch your IDs cleanly

In order to switch your ID column from one to another in a table, there is a definite order of operations that you need to follow.

  • Also know: there will be errors all over the place most likely
    • Especially if the column you’re changing is used a lot (with lots of references and things)

The key is to know that all the errors are the same thing, no matter what it actually says:

  • The name of the ID column is wrong

You’ll get a lot of errors that will lead you in the wrong direction (things like “the number isn’t working” or “the value must be a list” or things… and these are coming from the fact that there are dereferences using the ID column… and it just changed, so all these old formulas are looking at the wrong column (getting the wrong type) and so nothing works.

  • To solution is always the same… find the root that’s using the incorrect column and correct it.
    • The issue isn’t the percentage column… it’s the column that’s the reference to something… that’s got something off.

Typically if you continue moving forward, finding the errors and correcting them - FOLLOW THE RED - you’ll eventually work through all the old column instances and things should work again.

  • It can be tedious to accomplish this change, but it’s possible for sure.