Calculated Field with IF Expression | Community
Skip to main content
Level 9
October 28, 2021
Solved

Calculated Field with IF Expression

  • October 28, 2021
  • 6 replies
  • 1153 views

Hi WF Community,

I'm trying to create a calculated field on the Task object with a simple IF expression, yet it keeps telling me the "Custom Expression is Invalid".

Here's my expression:

IF(INV - Item Number="I-132 Retainer",400001 Retainer,"")

*INV - Item Number is another field (dropdown) on the same custom form

Does anyone know where I'm going wrong?

Thanks,

Nick

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Richard_Le_

HI Nick,

It's likely the problem you are experiencing is due to field you are referencing in the expression having a '-' character in it. Workfront generally doesn't like non alphabetical or numerical characters the custom field names as it reads them as part of your expression, in this instance it is reading a minus symbol.

Try updating the field name to remove the '-' symbol and see if that works.

Best Regards,

Rich.

6 replies

Richard_Le_Community AdvisorAccepted solution
Community Advisor
October 28, 2021

HI Nick,

It's likely the problem you are experiencing is due to field you are referencing in the expression having a '-' character in it. Workfront generally doesn't like non alphabetical or numerical characters the custom field names as it reads them as part of your expression, in this instance it is reading a minus symbol.

Try updating the field name to remove the '-' symbol and see if that works.

Best Regards,

Rich.

NickVa7Author
Level 9
October 29, 2021

Thanks, Richard. This was the issue! Gott'er working now after that modification.

NickVa7Author
Level 9
October 29, 2021

Hi again, Richard.

I went to add additional IF's to that original expression, but I'm getting that "Custom Expression is Invalid" error again.

Here's my original, singular IF that works:

IF(INV Item Number="I-132 Retainer","400001 Retainer","")

Here's my new, multiple IF that isn't working:

IF(INV Item Number="I-132 Retainer","400001 Retainer",IF(INV Item Number="I-133 Project - Fixed Cost","400002 Project - Fixed Cost”,""))

Any idea why the multiple IF isn't working? Followed this to a tee

NickVa7Author
Level 9
October 29, 2021

I figured it out....it had to do with more "&" and "-" symbols. Had to reconstruct and save, reconstruct and save and make sure it was as clean as possible (no symbols, even in the "then this" results).

Cheers.

Doug_Den_Hoed__AtAppStore
Community Advisor
Community Advisor
October 29, 2021

Hi Nick,

In addition to Richard’s suggestion (with which I heartily concur, as a best practice), you could also have resolved the problem by enclosing each such custom parameter with brace and the Data Extension prefix (eg {DE:My - Parameter}), as doing so clarifies to the calculation engine to treat the term within the brackets as a single, valid, existing custom parameter.

Regards,

Doug

NickVa7Author
Level 9
October 29, 2021

Very interesting, Douglas. That's good to know...I can use that too.