how add records using API_ImportFromCSV in Jquery?

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

I am able to add the records using QuickbaseClient.js. In 'clist' I provide the field ids which are i am going to add. In csvData, I am provided data for all fields except record ID(3), so it is adding records.

Is it fine?

var qdb = new QuickBaseClient();
qdb.ImportFromCSV(""+TableID, csvData, '3.52.18.87.88.89.90.91', [], '1');

Q: Is there any other way to call API_ImportFromCSV in Jquery?


Photo of anilkumar

anilkumar

  • 0 Points

Posted 5 years ago

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

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,184 Points 20k badge 2x thumb
QuickBase primarily documents their API methods emphasizing XML based requests (and responses). However, parameters can be passed to the QuickBase API using (1) GET parameters, (2) POST parameters, (3) XML POST body or (4) even headers. In many cases it is simply easier to not build an XML Post body and use another method to pass parameters. In the case of API_ImportFromCSV the easiest and most concise method is to use POST parameters with jQuery as demonstrated in the following pastie entry:

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


Unfortunately these features and techniques are not well documented in QuickBase's HTTP API. However if you use this method you will find you code will be shorter, easier to read and you will not have to do a lot of extraneous tasks such as (a) escaping data or (b) using SGML CDATA tags in the XML request.