top | item 19195184

JavaScript-Based Spreadsheet-Like Formulas in Google Docs

74 points| MikaelMayer | 7 years ago |chrome.google.com | reply

23 comments

order
[+] lazyasciiart|7 years ago|reply
FYI, on my phone that link takes me to a generic Chrome page saying "You can add new features to Chrome by installing extensions. Visit the Chrome Web Store on your desktop computer...". It would be better to post the blog article (and maybe make a more obvious "get it here" button somewhere in the article for people skimming :))
[+] chrisweekly|7 years ago|reply
Related tangent: I like how, in his introduction to Mobx, author MWestrate uses the analogy of spreadsheets (data cells, formulas) to explain mobx observables and computeds.
[+] zwkrt|7 years ago|reply
I explain lots of programming concepts to friends/family in terms of Excel. Truly a wonderful program.
[+] threatofrain|7 years ago|reply
I'm a bit averse to newly created accounts linking to nondescript plugins.

Here's a blog post discussing the plugin:

https://mikaelmayer.github.io/blog/2019-02-13-google-docs-fo...

> Have you ever wished you could synchronize content within one Google doc? Do you need temporary placeholders that you will replace later? Do you want to generate text? Do you miss spreadsheets in docs?

> If you answered yes to one of these questions, this Google doc extension is for you. It enables you to define names (a.k.a. variables) anywhere in the document, and to insert computations that produce rich text anywhere in the document.

[+] MikaelMayer|7 years ago|reply
> I'm a bit adverse ...

Besides (what I consider) the introduction of the article, what else do you consider "stilted" advertising language and how can I improve my writing?

[+] writepub|7 years ago|reply
This feedback is unnecessarily critical of a well meaning blog post.
[+] abrichr|7 years ago|reply
What do users without the extension see? e.g. would they see "=name is out!" or "MySoft 1.0 beta is out!"?
[+] mayerwin|7 years ago|reply
The extension isn't just a Javascript overlay, it actually modifies the document in real-time while storing a full understanding of the document structure behind the scene, in the document itself (thanks to the Google Docs API). So other users would see "=name is out!" if this is what you've chosen to show on your own interface, or "MySoft 1.0 beta is out!" otherwise. If they have installed the extension, they would be able to access the document structure information, see placeholders and change variables as they like.
[+] MikaelMayer|7 years ago|reply
This extension stores all formulas as named ranges inside the doc. Because all changes are simultaneously visible by all users, including computing and revealing formulas, it depends on what users with the extension are doing.

This also means that users without the extension can modify any revealed formulas or definitions, and have users with the extension recompute them.

[+] amelius|7 years ago|reply
So by creating a table inside the text document, you can essentially make a spreadsheet?
[+] MikaelMayer|7 years ago|reply
Indeed! However, without range support like A1:A10 or relative references. Besides, values should be defined in order (top-bottom, left-right)

Try to create a 2x2 table like this:

=(/A1=/”Hello”) =(/B1=/”World”)

              =(A1 + “ “ + B1)
Click on Evaluate formula, tadaa. I just fixed a bug to make it work, the publication might take up to 24h.
[+] phonon|7 years ago|reply
Source available?
[+] MikaelMayer|7 years ago|reply
The source is a Google Script. When I try to create a shareable link, either by obtaining the share link or advanced share options, I get the error "Sorry, an internal error has occurred and your request has not been processed.". I'll let you know when it's working again and I'll post the link here.