if Int is Empty than 0 - Mendix Forum

if Int is Empty than 0

1

Why is there no setting I can turn on that when an int/decimal is empty it turns into 0?

 

we are mapping 100+ fields from an API and it would be nice to set this check once on entity level, instead of on every attribute.

 

something like:

on entity 'if int/dec is empty replace with {1}'

asked
2 answers

@Sven, I agree, NULL is not Zero.

but I also don't want my API to crash when trying to map NULL to an integer.

 

Created

I think that, strictly speaking, the meaning of empty (or NULL in the database) is not related nor the same to 0, so it would be odd to include such an option. However, I do agree that in some cases it might be convenient. Maybe you could use a java action that checks the members on datatype and whether the value is empty. If so, fill 0.

Created