Is there an easy way to pass data between two QuickBases to pre-populate fields?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I have two QuickBases - I need a user in QB #1 to be able to select a link (push a button etc...) in a form in QB #1 to create a record in QB #2 with fields completed with the data from the form/table in QB #1.

Is this possible without extensive programming?

Photo of DRL

DRL

  • 20 Points

Posted 4 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,204 Points 20k badge 2x thumb
Here are the guts of the code that will query dbid1 using qid1 for CSV data consisting of fields identified by clist1 and then import the data it into dbid2 table's columns identified by clist2 using API_ImportFromCSV:

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=409


So to summarize there are five parameters you need to specify using your own particulars:

//source:
var dbid1 = "bj3za7mzn";
var clist1 = "6.7.8";
var qid1 = "5";

//target:
var dbid2 = "bj3zb5t4b";
var clist2 ="8.7.6";

Plus the apptoken:

var apptoken = "b8yb5ufc25jwakc2ucvh7d2zb5bi";
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,904 Points 50k badge 2x thumb
I think Dan's answer may be overkill for your needs. Are you looking to pop up an Add Record form with some fields pre-filled, or actually create the record. Eith way, where do you want to land the user after adding a record?
Photo of DRL

DRL

  • 20 Points
Yes - looking to pop up the add record form with fields pre-filled.  The user will need to complete other fields.   Right now I i don't have time to write the code and test Dan's answer.    If there is another way I'm all ears.  For now, I've just put in a quick URL button but it would be nice to have it pre-populate the form.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,904 Points 50k badge 2x thumb
Here is an example of an easy solution



URLRoot() & "db/" & [_DBID_ISSUES] & "?a=API_GenAddRecordForm&_fid_173=" & URLEncode ([Record ID#])
& "&_fid_32=" & URLEncode("HOF Freight Quote/Pickup Request")
& "&_fid_171=" & URLEncode([Account Name])
& "&_fid_99=" & URLEncode([Weight])
& "&_fid_102=" & If([Tailgate Y/N]="Yes",1)
& "&_fid_104=" & If([Heat Y/N]="Yes",1)
& "&_fid_173=" & ToText([Record ID#])
& "&_fid_175=" & ToText([Selected Related Carrier])