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

Hmm, ok, I'll take a look later today or early tomorrow.

GeorgeDuckett
Regular Contributor

Got it sorted. Sorry about that!
rodriguezramiro
Contributor

It works! Thank you so much! This is great! Now it will be easier to convince my team to start using the New Model Builder Experience!

christine.mollard
Occasional Contributor

Hello Geroge,

 

Your editor would be really helpful for me but I have 2 issues : 

I got an error message as followed 

christinemollard_0-1647357039347.png

and when I finally got the extension installed, it seems that I have colours for the formulas but no tabulation or line break.

christinemollard_1-1647357309062.png

 

Could you please help me ?

Thank you in advance,

GeorgeDuckett
Regular Contributor

Hi Christine,

Not sure about that first message. Possibly you had Anaplan open when you installed the extension?

The formula formatting isn't automatic. When in edit mode you can right click the formula and choose "Format Document" which will do that. As @rodriguezramiro says, you can also use the built-in shortcut Alt+Shift+F.

christine.mollard
Occasional Contributor

Thank you for your quick answer, I didn't know about the Alt+Shift+F

This is really appreciated 🙂

 

rodriguezramiro
Contributor

Hi @christine.mollard,

Did you try pressing Alt+Shift+F when editing the formula?

Regards,

Ramiro
christine.mollard
Occasional Contributor

Perfect !! Many thanks !

GeorgeDuckett
Regular Contributor

I've now just released version 2 of this extension. As well as numerous minor bug fixes and enhancements it adds autocomplete for missing dimension LOOKUPs/aggregations. Pressing "[" after a line item with different dimensions to the formula's line items will prompt it to work out what you've used in other formulas and suggest those.

Anaplant
Contributor

Going to try it out, my team was looking for a replacement of A+ for Anaplan. Is this project on GitHub? Was thinking of making this myself to fool around, curious what the code looks like!

@GeorgeDuckett