-
Notifications
You must be signed in to change notification settings - Fork 664
Google Spreadsheets
Mathias Rangel Wulff edited this page Apr 13, 2020
·
5 revisions
AlaSQL can query data directly from a google spreadsheet - so its easy to edit the raw data in the spreadsheet and make manipulations like grouping, filtering, or saving to XLSX directly in your app. The feature depends on the plugin Tabletop library.
<script src='https://cdnjs.cloudflare.com/ajax/libs/tabletop.js/1.4.2/tabletop.min.js'></script>
<script src="//cdn.jsdelivr.net/alasql/0.2/alasql.min.js"></script>
<div id="res"></div>
<script>
var url = 'https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AmYzu_s7QHsmdDNZUzRlYldnWTZCLXdrMXlYQzVxSFE&output=html';
alasql('SELECT * INTO HTML("#res",{headers:true}) FROM TABLETOP(?) WHERE name < "D" ORDER BY category',[url]);
</script>
Play with this example in jsFiddle
Remember to publish your spreadsheet. In case of problem read this StackoOverflow question.
More info about the TABLETOP
keyword
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo