Add support for registering custom formulas

  • 12
  • Idea
  • Updated 2 years ago
  • Implemented
This has been discussed in various threads but I couldn't find a specific post requesting this feature.  Apologize if it's a duplicate.

Currently, Skuid provides support for many formula functions.  Unfortunately, there are often specific application needs or even just general use cases for formula features that aren't offered by the core product.

Would like to see support added for registering custom formulas.

Examples of what I've needed and added (unsupported currently of course):
1) register ISNEWID(rowId)
2) register ISEXISTINGID(rowId)
3) register ISROWUNSAVEDCLONE(modelName, rowId)
4) register FORMAT_NUMBER(value, format)
5) register FORMAT_FIELD(modelId, fieldId, value)
6) register UPPER(value)
7) register LOWER(value)
8) register LENGTH(value)
...and several others

Thank you!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 3 years ago

  • 12
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Infinite flexibility!
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,220 Points 5k badge 2x thumb
Barry, 
That's an interesting idea, we will consider it for a future release!!! Vote it up if you would like to see this too!

Thanks!

Karen
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Would like to add 

ISBLANK() and/or ISNULL() to that list please
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Hey Dave -  

Just to clarify the "ask" on this post was to add support for allowing page developers to write their own Formula Functions and "register them" so that they can be used on a page.  This would be very similar to writing a custom component and registering it for use.    Being able to write and register custom formulas would provide infinite possibilities with regards to formula support without having to wait for skuid to add these to the core product.

That said, ISBLANK() and/or ISNULL would be welcome additions to the stock formula support.  If what you were asking for in your post was to have Skuid add these to the stock formulas, I'd recommend posting another issue asking for these (I'd vote for it :))!
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Thank you for clarifying that Barry,

This is even a better request that I thought! And as Matt says the infinite flexibility would be a great addon

Thx
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,040 Points 10k badge 2x thumb
Hello Skuid Community ~

Thank you for your thoughtful suggestion! Skuid listened to your concern and has implemented your idea in the new Brooklyn GA release (specifically, under SKUID-2402 in the release notes) which is now available in the Skuid Releases page.

As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade.

Thanks again,
-Mark
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Sweet
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Of course, what we really want (and what Barry is getting at with his #4), is the ability to tell skuid through the formula definition when to automatically trigger reevaluation. Otherwise, we'll be manually calling evaluateFormulaFields() every time a change is made that requires reevaluation.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Matt is spot on with understanding my #4.  Along the lines of evaluateFormulaFields, just a couple of thoughts:

1) It's undocumented and therefore, not officially support and could be removed in future versions (unlikely of course).  I use undocumented "features" all the time, but for those reading this, it's important to note what "undocumented" means and potential ramifications.

2) I haven't looked at the code under evaluateFormulaFIelds in a long time but from what I remember, it will iterate every row in the model and re-evaluate every field that contains a formula.  This could potentially be a large amount of processing that could "slow down" your page.  

Ideally, if we had something like #4, Skuid could be "smart" about what gets re-evaluated focusing the processing on only models/rows/fields that could possibly change as a result of a data change.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
FYI - I just created https://community.skuid.com/skuid/topics/add-support-for-programmatically-triggering-formula-fields-....  Vote it up if you'd like to see this happen!
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Thanks! Voted