In this tutorial you'll learn some of the advanced APIs such as:
Formulas V2 has intellisense, stoppability, support for promises and more.
Most formulas will run on every change.
Special formulas such as these returning a promise will auto-stop (unless stop: false).
But if you want to stop running your formula at any time, you can also return a value with stop: true.
todo todo
FormulaStop.Title
Field.Value (Formula-Target: Field.Value)
v2((data, context) => { alert("you will see this alert once, after this the formula won't run any more."); return { value: "this is a new title", stop: true, }; });
Show a warning or info based on the feature GoogleTranslate being enabled.
FormulasFeatures.GoogleTranslateWarning
Field.Settings.Visible (Formula-Target: Field.Settings.Visible)
v2((data, context) => { return !context.features.isEnabled("EditUiTranslateWithGoogle"); });
FormulasFeatures.GoogleTranslateInfo
v2((data, context) => { return context.features.isEnabled("EditUiTranslateWithGoogle"); });
This formula shows information about the user and shows a warning if the user is not logged in.
FormulasUser.UserInformation
Field.Settings.Notes (Formula-Target: Field.Settings.Notes)
v2((data, context) => { return data.default .replace('[name]', context.user.name ?? "unknown") .replace('[userid]', context.user.id) .replace('[isanonymous]', context.user.isAnonymous) .replace('[issiteadmin]', context.user.isSiteAdmin); });
FormulasUser.WarningAnonymous
v2((data, context) => { return context.user.isAnonymous; });