Better Formula Editor for Anaplan; A new Chrome/Firefox/Edge Extension

GeorgeDuckett
Regular Contributor

Better Formula Editor for Anaplan; A new Chrome/Firefox/Edge Extension

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:

  • Formula Validation: Various checks are performed on formulas including simple things like ensuring all entities are named / referenced correctly or ensuring the correct data types are used throughout the formula, through to things like checking for dimension miss-matches when referring to line items with different dimensions.
  • Formula Formatting: Provides basic formatting for valid formulas; breaking up IF...THEN....ELSE onto multiple lines with proper indentation.
  • Hover Information: You can hover your mouse over most elements of a formula to get contextual information, for example hovering over line items shows their dimensions and data type and hovering over function names to get information about that function.
  • Quick Fixes: When errors are encountered the extension will allow the user to choose an appropriate fix from a menu which when chosen would make the required changes to the formula automatically.
  • Code Completion: As you are typing the editor will offer auto-complete suggestions for things like line items within the current module, fully qualified line items within other modules, function names etc.
  • Function Information: When completing functions with parentheses you get popup contextual information relating to the parameters of the function together with an explanation of both the function and the parameters.
  • Shortcuts: Standard Monaco editor shortcuts apply. Ctrl-Space; Open code completion. Ctrl-Shift-Space; Open function info (when within function parentheses). Shift-Alt-F for formatting.

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.

48 REPLIES 48
GeorgeDuckett
Regular Contributor

Hi @Anaplant, it's closed-source for now, but I might open source it at some point in the future.

Anaplant
Contributor

Awesome; great work on the formula editor, I thought the code completion might be a bit redundant until I also saw it is able to reference line items from other modules, that is very cool!

Was looking to bring something similar to the A+ for Anaplan addon into the new UX with slightly better font formatting / automatic indentations after IF THEN ELSE.
GeorgeDuckett
Regular Contributor

This extension does have formatting, although not automatic (as you're typing). You can right click then choose the  Format option, or use the shortcut Shift-Alt-F. I've not changed font/formatting though, since Anaplan themselves are starting to do a bit of this in that area.

Anaplant
Contributor

This formula editor is absolutely golden. After playing with it for a week, it massively improved my productivity and formula creation abilities. I still couldn't get the IF THEN ELSE formatting working 100%, but it is actually built into Anaplan as of ~ last month, so that's not even an issue. The code completion is really well done, I love that you added the JSON object's naming conventions as well, as a fellow developer in an anaplan chair it get's me acquainted with naming conventions the API might use. 

Just some small feedback because I want to give something back to the project, I noticed TRUE and FALSE doesn't come up after a THEN / ELSE as intuitively as it could as an FYI. 

Thanks again!

GeorgeDuckett
Regular Contributor

@Anaplant, Glad you like it! Not quite sure what you're referring to when you say JSON's object naming conventions.

re. auto-completing TRUE/FALSE, I'm not too sure what you mean there. More generally, I could look to auto-complete true/false if you're within a context that expects a boolean, but after a THEN or ELSE isn't any more specific than the general case of within a boolean line item. Additionally if you had something like IF budget = 0 THEN TRUE ELSE FALSE, that could just be budget = 0. Maybe I've misunderstood?

Anaplant
Contributor

@GeorgeDuckett 

 

Sorry for late reply - my son was born the next day after this post. I think I might have been a bit sleepy, as it wasn't particularly well written on my end! But I think as referring to the objects you grabbed from other modules - as for the second part, I completely forget the example I had in mind :).

Thanks again though!

GeorgeDuckett
Regular Contributor

@Anaplant Ha, absolutely not a problem! Congratulations!

HomlodiCinti
Occasional Contributor

Hi @GeorgeDuckett,

I just started using the extension, our business partner mentioned that he has it on Chrome. Although I am using Edge, but was very happy that the extension is available for that as well.

I am using the NUX, but my business partner is using the old version, because the extension made the formula bar look like the attachment - way more reader-friendly. Anything that I tried I couldn't get Edge to do the same. Also another colleague using Chrome NUX is not seeing the formula like that either.

Is it possible that this separated view is available in the NUX as well?

Thanks a lot

GeorgeDuckett
Regular Contributor

Hi @HomlodiCinti,

 

My extension only adds additional capabilities to the formula editor its self, it doesn't change how it's displayed. I think the new editor (even without my extension) does have the ability to get a view like what you're after, by pressing the icon pictured below. Apologies if I've misunderstood.

 

GeorgeDuckett_0-1648719714023.png

 

anirudh
Community Boss

Hi George, just wanted to say thanks! This is phenomenal work