Hello all!
I have made a Google Chrome and Firefox extension that enhances Anaplan formula editing by using the Monaco editor. This is the editor used by Anaplan's new modelling experience. My extension works with this new experience adding enhancements over and above what Anaplan have done. It also works with the current/old formula editing experience; it's best in the new experience though.
Chrome: https://chrome.google.com/webstore/detail/better-formula-editor-for/lonibgccfehnjjhchfcbdhkaajhobeak
Firefox: https://addons.mozilla.org/en-GB/firefox/addon/better-formula-editor-anaplan/
Edge: https://microsoftedge.microsoft.com/addons/detail/better-formula-editor-for/dkeigmhhjolcnnanpachagca...
(Once added be sure to reload any open anaplan tabs)
Details below:
The extension is under active development; currently next on the list is intelligent autocomplete suggestions for lookups required when referencing line items with different dimensions. Something like suggesting "LOOKUP: PROP C10 ItemCustomer.P6 Item" when pressing "[" after a relevant line item.
EDIT: The above is now in this extension. Pressing "[" on a line item with dimensions that the current line item doesn't have will prompt it to work out a reasonable suggestion (based on your usage on other formulas) and suggest those LOOKUP/Aggregations as autocompletes.
Please let me know what you think; I'm very open to further ideas!
If you like my work you can support me here, via the GitHub sponsorship program.
I've made some enhancements to this extension. It now supports code formatting, via the context menu (right-click) and via the standard Monaco editor shortcut (Shift-Alt-F). I know this one was requested a while back. I held off of doing this since I read somewhere that it was on Anaplan's road-map, but since it's been a while I figured I may as well add it in.
I've also improved handling of the Enter and Escape keys. Now, when code-completion is up and you press Enter it will accept the completion, rather than submitting any formula change to Anaplan. Escape now closes any open editor widgets (such as code completion or function information) rather than stopping editing the formula.
Thanks @GeorgeDuckett! I just downloaded it and it looks fantastic - will share feedback, if any, as I use it!
Hi @GeorgeDuckett,
Wow, it's really good! Nice functionalities, extremely helpful, and at least for now I have not met any bugs.
Idea from me: Thanks to formula autocompletion and function information, it's fantastic when you don't remember order of arguments or how some function should be used. And in my opinion, all would benefit even more if you could add:
Also, as you released extension for Chrome, it should work and be installable on any browser that use Blink browser engine (so not only Google Chrome, but also Microsoft Edge, Vivaldi and Opera). However, I am using Mozilla Firefox, which uses different engine, but still your extensions should work there, even though currently it cannot be installed, as it's not in official Mozilla Firefox addons store. So I am using developer mode for your plugin, and tried to adapt it, so it can work under Firefox, and… it worked. So I'd be really happy if you could also officially release your plugin for Firefox, so others can use it as well - the only thing I needed to adjust is manifest.json (I am pasting content of the one that worked for me, feel free to change/update it):
{
"browser_specific_settings": {
"gecko": {
"id": "georgeduckett@anaplan.com",
"strict_min_version": "90.0"
}
},
"content_scripts": [ {
"all_frames": true,
"js": [ "/dist/content-script.js" ],
"matches": [ "https://*.app.anaplan.com/*" ],
"run_at": "document_end"
} ],
"description": "This extension enhances Anaplan formula editing in several ways; providing code completion, hover info and validity checks.",
"icons": {
"128": "logo.drawio.png"
},
"manifest_version": 2,
"name": "Better Formula Editor for Anaplan",
"version": "1.1.0",
"web_accessible_resources": ["dist/*"]
}
Hi @M.Kierepka,
Thanks for the interest; glad you're finding it so useful!
Those are all really interesting ideas and something I could potentially look to add if there's enough interest. I'm not 100% sure if I want to add warnings for things that are valid (but possibly should be avoided) when I don't have an easy way to ignore them. I want to avoid my extension having options, although I'm not opposed to the idea, but even if I added an option to ignore/hide warnings that still might not help though, as there wouldn't be a way of ignoring one warning without ignoring all of them.
Re. the idea about linking to the Planual is good, but would be fairly timeconsuming. Currently to get information about Anaplan functions I'm parsing their documentation automatically since most pages are a consistent format, but for the Planual that isn't the case. Also, most of the topics don't directly relate to a single formula syntax or function; they're general advice so I'm not too sure where any links or text would appear.
Re. a firefox extension I'm working on that, but it's not quite as straightforward as I'd hoped. When publishing the addon there are limits on the size of any one javascript file included. I've eventually gotten around this, but have had to drop support for the old/current modelling UI since that meant I had to include the code for the Monaco editor, which is too large. This meant I had to split the build process to create separate packages for Chrome and Firefox. For Firefox you also have to submit the source code and instructions to run a build, so I've got to make sure I've got clear instructions there too. It is definitely on the list though, and I'm hoping to have something by the end of the week.
@M.Kierepka I've created a version of my extension for the Firefox Addin store, so you should be able to use that version. I was also able to keep support for the old modelling experience in the end even with Firefox's restrictions, although I'd still recommend the new one. I also added a version specific to Edge too for good measure.
The firefox addon page is here: https://addons.mozilla.org/en-GB/firefox/addon/better-formula-editor-anaplan/
No problem. It's a fun little side-project! Yeah, I think the new experience is much better than the old. Was a fun little challenge learning about various bits and pieces to make the firefox addin work with the old too though.
@M.Kierepka @GeorgeDuckett @chenjack.sonos
Does it work on Mac as well? I just added this extension to the chrome and it didn't change anything
@Misbah That's interesting. I don't have a mac to test with, but my understanding is chrome extensions should work the same regardless of operating system. Did you try it in the new modelling experience? Note that visually it won't change anything until you start to edit a formula, at which point it should do the things detailed in the YouTube video; auto complete line items / modules / function names etc.