Skip to main content
Solved

Color record based on formula field has ERROR condition

  • November 16, 2023
  • 2 replies
  • 29 views

Forum|alt.badge.img+5

I have a formula field that calculates a value (results a number) based on a lookup field (e.g. a date). 

When the lookup field is empty due to a missing input, formula field results with a NaN or ERROR.

In that case, I want to highlight RED color to that record so operators understand that they should fix the missing input. 

Unfortunately, there isn't a way to enter a color condition statement such as "WHEN formula field IS ERROR, SET COLOR red".

Is there a solution for this? @dashler78 

Best answer by Sho

Try to add an IF statement to the Formula field. This formula checks whether Date is input.

IF({Date},"TRUE")

To check how the Lookup value is a date, it can be checked with this formula.

IF(NOT(ISERROR(DATESTR({Date}))),"TRUE")

Normally, you only need to determine how empty it is, but if the date is taken from a string, you may need to check both.

By adding the IF statement above, you can set the record color to red when the formula field is empty.

 

2 replies

Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • November 16, 2023

Try to add an IF statement to the Formula field. This formula checks whether Date is input.

IF({Date},"TRUE")

To check how the Lookup value is a date, it can be checked with this formula.

IF(NOT(ISERROR(DATESTR({Date}))),"TRUE")

Normally, you only need to determine how empty it is, but if the date is taken from a string, you may need to check both.

By adding the IF statement above, you can set the record color to red when the formula field is empty.

 


Forum|alt.badge.img+5
  • Author
  • New Participant
  • November 23, 2023

Understood. It's a decent workaround. Thank you