Confusion with Microflow

Good Morning,   I’m a bit confused with a microflow I have. Basically if the project code is left blank then I want it to update the project code field with N/A. It works when I create a new document and press save (which initiates the microflow) it puts’s the N/A in the field. However if I go in to edit the object and delete the project code and select save, it then doesn’t pick it up as being empty and doesn’t input the N/A. Any idea why that would be? Edit button goes to the same page as the New button.  
2 answers

I suspect your ProjectCode is a String with no characters, rather than empty. Try changing the test to this

$Minutes/ProjectCode != empty and trim($Minutes/ProjectCode) != ''


Good luck!


Jessica, Robert’s answer is correct, but just so you know, the “trim” function also turns an empty into ‘’ so the following is more concise and works just as well:

trim($Minutes/ProjectCode) != ''

This appears to be Mendix best practice as well, as it’s what any auto-generated code will insert for you when checking if a string is empty.