![]() Var formattedDate = Utilities.formatDate(new Date(), "GMT-3", "MM/dd/yyyy HH:mm:ss Z") īut even by addding formattedTime to the. Var formattedTime = Utilities.formatTime(new Date(), "GMT-3", "HH:mm:ss a") Var financesheet = SpreadsheetApp.openById("mywebappidgoeshere").getSheetByName('Sheet1') This is the code I used absent mywebappid and it sort of works Should print formattedDate in column 1, formattedTime in column2, followed by amount, account, category, detail. appendRow command in the scriptįinancesheet.appendRow() ![]() it simply prints the date as mm/dd/yyyy in the first column, irregardless of what I pass in the. Changing format of variable formattedDate doesn't seem to make any difference either. I Copied your source code and it does run, however I noticed that when trying to variable formattedTime to the spreadsheet, I can't seem to get it to print. Var formattedDate = Utilities.formatDate(new Date(), "GMT-3", "MM/dd/yyyy") įinancesheet.appendRow() Į)Now we should have something looking like this:įirst, the workflow side works as expected, with no errors. Var formattedTime = Utilities.formatDate(new Date(), "GMT-3", "h:mm a") Var category = JSON.parse(e.parameters.category) Var account = JSON.parse(e.parameters.account) Var amount = JSON.parse(e.parameters.amount) IMPORTANT: We need to copy the id of the sheet, which you can find it in the url:Ĭ) Name it something like "Finances Listener"ĭ) Delete everything you see ( function myFunction().) and replace it with the following code: var financesheet = SpreadsheetApp.openById("sheetid").getSheetByName('Sheet1') It is important to note that the format of how I track my finances is like this. You need to have a google account for this, which if you don't I don't know why you're even reading this. (I'm sorry for the language, I'm not a programmer, I just do stuff from tutorials without a deep knowledge of anything ¯\_(ツ)_/¯)įirst, we need to create a google sheet where we'll track our expenses. This is free and easy to do, and I'll show you how. It's relatively simple, what you need to have is:Ģ)A google script that "listens" to the messages from the shortcut, and updates your sheet. Just wanted to share a shortcut I made, to update the google sheet where I track my expenses.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |