Created
December 7, 2015 20:34
-
-
Save djkazoo2002/4401182dcfd5121db2df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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