API_EditRecord with non-standard key

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • Answered
I changed a Table's Record Key from Record ID# (fid_3) to Customer_ID (fid_206).   When I use API_DoQuery to look at the records, it looks like the the Record Key is still fid 3.  Am I interpreting this right?

</chdbids>
    <record rid="510">          <-- Is this telling me the Record ID is still fid 3 ?
        <fid="3">510</f>
        <fid="2">1533741045089</f>
        <fid="6">Test Account Name</f>
        <fid="206">ADAM4914</f>
        <update_id>1533741045089</update_id>
    </record>
</qdbapi>


Photo of JimLieder

JimLieder

  • 344 Points 250 badge 2x thumb

Posted 3 months ago

  • 0
  • 1
Photo of Harrison Hersch (QB)

Harrison Hersch (QB), Quick Base Sr. Product Manager (Platform)

  • 676 Points 500 badge 2x thumb
Hi Jim. When you change the key, Quick Base does not delete or stop using the Record ID (RID). That field remains FID 3 and still increments with each record added. The only thing that changes is that Record ID is no longer the primary key on the table. Does that make sense?
Photo of JimLieder

JimLieder

  • 344 Points 250 badge 2x thumb
OK, thanks for the clarification.  So to edit a record using API_EditRecord when I've changed the primary key field, do I use key=  instead of rid=  

Like this:  a=API_EditRecord&key=ADAM4914

Photo of Harrison Hersch (QB)

Harrison Hersch (QB), Quick Base Sr. Product Manager (Platform)

  • 676 Points 500 badge 2x thumb
That is exactly correct. You can find more details in the documentation for API_EditRecord https://help.quickbase.com/api-guide/edit_record.html.