QuinnFrancis
6 years agoQrew Member
Quick Base to Google Sheets: "Could not parse text." ERROR
I am very new to all scripting languages. I have been successful with the following code for some of the cleaner tables I have in Quick Base but cannot get this to run for tables that may have special characters. I am currently receiving ERROR "Could not parse text."
Lets say for now I have to have random characters (*,#,","...) is there a way to have google script ignore them or replace specific characters in some way?
Again I am very new to scripting and unfortunately any help needs to be an altered version of the script I have below.
Thank you for any help!!
var usertoken = "b3nbb6_kh9p_c6frt2mbbxxxxxxxxxxxxxxx";
var dbidprimary = "bnkmxxxxxx";
function urlFetchfromQB() {
var url = "https://az.quickbase.com/db/"+dbidprimary+"?a=API_GenResultsTable&options=csv&usertoken="+usertoken;
var fetchedObj = UrlFetchApp.fetch(url);
console.log(fetchedObj);
var csvData = Utilities.parseCsv(fetchedObj);
var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1');
sheet.getRange(1,1, csvData.length, csvData[0].length).setValues(csvData);
}
------------------------------
Quinn Francis
------------------------------
Lets say for now I have to have random characters (*,#,","...) is there a way to have google script ignore them or replace specific characters in some way?
Again I am very new to scripting and unfortunately any help needs to be an altered version of the script I have below.
Thank you for any help!!
var usertoken = "b3nbb6_kh9p_c6frt2mbbxxxxxxxxxxxxxxx";
var dbidprimary = "bnkmxxxxxx";
function urlFetchfromQB() {
var url = "https://az.quickbase.com/db/"+dbidprimary+"?a=API_GenResultsTable&options=csv&usertoken="+usertoken;
var fetchedObj = UrlFetchApp.fetch(url);
console.log(fetchedObj);
var csvData = Utilities.parseCsv(fetchedObj);
var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1');
sheet.getRange(1,1, csvData.length, csvData[0].length).setValues(csvData);
}
------------------------------
Quinn Francis
------------------------------