Expand Formula Editor

The formula Editor is very small and hard to work with, especially for bigger formulas. If we could expand it this would help a lot :pray:

8 Likes

@Jay_Lefebvre + 1 to this.

AND the community has hacked a way around it. Take a look here:

2 Likes

@Johg_Ananda

Oh I didn’t see that one. Unfortunately my CSS knowledge is pretty limited, I tried to make this work with the extension but didn’t have much success :confused: If someone could write down a clear step by step that would be super helpful (to other users as well) :pray:

Thank you

I vote for this as well. Some formulas get hard to read.

Yes larger formula editor, please.

A couple of more suggestion to improve readability of the code:

  1. Ability to save snippets of code as text columns to be injected in other formulas with an evalAsCode() function. This would help a lot to reduce the size of code inside formulas and re-use certain code modules.

Example: a button creates multiple rows with a formula map and execute a set of actions on each iteration. I would like to have the long code for each action in a separate text field to be injected inside the formulamap(), and ideally being able to use “Currentvalue” in the separate code to be injected

  1. Have a “disable formula if” property for columns, like you have for buttons, with the options to return a custom value. Now I’m using a conditional statement inside the formula code itself, but it’s not ideal at all, because it overwhelms the code, especially when you have already nested conditionals.

The following code is a nightmare for me to work with every time I need to modify anything. The formula editor is too tiny.
Also note that the code is overwhelmed by an additional layer of conditional statement used just to disable/enable the formula. (point 2.)

if([Grid Controls].[Exact val]=false,   if([Catalogue Controls].fast_loading, " " , if(thisRow.[Combined Tags].count()=0, CATALOGUE.Filter(If([Grid Controls].[Include not rated], [zero-five-rating]  , Rating) <=[Grid Controls].[Filter by Rating].nth(1)), thisRow.[Combined Tags].Filter(If([Grid Controls].[Include not rated], [zero-five-rating]  , Rating)<=[Grid Controls].[Filter by Rating].nth(1))) )  ,       
   if([Catalogue Controls].fast_loading, " " , if(thisRow.[Combined Tags].count()=0, CATALOGUE.Filter(If([Grid Controls].[Include not rated], [zero-five-rating]  , Rating) =[Grid Controls].[Filter by Rating].nth(1)), thisRow.[Combined Tags].Filter(If([Grid Controls].[Include not rated], [zero-five-rating]  , Rating)=[Grid Controls].[Filter by Rating].nth(1))) ))
2 Likes

Dear @Andr,

Great feedback :+1: +1 from me.

Or to be able to save these snippets to your account, to be global available, like we have the templates available

:bulb:
Great idea, wondering why I have never been thinking in this direction, although we are using it also in the buttons like you mentioned!

2 Likes

Easy to do .

image

  .RvM32e-t { 		
     height: 200px; 	
}

also //comments and local variables would be of huge help in the perspective of having a cleaner and more compact code to work with.

I can’t add more columns to use as variables, as I have 40+ columns in my table. Things are already messy. :smiley:

1 Like

Psst, this is possible with some black magic, but of course I discourage that because you can break your doc easily.

Your code is indeed a nightmare. Perhaps you didn’t know about SwitchIf()?

SwitchIf(
  thisRow.ThisShouldBeDisabled,
  "",

  Condition1 = true,
  Something.Count(),

  Condition1 = false AND Condition2 = true,
  SomethingElse.Count(),

  ElseValue
)

I use this to “disable” formulas for some rows, just setting the first conditional branch to return blank ""

Also felt like practicing some black magic today:

1 Like

Hey, any update here? +1 on this

1 Like

No update as of this moment. We’ve got other projects going, but these notes aren’t forgotten.

Aren’t forgotten indeed:

2 Likes

I know many people probably think this is solved, but I like to work on a laptop with a small screen and the new improved formula editor is still ridiculously small. Why is it not full screen? You can’t interact with anything behind it. Why are the formula details so large they take up half the vertical space when most monitors have more space horizontally? I don’t care how pretty the UI is, I just want to be able to get my work done as easily as possible and the designers seem to have forgotten that screens are not all as big as the ones they use.

To fix this problem, here’s some JS you can use in the the browser console after opening the new formula editor. This code will expand the editor and make it easier to use on small screens. (tested on Chrome only). You can also make a personal chrome extension that runs this code.

// Set height of formula detail bar to auto so it resizes to fit content, not wasting space
detailsBar = document.getElementsByClassName("BMBd5ZSn")[0];
if(detailsBar) {
  detailsBar.style.height = "auto";
}

// Set height of entire formula editor popup to 100% to better use screen space
formulaEditorPopup = document.getElementsByClassName("Vq7jwWv5 au1NW9eF a43UaAJ0")[0];
if(formulaEditorPopup) {
  formulaEditorPopup.style.height = "100%";
}


// Set width attributes for entire formula editor popup to 100%
formulaEditorPopupWidth = document.getElementsByClassName("au1NW9eF")[0];
if(formulaEditorPopupWidth) {
  formulaEditorPopupWidth.style.width = "100%";
  formulaEditorPopupWidth.style.maxWidth = "100%";
}


// Set min width for the portion of the panel that contains actual formulas so can always see it
formulaEditor = document.getElementsByClassName("ZVR3zRTV vX97wcUi")[0];
if(formulaEditor) {
  formulaEditor.style.minWidth = "50%";
}

// Set flex direction so details appear beside formula editor
formulaEditorFlex = document.getElementsByClassName("cLoRfFRL")[0];
if(formulaEditorFlex) {
  formulaEditorFlex.style.flexDirection = "row";
}
1 Like