Skip to main content
Question

API API_AddRecord - with Update

  • November 19, 2020
  • 0 replies
  • 130 views

GeoffBarrenger
Forum|alt.badge.img+5
Hello, 

Is it possible to use the API_AddRecord with updates? Occasionally there are already historical records with the key field (unique) field, and those commands fail.  The other option it seems is to use API_ImportFromCSV but that will require a fairly large rewrite.  If the API_AddRecord command has a "merge with" or "update" modifier that would be fantastic.  Any ideas?

------------------------------
Geoff Barrenger
------------------------------

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • November 19, 2020
Are you launching this API off a child record?  Or can this record be a child so it can know if the Parent exists?  If so, your URL formula can have an IF statement to switch to API_EditRecord if the Parent Record Exists.

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------

  • Quickbase Alumni
  • November 19, 2020
I'm pretty sure that's not possible with the API_AddRecord call. I've always had to use API_ImportFromCSV or otherwise separate my calls into API_AddRecord and API_EditRecord to perform a mix of adds and updates.  The new RESTful API has an upsert that will do exactly what you need but if converting to API_ImportFromCSV is too big of a lift, switching to the the new API may also be undesirable.  That all depends on your use case so it's probably worth a look: https://developer.quickbase.com/operation/upsert.

------------------------------
Nathan Hawe
------------------------------

  • Quickbase Alumni
  • November 19, 2020
Hi

Glad to hear you've got a solution that works now.

An alternative approach you could use is the upsert functionality in the newerJSON API

https://developer.quickbase.com/operation/upsert

What's really useful is the fact that this can be called from a quickbase webhook (example screenshot below).

For bulk record upserts outside of Quickbase, in the past I've used the excellent Qunect ODBC Connector which has upsert capability.

https://www.qunect.com/

Cheers

David



------------------------------
dmlaycock2000 dmlaycock2000
------------------------------