The main category Formula Templates contains helpful information and application examples for using formulas. Take a look there to learn more about using formulas efficiently in smenso.
Flavors of type "Formula" can be used to calculate between different numeric and date fields from system fields or other flavors. These calculations can be created at task level as well as at project level (portfolio). They work for simple and for more complex formulas. This article shows how to create a Formula Flavor and edit its formula in the editor, and lists the available fields, functions and operators.
Example
As a simple example: there is a custom field (flavor) for the "hours worked" and one for the "hourly rate". A Formula Flavor can multiply them, and the billable revenue is calculated automatically.
The corresponding formula (with pink formatting 😎) looks like this:
In addition, the list view can calculate an average or a sum in each column with numerical values – including or excluding subtasks:
Create a Formula Flavor
Prerequisite: You are allowed to create Flavors.
- In the flavor section of a task, select the
+next to the group name and thenCreate flavor. Admins can also create Flavors in the workspace settings underFlavorswithNew flavor. - Select the type
Formulain theAdvancedarea. - Enter a name in the
Titlefield, for example "Billable revenue". - Click
Create.
The Flavor is now created but does not contain a formula yet.
Edit the formula
You edit the formula in the Flavor's menu. There are several ways to get there:
-
In a task: In the task details, click the Formula Flavor in the flavor table and select
Edit Formula. -
In the project master data: Click the Formula Flavor in the flavor table and select
Edit Formula. -
In a list: Open the column menu of the Formula Flavor's column, for example in the task list of a project or in the project list in the portfolio, and select
Edit Formula. -
In the Flavor Manager (admins): In the workspace settings under
Flavors, move the mouse over the Flavor title, select the icon next to the title and thenEdit Formula. Here you then selectTaskorProject, depending on the level you want to edit the formula for.
In the formula editor, proceed as follows:
- Enter the formula in the top field, or expand the selection area at the bottom of the editor and insert fields, flavors and functions with
Insert. - Check the result in the result preview. It shows the current result, provided the formula was entered correctly.
- Save the formula with
Save. WithCancel, you close the editor without saving.
The formula is edited and saved on the Flavor, but it applies equally to all tasks.
Structure of the formula editor
- The formula is entered in the top field. Functions and texts are highlighted in color.
- The result preview (green field after the equals sign) continuously checks the entered formula and outputs a result if possible.
- The search field can be used to find fields, flavors and functions.
- The arrow at the bottom of the editor expands and collapses the selection area.
- The left column of the selection area contains the sections
General,Fields,FlavorsandFunctions. UnderFlavors, you find all Flavors of the workspace. - The right column shows the description, syntax and, if available, an example for the selected entry.
- The
Insertbutton inserts the entry into the formula field.
Available fields
Standard fields
The Fields section of the editor currently offers the following standard fields:
| FIELD | DESCRIPTION |
|---|---|
| actualcost | Actual cost of the task |
| actualduration | Actual effort of the task in hours |
| approvalTargetStatus | ID of the workflow status the task moves to after the approval that is currently running. Empty if the task is not in an approval |
| approvingPersons | IDs of the people who have to grant the task's currently running approval |
| attachmentIds | List of all attachment IDs of the object |
| column | Column title of the formula field |
| constraintType | Type of date constraint of the task, for example SNET, SNLT, FNET, FNLT, MSO or MFO |
| cost | Planned cost of the task |
| created | Creation date of the object |
| description | Description of the task |
| duedate | Due date of the task |
| duration | Planned effort of the task in hours |
| duration2 | Duration of the task in days |
| edited | Date and time the object was last edited |
| finishedById | ID of the person who marked the task as done |
| finishedOn | Date on which the task was marked as done |
| folder | Name of the folder the task is in |
| guid | GUID of the object |
| hasAttachment |
true if the object has an attachment, otherwise false
|
| id | ID of the current object |
| inApproval |
true if the task is currently in an approval process, otherwise false
|
| isMilestone |
true if the object is a milestone, otherwise false
|
| isProject | Returns 1 if the current object is a project, otherwise 0 |
| isSubtask | Returns 1 if the current object is a subtask, otherwise 0 |
| isTask | Returns 1 if the current object is a task, otherwise 0 |
| now | Current date and time |
| observerIds | IDs of the people who watch the task |
| observingRoleIds | IDs of the project roles that watch the task |
| observingTeamIds | IDs of the teams that watch the task |
| priority | Priority of the current object as a number |
| projectGuid | GUID of the current project |
| projectId | ID of the project, if available |
| projectIsFavorite |
true if the project is marked as a favorite by the current user, otherwise false
|
| projectLabelIds | IDs of the labels assigned to the project |
| projectTitle | Title of the current project |
| proxyIds | IDs of the deputies of the people assigned to the task |
| roleIds | IDs of the project roles assigned to the task |
| rolesOfAssignedPersons | IDs of the project roles held by the people assigned to the task |
| startdate | Start date of the task/project |
| status | (System) status of the task: 0 (= Not started), 1 (= In progress), 2 (= Done) |
| taskDependency | Returns whether the task has dependencies on other tasks. The value can contain Present (a dependency exists), BlockedBy (blocked by another task) and/or Blocks (blocks another task) |
| teamsOfAssignedPersons | IDs of the teams the people assigned to the task belong to |
| title | Title of the current object |
| today | Current date |
| userTaskFolderId | ID of the folder the task is stored in within "My Tasks" |
| userTaskFolderTitle | Title of the folder the task is stored in within "My Tasks" |
| workflowId | ID of the workflow assigned to the task |
Custom fields (Flavors)
In addition to the standard fields, all Flavors used in the workspace are available in the formula editor so that their values can be used in formulas.
Available functions
The formula editor offers more than 50 functions. We support many of the common functions you may know from Excel or Google Sheets. Description, syntax and example appear in the editor as soon as you click a function. Detailed explanations with application examples are available in the articles of the category Formula Templates:
-
Numbers and sums:
abs,asNumber,floor,ceil,round,pow,cbrt,min,max,minAll,maxAll,minFolder,maxFolder,sumSubtask,sumAll,sumFolder -
Text:
trim,lower,length,startsWith,endsWith,replace,count,contains,indexOf,padLeft,padRight,segment,sort,subString,format -
Date and time:
year,date,shortDate,formatDate,toTimestamp,fromTimestamp,days -
Buttons:
createButton,OpenURL,OpenMail,JSONPackage,HTTPPost -
Conditions, flavor values and data:
if,flavor,projectFlavor,relation,fromParent,asType,persist,shortenGUID,encodeURI,getUserName,getUserNamedEMail,getUserEMail,selectedColumns,markedColumns,registerFlag
getUserEMail does not have its own article yet; its description is available in the editor.
Operators
Operators allow calculations, comparisons and logical combinations within formulas. They can be used in combination with fields, values and other functions to create dynamic calculations and conditions.
| Operator | Description | Example |
| * | Multiply | |
| / | Divide | |
| + | Add | |
| - | Subtract | |
| && | Logical AND | |
| || | Logical OR | |
| == | Equals | |
| != | Not equal | |
| > | Is greater | |
| < | Is less | |
| >= | Greater or equal | |
| <= | Less or equal | |
Comments
0 comments
Please sign in to leave a comment.