Skip to main content
Question

API_ImportfromCSV doing nothing

  • December 27, 2018
  • 0 replies
  • 36 views

Hi all!

I'm trying to run this API_ImportfromCSV but it's getting me nowhere. 
I'd appreciate some help as I've been stuck with it for many hours, and haven't gotten to my error.

https://(DOMAIN).quickbase.com/db/(TABLE)?a=API_ImportFromCSV&usertoken=(USERTOKEN)&apptoken=(APPTOKEN)&records_csv=Guia,34168,102999&clist=6&skipfirst=1
This should create new records in the table when the API is run. 
Added "apptoken" as the API returned an error even when using usertokens.
Everything seems to be fine, but the reply is: 

<qdbapi>
<action>API_ImportFromCSV</action>
<errcode>0</errcode>
<errtext>No error</errtext>
<num_recs_input>0</num_recs_input>
<num_recs_added>0</num_recs_added>
<num_recs_updated>0</num_recs_updated>
<num_recs_unchanged>0</num_recs_unchanged>
</qdbapi>


Nothing seems to happen!
I've tried doing this from google scripts, as I want to automate the import but this also doesn't seem to work.. I have the values I need for the CSV in an array, which i'm joining using
    var csvString = "Guia," + arregloGuias.join(",\n");      var url = baseURL + table + "?a=API_ImportFromCSV" + usr_token + apptoken;
  var options =
      {
        "method"  : "POST",
        "records_csv" : csvString,
        "clist" : "6",
        "skipfirst": "1"
      };
  Logger.log(url + options);
  var result = UrlFetchApp.fetch(url, options);
  Logger.log(result);

The result is the same
<?xml version="1.0" ?>
<qdbapi>
<action>API_ImportFromCSV</action>
<errcode>0</errcode>
<errtext>No error</errtext>
<num_recs_input>0</num_recs_input>
<num_recs_added>0</num_recs_added>
</qdbapi>



Appreciate any help!!

Thanks!




This topic has been closed for replies.

  • Registered
  • December 27, 2018
So I can't say for sure about your google scripts example without seeing your array for arregloGuias - but in your first URL example - you have the skipfirst=1 meaning you're skipping the first row, but you only have 1 row so it's not going to import anything. The skipfirst is usually intended if you have headers. Remove that from your first example and that should get you moving

Side note - your clist only has one field (clist=6) but it looks like you're trying to import to 3 fields (records_csv=Guia,34168,102999). You'll want to make your clist have 3 field IDs to match