## Forum Discussion

### 2 Replies

Sort By

- _anomDiebolt_Qrew EliteSure there are!

I just slapped together three simple formulas the other day but did not give the common technique a snappy name. How about the**OEH Technique**- the**O**n**E**rror**H**TML**Technique**named of course after the "" chant sung by the**O**oo -**e**eeee -**h**oo!**Winkie Guards**in the**Wizard of Oz**(that is what they are singing - it is in the script if you don't believe me):Well I added fourth formula to the demo which calculates all the

**prime numbers**less than the value in the field**[Number]**. You can check it out here and even add your own records:

https://haversineconsulting.quickbase.com/db/bm5f3b6ra?a=td

Well the thing that is special about this new formula is that I__didn't__write the formula! Here it is but I swear I didn't write this formula:"<img src

Instead I created a very small form to generate the formula from some simple JavaScript pasted into the form. Have a look at the screenshot of the form in action:**o**n**e**rror='this.outer**H**TML=( function(max) { var sieve = [], i, j, primes = []; for (i = 2; i <= max; ++i) { if (!sieve*) { primes.push(i); for (j = i << 1; j <= max; j += i) { sieve*= true; } } } return primes.join(", "); } )(" & [Number] & ")'>"

I want to do a little more testing on some more complex JavaScript input but I will be releasing this utility shortly.

Anyway that's the**OEH Technique**. It generates a QuickBase formula that displays whatever you want to calculate on your forms and reports and can include arbitrary HTML content. The generated formula is self contained and does not reference any code pages or other external resources. - _anomDiebolt_Qrew EliteJust an quick update - it looks like we are just going to use a
**Service Worker**to splice the OEH formula generator into the standard field definition page. When you select the checkbox**"Enable OEH?**" you can then enter your JavaScript and field inputs and the QuickBase formula will be auto-generated without the need to click any extra buttons. Also, so nobody accidentally corrupts the generated formula definition we will make the normal formula entry field**readonly**. The interface looks like this: