How Do I Set New Key and Keep All Links and Formulas Working Like Before?

  • 0
  • 2
  • Question
  • Updated 2 years ago
  • In Progress
I have a Linked Table being Updated from Dropbox every day. When the Table was set up there was a key established that is not always a unique value. Recently we have run into problems because there are duplicates in this key field and the file will not import. We can correct this problem by changing the key to a different field, but it is not feasible to re-establish all relationships and formulas based on the old key field. Is there any way to change the key field but keep all previous data and functionality?
Photo of Bennett Krieger

Bennett Krieger

  • 100 Points 100 badge 2x thumb

Posted 2 years ago

  • 0
  • 2
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb
QuickBase will re-establish linkages for you, you don't need to worry about that. I'd make a copy first of your database and test there.

Go to the field list of the table where you wish to change the Key Field.

Check the field you wish to be the new key field and then click "set key". QuickBase will warn you that it will make extensive changes. Don't let that freak you out. Just click Okay.

Quality check in your test database. I'm confident all will be well.
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Bennett,

With Sync tables you cannot change the key field after setting it up ( I know its ridiculous that you can't).  You basically have to delete the connection, and re-create the sync.  Your relationships should still be there, but you will have to reconnect the data to the appropriate fields.

If you have some scripts running you'll have to change the fids too.  

Its nuts they haven't addressed this issue yet.  for this reason we usually build a script that copies the sync, to a normal QB table, prior to actually connecting it to the database.

I've had to redo 2 different sync tables because the source data changed, its not fun
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
I just had a follow-up thought.  Depending on how your data changed, you might be able to just flush all the records out, and start over with a big sync file, but your "key Field" in the csv file needs to be named the same.  It can have different data in it, but the column header just needs to be the same.