Expand my Community achievements bar.

The next phase for Workfront Community ideas is coming soon. Learn all about it in our blog!
SOLVED

New syntax for calculations in custom fields

Avatar

Level 10

I just watched this intro video and it looks great. It feels very well thought out and executed. The consistency between form calcs and reporting is an important update.

I do have a few questions about how it works with multi-type forms.

In the example, a project form, typing partial field names auto-suggests project fields. If the form is a Project/Task form, will it auto-suggest both types of fields? If so, will there be an easy way to tell which object the suggestion is associated with?

Example:

If I have a Project/Portfolio/Task form and start to add the "name" field, will it grab the project, portfolio or task name automatically?

On the same form, if I want portfolio name, it would be {portfolio}.{name}

Would that still work if the form were attached to a task as well as a project, and as well as a portfolio?

I have not tried calc fields on multi-object forms yet so no idea how this works.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi, Randy,

I'm so glad you find the calculation syntax update useful!

As for your questions about multi-object forms:

  1. In case both objects have the same field available, for example {name}, {description}, {entryDate} etc, you can add it and it will retrieve data for all objects. So if you have a multi-object form for Projects and Issues, and add a calculated field with {name} expression, within a project it will display the project name, and within the issue it will show the issue name.
  2. If you want to reference fields specific to an object type, you can use $$OBJCODE wildcard. For example adding a field with the following expression in a project and task form will display the portfolio name if attached on a project, and the project name if attached on a task: IF($$OBJCODE="PROJ",{portfolio}.{name},{project}.{name})
  3. If you add an object type in front of a field name, it references to the object's parent object, so you cannot use {project}.{name} with a project, but can use it with a task.

Hope this provides more clarity about how the system will behave.

Thanks!

Lilit

View solution in original post

4 Replies

Avatar

Correct answer by
Employee

Hi, Randy,

I'm so glad you find the calculation syntax update useful!

As for your questions about multi-object forms:

  1. In case both objects have the same field available, for example {name}, {description}, {entryDate} etc, you can add it and it will retrieve data for all objects. So if you have a multi-object form for Projects and Issues, and add a calculated field with {name} expression, within a project it will display the project name, and within the issue it will show the issue name.
  2. If you want to reference fields specific to an object type, you can use $$OBJCODE wildcard. For example adding a field with the following expression in a project and task form will display the portfolio name if attached on a project, and the project name if attached on a task: IF($$OBJCODE="PROJ",{portfolio}.{name},{project}.{name})
  3. If you add an object type in front of a field name, it references to the object's parent object, so you cannot use {project}.{name} with a project, but can use it with a task.

Hope this provides more clarity about how the system will behave.

Thanks!

Lilit

Avatar

Level 3

Is there a definitive list of OBJCODE out there? I can only seem to find references to that wildcard in a few pages in the experience league, but nothing that explicitly lists the possible options.

 

I'm trying to use IF($$OBJCODE="TASK",{portfolio}.{name},{project}.{name}, to pull the portfolio down to the task level in a project and it is not working. Is the portfolio object too far away from a task object to work?

Avatar

Level 10

Thanks Lilit, I'm not surprised you're involved with this project as it is very well executed.

Point #1 is exactly how I expected it to work. That's very intuitive.

I think your point #3 may be the most important one. I'll make sure to use your objcode IF statement when I need a specific object type value.

Thanks again for a feature that just works!

Avatar

Employee

It's so nice of you to say, Randy, but the credit here goes entirely to the engineering team, and I will make sure to pass your feedback to them :))

Please let me know of any other feedback or questions you have.

Thanks!

Lilit