We'll show you examples where formulas can be applied to change visibility, collpased, Help Text and more.
Formulas V2 has intellisense, stoppability, support for promises and more.
This formula determines the visibility of the Advanced settings group. The group becomes visible, when the Advanced toggle is active.
FormulasVisibleGroup.AdvancedSettings
Field.Settings.Visible (Formula-Target: Field.Settings.Visible)
v2((data) => { return data.Advanced == true; });
This formula changes the Name of the PersonGroup field. The name becomes Person - Profile complete if all group fields are filled out and Person - Profile incomplete if not.
FormulasTextSummary.PersonGroup
Field.Settings.Name (Formula-Target: Field.Settings.Name)
v2((data) => { if (data.Firstname != "" && data.Lastname != "" && data.Address != "") return "Person - Profile complete"; return "Person - Profile incomplete" });
This formula changes the Name of the ProductGroup field. The name becomes "Product ✅" if all group fields are filled out and "Product ✏️" if not.
FormulasEmojiSummary.ProductGroup
v2((data) => { if (data.Name != "" && data.Pricing != null) { return "Product ✅"; } return "Product ✏️"; });
prefill:ProductCode=n0t0k code
prefill:
This formula adds a help text based on the ProductCode Field text. If the ProductCode field contains n0t0k the helptext gets this added: This product code is deprecated. Please request a new product code. If it contains spaces the helptext gets this added: Please remove all spaces from your product code.
FormulasHelpText.ProductCode
Setting Notes (Formula-Target: Field.Settings.Notes)
v2((data) => { const isDeprecated = data.ProductCode.includes("n0t0k"); const hasSpaces = data.ProductCode.includes(" "); return (isDeprecated ? "This product code is deprecated. Please request a new product code. " : "") + (hasSpaces ? "Please remove all spaces from your product code." : ""); });
This formula determines the initial open/closed state - in this case randomly. Normally it would do this based on how complete data in that section is or based on other criterias.
This is often used to improve initial state of a form based on how much data is already filled in.
FormulasRunAtStart.GroupRandomlyOpen
Field.Settings.Collapsed (Formula-Target: Field.Settings.Collapsed)
v2(() => { console.log('Formula to set Collapsed ran - will only run once.'); // Get random true/false var random = Math.random() < 0.5; return { value: random, stop: true }; });