Skip to main content
jordan_cook
Contributor ⭐️⭐️⭐️⭐️⭐️
August 14, 2025
New Idea

Allow for free-form JavaScript in formula fields

Related products:CS Rules Engine
  • August 14, 2025
  • 0 replies
  • 27 views

I would love it if Gainsight would allow for the creation of JavaScript (or similar) functions within a formula. This could exist across Horizon Rules Engine, Data Designer, and even in GDM.

For example, I would love to be able to count the number of options selected in a multi-select picklist. Right now, it’s nearly impossible to accomplish this within Gainsight if there are a large number of possibilities. But I could accomplish this with one line of code.

StringField.split(';').length;

No complicated pivots, no crazy case statements that eventually run out of options. Just one simple line of code and we are done.

This of course could expand to many, many additional use cases. We could convert dates/times. We could manipulate text fields easily. We could count things, do math on things, and even utilize RegEx. The possibilities are essentially endless. And I suspect that you are already executing code like this with the formulas that are available, but there are heavy guardrails in place by only allowing us to use specific functions.

I would also envision a quick formula validator. It wouldn’t have to be complicated - it would simply execute the formula on the fly within the UI. If it results in a syntax error, don’t allow the user to save the formula. Otherwise, just about anything is fair game.

This would expand the capabilities of the rules engine by leaps and bounds!