Follow us on:

Google script convert to string

google script convert to string This method takes the parameter, which is the base of the converted string. (line 6)", where in this case "Semester Long Clinics" is the actual content of the cell. So first we should convert the text to any date format so that MONTH function can identify it. Write the following script in SQL Server. 1534121727024366 string 23 string. google. Textbox() function. I succeeded to get current "YYYY-MM-DD" in "Date" format in GEE script. In this tutorial, we will suggest two methods for converting an object to a string. stringify() method in JavaScript. Syntax. There are no intrusive ads, popups or nonsense, just a binary to string converter. Alternatively, we can use String. ). Collections. Convert Currency Text to Number in Google Sheets In the below table, as you can see, column C and F have currency values but in the text format. valueOf() and Integer. google. com 13 string 13 string 13. It can also convert plain text to secure strings. Before you begin. Google Apps Script is a simple scripting language based on JavaScript. This function accepts a wide range of parameters in a single string that can be used to specify the format for a range of cells. By default it adds a comma to resulting values, though you can also specify that it add nothing or some other separator value. Return Value: The num. However, when it comes to explaining how to add all that information that goes into a function when you type it into Sheets it is a bit vague. stringify() method in JavaScript. When it uses Google Sheets API v4, GridRange is used for it as the range property. . gs Google Apps Script: DriveApp, Advanced Drive Service, SpreadsheetApp, DocumentApp Javascript: spread operator, map, regex Ah, bureaucracy at its finest. There are no ads, popups or nonsense, just an awesome JSON to text converter. If the string remains unchecked after the limit is reached then it is not reported in the array. Google Apps Script, Javascript, strings Hey there, Yagi here, you’ve probably stumbled across this page from a link from one of my other in-depth tutorials. Parsing HTML using the XML Service. Conversion from object to string in Google Apps Script. limit: Defines the upper limit on the number of splits to be found in the given string. He holds an engineering degree in Computer Science (I. host (client-side) String — the font family, or null if the element contains multiple values for this attribute. The Google Sheets LEFT function description: Syntax: LEFT(string, [number_of_characters]) Formula summary: “Returns a substring from the beginning of a specified string. We would be examining each one of them and check their output. string_expression[, timezone]: Converts a STRING expression to a TIMESTAMP data type. eg. In this tutorial, you'll learn how to write a custom function to convert a string to Proper case. If the script contains CALL statements, this job may have originated in a different procedure. Using Google products, like Google Docs, at work or school? Try powerful tips, tutorials, and templates. Convert-String [-Example <System. filter and it will automatically strip out the zero-length strings leaving an array of only valid strings. If you have a Google account, you can save this code to your Google Drive. history (client-side) google. Google will ask you to confirm Google Drive access. CAST ( expression AS datatype [ ( length ) ] ) The script below is really nice if you need to convert String dates that come in different (unexpected) formats. This is just a quick primer on Javascript Strings in Google Apps Script for the non-coder. There are two ways of invoking this method. To convert a String to INT uses sql conversion functions like cast or convert. Please pr Hex to String converter is easy to use tool to convert Hex data to plain text. Definition and Usage. If the input argument is an object, then it must belong to a class that implements a string method to represent the object as a string. This is just a quick primer on Javascript Strings in Google Apps Script for the non-coder. Before you can add a conversion tracking tag to your website, you'll need to do the following: Create a conversion action in your Google Ads account. But strings are sometimes parsed as UTC and sometimes as local time, which is based on browser vendor and version. This will bring back the formulas. I receive the string gremlin script, then I use GremlinGroovyScriptEngine eval the script, it is work. The parseInt() function parses a string and returns an integer. VALUE("123") VALUE("7/20/1969") VALUE("12:00:00") Syntax. When you have eliminated the JavaScript , whatever remains must be an empty page. The (slightly modified) script is shown below: @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET _SAMPLE=Test Output to be Cased. Elapsed Days and Time Between Two Dates in Google Sheets. In addition to the above how-to, I will explain how to convert a local DateTime to Unix time, I mean the reverse of the above. I will go with a simple example using the following text string: “Date: 04/01/2025” We can use the . prototype. How to Convert Object to String. I will go with a simple example using the following text string: “Date: 04/01/2025” We can use the . Syntax: dateObj. string_expression must include a timestamp literal. In this article, we will look at how to set the type of a PowerShell variable and convert a string value to an integer. Script 1 : This is from me. The secure string can be converted back to an encrypted, standard string For other kinds of conversion tracking, like apps, phone calls, or offline conversions, find the instructions here. Proceed to import the PDF that you want to convert into text using the getDocument method of PDFJS (exposed globally once the pdf. He is the developer of Mail Merge for Gmail and Document Studio. There are different ways to go about doing this. toString() method returns a string representing the specified number object. google apps script convert column number to letter - Code. 3. In the previous post in the Google Apps Script Pattern series we looked at selectively updating rows of data in a Google Sheet. How to Use DateTime in Query in Google Sheets. script. ” Fortunately, Google has your back with Google Apps Script. Converting a char array to a numeric type will produce an array of the corresponding Unicode code values. When reading this value from the data flow buffer in a SSIS Script component the "ntext" column actually returns the data as a "BlobColumn" and in order to get the text string of the data in the column I had to use the GetBlobData() method in the DTS. Learn to work on Office files without installing Office, create dynamic project plans and team calendars, auto-organize your inbox, and more. Alternate encodings like CESU-8 and Modified UTF-8 are not treated as valid UTF-8. Any other number should be first parsed into a String (through + "" for instance) and then parsed to a number with a unary operator or a parseInt with a radix. You can also convert the XML to JSON and access the XML nodes though the simpler dot notation. For this post we will look at a couple of patterns for inserting multiple rows of data into Google Sheets. The toString() method parses its first argument, and attempts to return a string representation in the specified radix (base). The LEFT function in Google Sheets will display a substring that is a specified number of characters long, starting at the beginning of a string that you specify. It should be relative simple, with a FOR loop. Below are some examples to illustrate the working of toString() method in JavaScript: Converting a number to a string with base 2: To convert a number to a string with base 2, we will have to call the toString() method by passing 2 as a parameter. When working with data in Google Sheets, sometimes you may have a need to remove the last character from a string (or remove the last 2 or 3 or 5 characters). =text(A6,"yyyy-mm-dd") The text function will convert the date in cell A6 to yyyy-mm-dd format. PSObject]>] -InputObject <String> [<CommonParameters>] Description. Copy, Paste and Convert to String. It is super easy to use JSON. Automation. Thing is, I’ve never written a Google Script, and it’s a bit daunting for me to start on my own. Save to Google Drive. Before we start, Google does a pretty great job explaining the basics of creating a custom function . Generic. Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. These methods will help convert array to string comma separated string. Ask Question Misinterpreted hours and minutes in Google Apps Script while reading Google Spreadsheet data. You can get started right now creating your first Google Apps script from inside Google Sheets. Do you want to convert hex to letters, english, plain text, word? What can you do with HexaDecimal to String Online? This tool saves your time and helps to convert hex to readable plain text data with ease. This can easily be done using some basic formulas in Google Sheets. Then make a copy In the code above, I set the cell that displays the date from the date object, rather than from the date string. The best resource for learning Google Script is the official documentation available at developers. To convert a string to an integer parseInt() function is used in javascript. It’s quite easy to convert a date to a string using the compact method in Google Sheets. Google Apps Script. Online tool for hex decoding a string. But I want to convert it to String format for setting as a parameter for "value:" of ui. I want to force the field to always be a string field, for convenience. The secure string created by the cmdlet can be used with cmdlets or functions that require a parameter of type SecureString. List`1[System. The ConvertTo-SecureString cmdlet converts encrypted standard strings into secure strings. Categories Common function , Google Apps Script Tags Convert , Convert format , Convert value , Google , Google Apps Script , Google Apps Script editor , Integer , Java Script , String Leave a comment Post navigation Visit the Learning Center. In my recent post on using Google Sheets as an application backend, I talked about some of the pros and cons of using Google There are different ways to go about doing this. Enter a HTML text, upload a file, get url for Decoding HTML. See %t and %T behavior. You can use the below formula to return Month name in Text from date. There are several built-in methods in JavaScript that convert from an number data type to a String. Recently, we faced a problem: the PowerShell cmdlet returns a number in a variable of String type. . In fact, I want to translate the string gremlin script to Traversal, i just want to get the Traversal object. In this article you’ll learn how to get started with Google Apps scripting, creating a basic script in Google Sheets to read and write cell data, and the most effective advanced Google Sheets script functions. It is used to convert JSON String to equivalent JSON Object and JSON Object to JSON String. Brian Williams sent me a script by Brad Thone, which uses a hitherto unknown feature of XP's SET command: string substitution is case-insensitive. Load JSON, get text. Text in strings does not convert in this way. Simple and Fast!. toString() methods. Enable JavaScript to see Google Maps. Convert Date to String in Google Sheets Using the Compact Method. These sample scripts are for converting from a1Notation to GridRange. First, see the formula below. This results too convoluted considering JavaScript handle date-times considering the timezone offset. Non-string arguments are first type-converted to a string as described above. If a string with a number is sent then only that number will be returned as the output. The FileReader API has a couple of useful methods like readDataAsUrl(), For Number objects, the toString() method returns a string representation of the object in the specified radix. Sample Usage. The radix parameter is used to specify which numeral system to be used, for example, a radix of 16 (hexadecimal) indicates that the number in the string should be parsed from a hexadecimal number to a decimal number. Test out this example by clicking this link or on “03 – Variables Example to the right”. getDataAsString(charset) String: Gets the data of this blob as a string with the specified encoding. Understanding Unix Time is essential to write a formula that converts Unix Timestamp to local DateTime or vice versa in Google Sheets. Converting an integer to a string with base 16. Just copy and paste the code in your Script Task (paste the function outside Main()) and it works right away. Sometimes, you need to convert a JavaScript object to a plain string that is useful for storing object data in a database. parseInt() function returns Nan( not a number) when the string doesn’t contain number. Our Power Tools – a collection of 30+ add-ons for Google Sheets – contains a perfect assistant. sample 2014‑01‑01 <any> T: Produces a string that is a valid BigQuery constant with a similar type to the value's type (maybe wider, or maybe string). Best way to convert string to a number? Negative hexadecimal numbers are the only ones that break inside a string. For its internal database, Google Sheets stores all dates as integer numbers. Google Sheets: The Best Overtime Calculation Formula. Created for developers by developers from team Browserling. For some reason, when I call toString() on the content of a cell, I get a type error: "TypeError: Cannot find function includes in object Semester Long Clinics. At starting we see 2 type of data declaration in Javascript. parseFloat takes advantage of performance, but can give you some convert string to number Showing 1-29 of 29 messages. Scenario. I've read elsewhere that the following parseFloat function converts strings into numbers, but I can't seem to figure out how to place it inside my script. JavaScript is forgiving so it won’t crash our program, instead it does know how to concatenate strings, so it will convert everything into a string. In the case of ‘x’, it is a string, so it simply adds the string of ‘1’ to the end of the initial string. I. You'll find here many add-ons, tutorials and code examples for Google Apps Script developers. Need of Convert string to int javascript. @@last_job_id: STRING: Job ID of the most recent job to execute in the current script, not including the current one. In this tutorial, I will show you how to use formulas to remove the last character from a string in Google Sheets. For radices above 10, the letters of the alphabet indicate numerals greater than 9. JSON is a popular data format used for data manipulation. COUNTIFS in a Time Range in Google Sheets [Date and Time Column]. Have you ever asked for a list from a client, another department or agency and instead of saving into a file that might even be considered marginally useful, they give it to you as a pdf. Both scripts can retrieve the same result. getDataAsString();} The quickest way to convert formulas to values in your spreadsheet. toString() method returns a string representing the specified number object. There are the following three libraries are used to convert String to JSON Object in Java: Using Gson Library; Using JSON-Simple Library; Jackson Library; Using Gson Library. The String() function converts the value of an object to a string. Here’s a bare-bones example of how a string of text might come together in … Continue reading "Google Apps Script: Basic Beginners Guide to To read it, you need to convert it to a string — and one easy way of doing that is using the FileReader API. The parseFloat function accepts a string argument and returns a floating point number resulting from parsing that string. format() method, string concatenation operator etc. string Categories Common function , Google Apps Script Tags Convert , Convert format , Google , Google Apps Script , Google Apps Script editor , Integer , Java Script , String Leave a comment Post navigation See full list on stackabuse. How to Filter Timestamp in Query in Google Sheets. And if you think you may need to revisit the formulas in the future, it’s recommended to create a backup copy of the Google Sheets document. Is this possible google script? The reason I’m doing it through script is that the dates aren’t laid out like “9am”, they are like “9am-12pm 1pm-5pm” so I use the script to substitute stuff and get it in an array with just the “9am”, etc. Suppose I’ve number 1 in Cell A1 in my Google Sheets. Convert a number to a hexadecimal In case you convert the cells that contain formulas to values and want to revert back, you can use the keyboard shortcut Control + Z. The only documentation i could find says that you must do the following. VALUE returns a pure number even if the argument to the function was interpreted as a date. For radices above 10, the letters of the alphabet indicate numerals greater than 9. How to Convert a Number to a String in JavaScript. Free online JSON to string converter. Most of what we’ve talked about so far involves building on top of one of the existing Google Apps services, but this one is entirely new and will kick off a string of more advanced tutorials for Google Apps Script. It is just used along with a Date object created using Date() constructor whose contents are converted into a string. The same also happens when the separator is not present in the string. Below are some examples to illustrate the working of toString() method in JavaScript: Converting a number to a string with base 2: To convert a number to a string with base 2, we will have to call the toString() method by passing 2 as a parameter. You can chose from following 2 scripts. 12345 or 1A345 As it is LOADed, the field is therefore interpreted as a number or a field. Load a binary, get a string. As a note, I have to describe that this is the result for Google Apps Script. The date. Created for developers by developers from team Browserling. : This is the classic example. e. Specifically, i am override the variables in the 'Create or Update Resource Group'. The object structure of PDF. js script is loaded in the document). About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features Press Copyright Contact us Creators Problem: The setNumberFormat function within Google Apps Script is not well documented in the API reference documentation. Here is the result for working base 64 decode methods : function base64Decode(input) {return Utilities. Before convert array to delimited string in javascript, we would like to demonstrate to you two important methods of javascript. The date object is created using date() constructor. @@project_id: STRING Introduction Managing data is one of the fundamental concepts of programming. script. Google Sheets: convert date to number; Google Sheets: convert date to text; How Google Sheets formats dates. ) and is the first professional blogger in India. If you get a list of string values separated by commas and you want to filter out the empty strings, you can pass the Boolean constructor function into Array. Liked it !!! Hit the clap button below. newBlob(Utilities. String: Gets the data of this blob as a String with UTF-8 encoding. toString() and . isGoogleType() Boolean: Returns whether this blob is a Google Workspace file (Sheets, Docs, etc. Free online binary to string converter. parseInt() function returns Nan( not a number) when the string doesn’t contain number. You can see that after changing the base, our output is now different. Looking at the decode method documentation provided by Google here I found an easy way to convert the byte[] to a String. setBytes(data) Blob Converts a string in any of the date, time or number formats that Google Sheets understands into a number. About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features Press Copyright Contact us Creators Posted 3/17/12 6:29 PM, 11 messages To convert a string to an integer parseInt() function is used in javascript. They are join() and toString() methods in js. Hello guys, in this video you will learn how to convert the javascript object to JSON string. In fact, I've already tried "Macro converter" but it gave me a too heavy code and I'm pretty sure that Google Script has a mean to reach my goal quickly and efficiently. The first part is setting up the ESP8266 hardware to read the soil moisture sensor output. Gson is an open-source and rich Java library provided by Google. This approach ensures that the format of the input dates and times is correctly interpreted. In this tutorial, we will learn how to convert the JSON (JavaScript Object Notation) string to the Python dictionary. com. toString()¶ The toString() method takes an integer or floating point number and converts it into a String type. T. … Continue reading "Google Apps Script: Extract Now to the compact method of conversion. All functions and operators that act on STRING values operate on Unicode characters rather than bytes. For example, see Convert Date String from Custom Format. The JSON. toString() Parameters: This method does not accept any parameter. To learn creating a dictionary from JSON carry on reading this article… Python program to convert JSON string to Dictionary Im having issues trying to convert an environment variable marked as secret to a secure string needed for an ARM Template parameter in a release management step. Some of the ways in which this can be done by using type casting, getting the date in US format, using parsing of Date Time. com Definition and Usage. It is recommended is to store dates as UTC and make computations as UTC. The base is 16. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML. VALUE(text) text - The string containing the value to be converted. stringify() Method¶ The JSON. To convert an integer to string with base 16, use the toString() method by passing 16 as a parameter. I'm writing a very simple google spreadsheets script and need to compare strings. split() methods to put the string into an array delimited by a space in Google App When pattern4 is used for importing CSV data to Spreadsheet, the cost can be reduced by 72 % from pattern3, which use the method converting mimeType from CSV to Spreadsheet. In many cases, it may be required to convert a string to a date variable or a date-time object. Published in: Google Apps Script The XMLService class of Google Apps Scripts lets you parse and navigate the nodes of any XML file. Convert a hexadecimaly encoded text into an decoded string or download as a file using this free online hex to text decoder utility. Currencies appear as currencies, decimals as decimals, percentages as percentages, and dates as dates. How to Convert a String into a Date in JavaScript. Input STRING values must be UTF-8 encoded and output STRING values will be UTF-8 encoded. Converting a Number to a String [/javascript-convert-number-to-string] is a common and simple operation. First things first: before any activities related to dates in spreadsheets, it's crucial to understand the core principles of how dates work. Just load your binary and it will automatically get converted to a string. As far as I can tell, I’d need a Google Script that parses both strings character by character and output "–" when they are identical, and output the value of the character string from B2. I'm looking for someone who can convert an instruction in VBA to Google Script. Let’s see the problem in the example code. We have three different ways in which we can achieve the desired tasks. Often looks similar to casting the argument to STRING. In this tutorial, you will learn, how to convert array to string comma separated string in javascript. Find local businesses, view maps and get driving directions in Google Maps. toString() method is used to convert the given date object’s contents into a string. I can create a formula as below to convert that number to the corresponding month name, i. When converting from one date and time format to another, first pass the text to the datenum function, so that you can specify the format of the inputs. How to convert String to INT. The Google Apps Script reads the HTML body of the Gmail threads, strips the inline images, saves the thread as an HTML file and then converts the HTML into a PDF. We can convert int to String in java using String. Online HTML Decode tool to decode html string. So it automatically converts to a date like JANUARY 1 which Google Sheets MONTH function accepts. If a string with a number is sent then only that number will be returned as the output. js loosely follows the structure of an actual PDF. getName() String: Gets the name of this blob. Here's the code: See full list on 2ality. valueOf() This site is owned & maintained by Romain Vialard, creator of Gmail Meter, Yet Another Mail Merge, Awesome Table and many other useful add-ons for Google Apps. Run the collection from Add-ons > Power Tools > Start and click the Formulas icon: Return Value: The num. It is done with the toString() method. Now see what are the problem and where we needed to convert a string to int:-If you have to the comparison of the two variables, it would fail because they’re two different types of objects. It is super easy to use JSON. Conversion of string to number in javascript can also be done in many different ways. Note: The String() function returns the same value as toString() of the individual objects. In the context of a script, this returns the job responsible for the current statement, not the entire script. You can convert that both the columns back to the number, and populate the entire table in another location on the same sheet or another tab. For Number objects, the toString() method returns a string representation of the object in the specified radix. 1) String. If string_expression includes a timezone in the timestamp literal, do not include an explicit timezone argument. The Convert-String cmdlet formats a string to match the format of examples. Supported date formats: YYMMDD YY-MM-DD YYYYMMDD YYYY-MM-DD Of course it's possible to add code for more… I tried to get current "YYYY-MM-DD" in Google Earth Engine script. How to Convert Military Time in Google Sheets. Google Apps Script, Javascript, strings Hey there, Yagi here, you’ve probably stumbled across this page from a link from one of my other in-depth tutorials. toString() and . This article explained different methods to parse a string to a boolean in javascript. Returns a printable string representing the value. Let’s discuss each of them. In the first method we have used CAST function; in the second method we have used CONVERT function and in the third method we have used STR function. =text(date(2018, A1,1),”MMMM”) Formula Logic: It’s like this. base64Decode(input)). It is generally used if we have to display number in textfield because everything is displayed as a string in form. So we joined the Month in Text with a number like A3&1. Could you please help me ? Code of verification of mine is follows. Examples Example 1: Convert format of a string Java Convert int to String. If you'd rather avoid stumbling over incorrect buttons, we've got you covered. For example, grab the menu of a Wikipedia page to display it in an Apps Script web app. All of the sequences of two 00 values are null characters, so this is why your string is terminating upon conversion. Management. where "json" can be substituted with the string "xml" if you wish the returned data to be in XML instead of the JSON format, and parameters should consist of the following 3 pieces of info: Expected parameters for Google Time Zone API call: The Save Gmail to Google Drive program using Google Scripts to save Gmail message as PDF using the built-in PDF converter of Google Docs (now Google Drive). Google Sheets has a function called PROPER() that converts a string in your spreadsheet to Proper case, but unfortunately, there is no such function in Apps Script. If the separator is an empty string (“”) then every character of the string is separated. Pipeline namespace. If the original value is alphabet or symbol, it returns “NaN”. Basically there are two parts to this project. Note: The String() function returns the same value as toString() of the individual objects. Notes. The same goes for the other way around, converting a String to a number. Converting String to Number As with the previous shown methods, JavaScript also provides functions to easily transform a String to a If the given string (‘true’) matches, then the corresponding boolean is returned and boolean false is returned in every other case. See %t and %T behavior. Hi, I'm attempting to pull data from a spreadsheet and use it to create an ROAS variable inside a larger script, but it is returning the data as a string value and therefore returned NaN. This was so that the user could double-click the cell and get a calendar, making it much easier to manually change the date. convert string to number: William: 6/15/08 5:09 AM: Hello, if I use the sprintf function it would give me a How to Convert Numbers to Month Name in Google Sheets. As a result, we cannot compare it with another variable of type Integer. January. The String() function converts the value of an object to a string. It looks like your varbinary string got injected with some nonsense. How to Create a Google Apps Script. We’ll start with the writing data example on the Google Apps Script site: Hi, thanks for the answer. stringify() method is used to convert object to string which is Hello guys, in this video you will learn how to convert the javascript object to JSON string. Sometimes, you may need to convert a number from decimal to hexadecimal. Hi I am loading a table where a key field (for linking with other tables) may be just numeric or may be alphanumeric. If value is a number or a reference to a cell containing a numeric value, TO_TEXT returns value as a string, with existing formatting retained. date_expression[, timezone]: Converts a DATE object to a TIMESTAMP data type. The best format for string parsing is the date ISO format with the JavaScript Date object constructor. split() methods to put the string into an array delimited by a space in Google App Convert hex to text and hex decode strings. The second part involves creating a Google sheet and configuring it to accept the sensor data sent by the ESP8266 module over the internet using a Google App Script that is provided with this tutorial. In this tutorial, we will show you how simple can be converting decimal number to hexadecimal in JavaScript. To convert it into the string variable, first, we will use the explicit method by using a square bracket and data type to convert inside the brackets. In practice, this means that you can use Google Apps Script to customize Google apps and create new capabilities. Here are other video tutorials and online learning resources where you can get up to speed using Google Apps Script that will let you programmatically access various Google Apps and services include Gmail, Google Drive, Calendar, Google Forms, Google Docs and more. Just load your JSON and it will automatically get converted to plain text. An alternative method of converting a string into a number is to use one of the global functions designed to parse a string and return a number. Here’s a bare-bones example of how a string of text might come together in … Continue reading "Google Apps Script: Basic Beginners Guide to If you want to take the timezone setting automatically then you should use Google Apps Script Class Spreadsheet method getSpreadsheetTimeZone() and convert the returned script to a timezone offset value. The toString() method parses its first argument, and attempts to return a string representation in the specified radix (base). This is a way you can build up larger and larger string into messages, which can later be added to documents or emailed. So the result would need to be converted to a string to be usable. A slightly less common approach is to use the join() method. The VBA code : Run a script to convert “中國” into integer format. It is used with ConvertFrom-SecureString and Read-Host. In PowerShell, this can be done in many ways. According to Google, it allows you to “increase the power of your favorite Google apps” including Docs and Sheets. google script convert to string