Discussions

Expand all | Collapse all

Quick Base to Google Sheets: "Could not parse text." ERROR

  • 1.  Quick Base to Google Sheets: "Could not parse text." ERROR

    Posted 02-06-2020 15:37
    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
    ------------------------------


  • 2.  RE: Quick Base to Google Sheets: "Could not parse text." ERROR

    Posted 02-06-2020 16:51
    Edited by Austin K 02-06-2020 16:51
    So the line it is having the error on is the very first line with a special character in it? You have verified this? I say that because that error can happen for many different reasons. You might have an extra new line or something like that, same error would happen.

    You will very likely have more help on something like Stack Overflow, I saw a bunch of issues that related exactly to this. Not sure which solution would be best for you but there were several. "utilities.parsecsv() could not parse text"