Formulas
A formula enables you to calculate a value using math and logical operators, field content, fixed values and so on. The value is calculated when requested, for example at the point of generating a document containing the formula, using the latest available information from the Sage People system.
In addition to custom fields in records, formulas can be used in many other areas. How to construct and format a formula can differ depending on where it is used. Formulas are often used in:
- Validation rules
- Flows
- Workflow rules
- Process builder
- Action events
- Email templates
- PDFs
A formula field always as a specific output type. The output types match other common Salesforce field data types.
Output type | Output type description | Example of existing formula field | Other potential examples |
---|---|---|---|
Checkbox |
A Boolean value TRUE or FALSE. When the checkbox is checked, the values is TRUE, and when the checkbox is unchecked the value is FALSE. |
Object: Employment Record Field: Would Rehire? The formula checks if the equivalent field on the Team Member record was checked when the team member was terminated, and matches the value. |
A formula which results in the checkbox being checked (TRUE) for everyone who started in the current year, and unchecked (FALSE) for everyone who did not start in the current year. |
Currency | A financial amount in dollars or another currency. |
Object: Salary Field: Salary Amount |
A formula to calculate the hourly rate. |
Date | A date |
Object: Team Member Field: Current Birthday The formula calculates the birthday this year with reference to the Date of Birth and the current date. |
A formula to calculate a Contract End Date based on the contract start date and contract length |
Date/Time |
A date/time |
No examples of date/time formula fields. Date/time fields are relatively rare in Sage People, used mostly for timestamps and fields such as the Interview Date in the Application object. |
No other examples |
Number | A numeric value, with the number of decimal places specified |
Object: Team Member Field: Age |
A formula to retrieve the actual worked hours per week by checking if Hours Per Week is populated, and if not, retrieving the Hours Per Week from the team member's policy. |
Percent |
A percentage. The percent sign is automatically added to the number. |
Object: Employment Record Field: Potential Bonus Percentage |
No other examples |
Text |
A text string, which can contain letters, numbers and punctuation. |
Object: Team Member Field: Name Full The formula concatenates the values of either Preferred Name or First Name, Middle Name if one is entered, and Surname. |
A formula to concatenate the multiple address fields to create a full address fields. |
Time | A time, saved down to the millisecond HH:MM:SS.MS |
No examples of time formula fields. The Interview Time field in the Application object is an example of a time field. |
No other examples |
If you use formulas in PDF templates, the fields referenced by the formula must start from the object sending the document. For example, if sending a document from the Team Member object, all fields not part of Team Member must be prefixed with the API Name of the object holding the field.