mendix

Failed to evaluate expression in Mendix


I'm trying to build a microflow with a decision that contains logic to determine if a date attribute is in the future but I get the following error when I run it.

com.mendix.modules.microflowengine.MicroflowException: Failed to evaluate expression, error occurred on line 1, character 3 if[%CurrentDateTime%]>$IteratorTaskList/DueDate then true else false

I'm guessing I'm making a basic error in the syntax, but have no idea what. Any pointers would be helpful.


Solution

  • please be aware that if your duedate is empty the expression will raise an error. Add an empty check and the second part could be shorter like so:

    $IteratorTaskList/DueDate != empty and [%CurrentDateTime%]> $IteratorTaskList/DueDate
    

    This will return false if duedate is empty and also false if duedate is in the past. I believe that is what you're looking for.