Check for existance of related object in Microflow expression

In a microflow I want to check if a related object exists or not. So a pizza might or might not have a related image. I tried: if $Pizza/PizzaMarco.Pizza_Image = empty then ... else ... But this check returns true all the time. How can I check if such object exists?
3 answers

I accidently fixed my own problem. Because Auto create was enabled in my form, an empty image was created if I didn't provide one. Code above works like a charm.


The expression that you specified should work the way you describe. Could you explain the structure of your metamodel, and show the complete expression that you use?


Ok, the more complete version this time.

In my Metamodel I have two objects: Pizza( String:PizzaName, Currency:PizzaPrice, Boolean:HasImage, System.Image:&Pizza_Image )

HasBoolean is a virtual atrribute, with a microflow 'PizzaHasImage'. I want to show this attribute in a datagrid column.

The Microflow is as follows: Inputs: Pizza:InputPizzaObject 1 Activity: Een Variable.Create action, Datatype=Boolean, Name=HasImage, Code:

$InputPizzaObject/PizzaMario_1.Pizza_Image != empty

Thw microflow returntype is a Boolean, returning $HasImage.