[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
/ gsheetToJSON Public archive

Transforms Google Sheet into JSON with a public endpoint

License

Notifications You must be signed in to change notification settings

Link-/gsheetToJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Sheet to JSON Endpoint

This guide defines the process of converting a Google Sheet into a publicly callable JSON endpoint. You don't need external hosting of any kind, everything is done within Google Sheets.

This API Endpoint can be used to provide content to an app able to consume JSON.

Installation

Add the scripts Main.gs and SheetToJSON.gs to an existing or new Google Sheets Workbook.

Usage

The script supports nesting, simply use the dash - in the column name and the script will create the appropriate structure.

Example Sheet

COLUMN NAME COLUMN_NAME COLUMN-NEST-NAME COLUMN-NEST_NAME COLUMN_NEST-NAME
value1 value2 value3 value4 value5
value6 value7 value8 value9 value10

Output

[
  {
    "COLUMN NAME": "value1",
    "COLUMN_NAME": "value2",
    "COLUMN": {
      "NEST": {
        "NAME": "value3"
      },
      "NEST_NAME": "value4"
    },
    "COLUMN_NEST": {
      "NAME": "value5"
    }
  },
  {
    "COLUMN NAME": "value6",
    "COLUMN_NAME": "value7",
    "COLUMN": {
      "NEST": {
        "NAME": "value8"
      },
      "NEST_NAME": "value9"
    },
    "COLUMN_NEST": {
      "NAME": "value10"
    }
  }
]

Credits

LICENSE

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Transforms Google Sheet into JSON with a public endpoint

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published