Forum Discussion

JoshuaKaye's avatar
JoshuaKaye
Qrew Trainee
7 months ago

Importing table with existing Record ID#s

Hello QB Community,

I am creating a new application and I want to preserve the record id # from my original application that is still in use for the ease of keeping data updated.  However when importing the data into the new table, trying to merge the key field, I get a error that the records are not found.  This makes little sense to me because the table is empty and all the fields being imported are unique.  Can someone shed some light on what I am doing wrong.

Thanks,

Josh



------------------------------
Joshua Kaye
------------------------------

15 Replies

  • Hi Joshua!
    I believe what you'll want to do is create a field that is specific to that record ID from your old system. So, for instance [OLD SYSTEM_RID] or whatever you want to name it. And then when you import all of your data into the table, you'll go into advanced settings and make that field [OLD SYSTEM_RID] the key field.




    ------------------------------
    Renee Hansen
    ------------------------------
  • If you want to actually preserve the old record id and not change the Key field of your new table you can simply do a blank import up to the highest record id in your old table, import your data and then delete the records ids you don't need. So lets say your highest record id in the old table is 4356 - in your new table just import 4356 records so that all the record IDs exist. Then actually upload your old data since the record id's will now exist. Final step is just delete any records that might have already been deleted in the old table and you're set. This preserves the old record id without having to make a new key field. 



    ------------------------------
    Chayce Duncan
    ------------------------------
  • I like with both Renee and Chayce's  suggestions, but one caveat with Renee's is you'd need to figure out how to make the new key field (your imported values) be unique for future records (e.g. auto-increment). I typically try to avoid changing the default key.

    The other option that comes to mind is make a foreign key like Renee suggested, but not change that to the primary key field. Then, you could create a relationship to the old table using that key to reference old values.

    I'd suggest Chayce's approach though assuming you haven't burned IDs in the new table by deleting test records, etc. That also potentially allows you to remove the old table and it's one less thing to manage.

    The underlying issue here is we are not able to change Quickbase's default primary key values and the next auto-incrementing value like you can with a SQL table.

    Ooh, and regarding your error … there's a different between importing and creating new records vs. importing and updating existing records. Or an "upsert" which is combination of both. It sounds like in your import you are trying to use a "merge field" to update records that don't exist. I'd make a test a table to play around with the import process and options that you can throw away once you're finished. In the import process, you'll set of merge field of say "Record ID#" … but, then in the subsequent step where you map fields, select "Do Not Import" to this field and that should create the new records for you using the new tables auto-generated IDs. Then, I'd try what Chayce suggested!



    ------------------------------
    Brian Seymour
    ------------------------------
    • JoshuaKaye's avatar
      JoshuaKaye
      Qrew Trainee

      Thanks Renee, Chayce and Brian,

      These are great suggestions and what I am now understanding is that the Record ID must contain not only unique numbers but also in increment sequence. 

      My issue is that I do have deleted records in that table which were "burned" otherwise I would attempt the blank import.  I am really hoping to avoid changing the key field as it has caused issues for me doing so in the past.

      Does anyone have a quick way to repopulate the missing records?  Seems like a logistical nightmare...

      Thanks,

      Josh



      ------------------------------
      Joshua Kaye
      ------------------------------
      • ChayceDuncan's avatar
        ChayceDuncan
        Qrew Captain

        You can still do the blank import you'll just have to 'burn' the records from the new table. In practice once you backload the data from your old table there should be at least some data that you can easily run a report of records that don't have anything in them and just delete them back out so your tables match exactly. 

        Since they are deleted from your old table they are now gone for good



        ------------------------------
        Chayce Duncan
        ------------------------------
    • JoshuaKaye's avatar
      JoshuaKaye
      Qrew Trainee

      So I imported the exact amount of records to the new table and then tried the update.  Same result...

      Error
      Some record IDs specified were not found in the table.


      ------------------------------
      Joshua Kaye
      ------------------------------
      • ChayceDuncan's avatar
        ChayceDuncan
        Qrew Captain

        Did you import the same # of records or up to the max record id # in the old table? You may only have 5000 records in total - but if you had deleted records in the old table the max record ID might be 5050 and in the new table you would need to import all the way to that number.



        ------------------------------
        Chayce Duncan
        ------------------------------