For various reasons (see question Force the refresh of a Google Sheet) I am trying to replace the use of importData in an app script with a custom function that leverages UrlFetchApp.fetch() retrieve a set of data from a remote host that is in CSV format.
I'm using the UrlFetchApp class to get the response with urlResponse.getContentText() followed by Utilities.parseCsv(), returning that result from my custom function.
This all works as expected with one difference that I'm trying to solve for. Using importData to the same endpoint I get a result to my sheet that automatically detects and handles dates and number columns. With my custom method, this does not happen so numbers are in as text. This creates issues with a summary sheet as their numeric values are expected.
Is there some other method or technique that I should be using to get the same result as I get with importData and that I get (by selecting the right option) by importing CSV from a file?
I created a new sheet - CellarInventoryTestSheet that can be used to see the issue I'm describing. The first tab - "Login" has description and instructions. I also ran the sheet with the two functions and did a copy / paste special values only which shows the difference in the results. Let me know if this is useful.