Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zackakil/appscript-toolbox
🧰 Useful functions for AppScript in Google Workspace.
https://github.com/zackakil/appscript-toolbox
appscript google-workspace productivity utility
Last synced: 9 days ago
JSON representation
🧰 Useful functions for AppScript in Google Workspace.
- Host: GitHub
- URL: https://github.com/zackakil/appscript-toolbox
- Owner: ZackAkil
- Created: 2023-11-09T12:00:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-09T17:04:39.000Z (about 1 year ago)
- Last Synced: 2024-12-06T19:10:53.654Z (about 2 months ago)
- Topics: appscript, google-workspace, productivity, utility
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# appscript-toolbox
Useful functions for appscript.### Get the data from a row as a object where the column names are the fields
```js
function getRowDataAsObject(sheet, rowNumber){
`
Takes a sheet and a row number and returns an object with the header values as keys and the corresponding row data as values.Args:
sheet (Sheet): The sheet to get the data from.
rowNumber (int): The row number to get the data from.Returns:
dict: A dictionary with the header values as keys and the corresponding row data as values.
`
const header = sheet.getRange(1, 1, 1,
sheet.getLastColumn()).getValues()[0]const rowData = sheet.getRange(rowNumber, 1, 1,
sheet.getLastColumn()).getValues()[0];const outputObject = {}
for (let i = 0; i < header.length; i++) {
outputObject[header[i]] = rowData[i]
}
return outputObject
}
```