Skip to content

Instantly share code, notes, and snippets.

@djkazoo2002
Created December 7, 2015 20:34
Show Gist options
  • Save djkazoo2002/4401182dcfd5121db2df to your computer and use it in GitHub Desktop.
Save djkazoo2002/4401182dcfd5121db2df to your computer and use it in GitHub Desktop.
var datafile = "hello.csv";
var dbid = "bkfw6n9";
var username = "kazo";
var password = "mypassword";
var subdomain = "mycompanys";
var fso = new ActiveXObject("Scripting.FileSystemObject");
var csv = fso.OpenTextFile(datafile, 1).ReadAll();
fso.close;
WScript.Echo(csv);
var url = "";
url += "?act=API_ImportFromCSV";
url += "&username=" + username;
url += "&password=" + password;
url += "https://" + subdomain + ".quickbase.com/db/" + dbid;
WScript.Echo(url);
var request = "";
request += "<qdbapi>";
request += "<skipfirst>1</skipfirst>";
request += "<records_csv><![CDATA[";
request += csv;
request += "]]></records_csv>";
request += "</qdbapi>";
WScript.Echo(request);
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("POST", url, false);
xmlhttp.setRequestHeader("content-type","text/xml");
xmlhttp.send(request);
WScript.Echo(xmlhttp.responseText);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment