In this video, you will learn:
Hi, I’m Chuck Middleton, and I’m going to show you how to use the Calculation Editor.
To access the Calculation Editor, you need to create or edit a calculated custom field. I’ll create a new one by going to Setup, Custom Forms, and I’ll create a New Custom Form of type Issue.
And we’re going to use this in a Request Queue, so we’ll also make it type Project and we’ll name it Request Information.
And then we’ll go and we’ll create a Calculated Custom Field.
We’ll call this SLA Review Due Date.
In this example, the SLA Review Due Date will be calculated as three days after the date that the request was submitted, excluding weekends.
So we’ll put this in the instructions.
Instructions are optional, but they can be helpful, so we’ll use them here.
And we’ll set the date as the format type.
Now, we can type it into the calculation field here or we can click Maximize to go to the Calculation Editor, which is a lot better. This brings up the editor.
Now, we’re going to use the ADDWEEKDAYS expression. We can select it over here, so Date & Time Expression, or we can just start typing it. And I’m going to do that and show you how this works.
Once we’ve selected an expression, we can hover over it to see a description, an example, and a link to a help article.
We want our SLA date to be three days after the entry date, so we’ll start typing in the entry date field.
You can see how the typeahead shows a list of fields to choose from. You can use the typeahead to choose from a list of Issue fields and Project fields. So in our case, they have to be available for both Project and Issues, and it also will include any custom fields. So we’ll select Entry Date.
Now, you’ll notice that the Calculation Editor automatically puts curly braces around the word entryDate.
Curly braces are now required for calculations that reference any fields, either custom fields or our non-custom fields. This has been done to standardize the syntax for future enhancements. You don’t have to worry about old calculations that may not have the curly braces. Workfront add curly braces automatically, so they’ll continue to work, but now we want to see where we put the number three. And we’re going to go and consult, for example, here again. So number goes after comma, and then the number here.
Now we have a valid calculation, but let’s add a little more to it so I can show you some more fun things the editor can do.
We’ll add a CONCAT expression right over here so we can provide a little more information to the viewer.
We’ll have our first string say SLA Date =, then a comma.
And we’re going to have our ADDWEEKS expression as the second string.
And then we’ll put today is, and then we’ll add a wild card, $$TODAY.
It’s saying I have an invalid expression, and that’s because I left off this quote there. There we go.
So notice that the parts of the calculation are color-coded.
So expressions here are blue, fields are green, text is kind of an orange-reddish color, and wild cards are pink.
The parenthesis are highlighted to show the closed parenthesis that matches an open. And this can be really helpful in very complex calculations.
Line numbers are also helpful in large calculations, and so is the ability to enlarge the editing screen.
At the bottom of the editor, you can preview your calculation.
I first need to select an Issue from the list.
Here’s our preview, and it looks like I forgot to put a space here before TODAY. So I can fix that right here and the preview is updated.
To leave the Calculation Editor, just click on Minimize.
Thanks for watching. -