I have written a formula field of data type DATETIME and return type text

IF((ISPICKVAL(Status, 'Completed')),NOW(),'')

but error occurred states

Error: Incorrect parameter type for function 'IF()'. Expected DateTime, received Text

1 Answer 1


return type of your formula field is Text, that is why you have to return Text types in both results: true and false of IF formula. Add TEXT formula for returned NOW()

IF(ISPICKVAL(Status, 'Completed'), TEXT(NOW()), null)

returned result of TEXT(NOW()) is in GMT time

  • I tried it too but got Error: Formula result is data type (DateTime), incompatible with expected data type (Text).
    – Swathi
    Commented Feb 4, 2019 at 13:31
  • @Swathi I have updated my answer, try it. Commented Feb 4, 2019 at 13:35
  • Get rid of the extra parentheses. They seem to be screwing you up too. I think you close your IF early.
    – Adrian Larson
    Commented Feb 4, 2019 at 13:37
  • Thanks! it worked but the time is getting wrong. Not showing current time
    – Swathi
    Commented Feb 4, 2019 at 13:40
  • @Swathi it is showing correct GMT Commented Feb 4, 2019 at 13:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .