Catch-up quick
Reuse formulas with greater efficiency, or simplify syntax within complex formulas with Custom Functions.
Assign your Custom Functions a name upon creation, and reference them throughout your Template's formulas. Custom Functions are denoted by the dollar sign ($) prefix. This is formatted as. . .
=$
”Assigned name”
So, if your function is named “TotalPay”, you’d reference it within your Template as =$TotalPay
.
Shorten the syntax of your repeated or complex formulas with Custom Functions. With Custom Functions you’ll create a formula and assign it a name for reference throughout your Template. You can then. . .
Write, reference, and manage a formula that’s used multiple times in a Template from a centralized location.
Reference a string of syntax multiple times throughout a single formula.
💡As an example,
If you want to write a formula that populates a field value as total pay throughout your Template, you’d reference multiple fields in a calculation. Your Template would include fields named “TotalHours
”, “HourlyRate
”, and “Pay
”.
To calculate the total pay, the syntax would be. . .
=If([TotalHours] > 40, (40 * [HourlyRate]) + (([TotalHours] - 40) * [HourlyRate] * 1.5), [TotalHours] * [HourlyRate])
But, with Custom Functions, you set up a function with the above formula and name your function “Total Pay”. Then, rather than rewrite the formula above within each field, enter. . .
=$TotalPay
Because the TotalPay
definition relies on variables (that is, different hours worked, and different pay rates), it also includes function parameters. Here the function parameters are Hours and Rate.
So, in the “Pay” field’s Default Value property, you’d enter. . .
=$TotalPay([TotalHours],[HourlyRate])
Be sure to always include the “$” prefix when you reference your custom function.
Because Custom Functions are only available within the Template within which they’re created, they require access to the Template Editor.
Set up your Custom Functions in the Template Editor
In the web app’s Template Editor, you’ll access the Template settings (or cog menu) and select Custom Functions.
Here, you’ll create your functions by assigning a Name, Description, Function parameters, and a Definition.
Name is the syntax you’ll use to reference your Custom Functions.
Each Custom Function must have a unique name. If you’ve established naming conventions for your other account resources - like fields, Templates, or DataSources - be sure to follow them here.
A dollar sign ($) is automatically included as a prefix to your function’s syntax. You’ll need to include the dollar sign whenever you reference your function.
You can also select your Template’s available functions in the formula builder’s left-hand panel.
Description communicates what the function’s formula does.
Provide a detailed description for future Custom Function management, and as a means of communication to others within your organization.
Function parameters are variables which you reference within a function.
To populate your function parameters, you can either. . .
Reference the Template fields that correspond to each parameter’s value, or. . .
Enter hard-coded values for each parameter.
As you add Custom Function parameters, you'll find the parameters you create in the left-hand scroll menu as you write your function's definition.
Definition is where you’ll write your Custom Function’s formula or syntax.
As you create functions, you’ll access and manage them through the Template's Settings menu.
To reference a function within a formula, you can either enter them manually, or find your Template’s functions within the formula builder’s scrollable left-hand menu.
⚙️ Expert tip
Reference your Custom Functions within other Custom Functions. Nested functions help to simplify complex formulas.
Related topics
Explore how you can use the Account User List to auto-fill multiple fields using a single user response.
Find more opportunities to automate your processes with Workflows.
Fill in any holes in your knowledge of calculations and formulas on the dedicated calculations site.