10-26-2021 01:54 AM
Hi,
I need to use null and empty condition in router. curretnly i am using:-
$ZSDATA.IDOC.EDL2.EDL4.BEL != “”
but i feel i am not handling it correctly.
Any inputs?
10-26-2021 02:03 AM
Hi @Sahil ,
Which value are you expecting to be null ? With your current condition it will only check if …BEL is not empty and if any value before it is null it will fail.
You can either try this with the .get() method. You can also try with Data Validator snap to check if a value is not present or if it is empty.
07-01-2024 04:53 AM
Data Validator does not seem to be able to check null values
07-01-2024 04:57 AM
Must use minLength and Constraint value = 1
Required does not work for null. Pattern = null does not work
07-03-2024 12:22 AM
Null values should be possible to identify in expressions in most places.
The following condition would check that BEL is not blank or null, split them up if you need to handle them separately in the router.
$ZSDATA.IDOC.EDL2.EDL4.BEL != "" && $ZSDATA.IDOC.EDL2.EDL4.BEL != null
If you need to do the opposite to catch if an element is null or blank you simply change the conditions:
$ZSDATA.IDOC.EDL2.EDL4.BEL == "" || $ZSDATA.IDOC.EDL2.EDL4.BEL == null
If you have scenarios where you can be missing the element completely you may have to also throw in a check first that the object exists at all.
If you are having null safe access in a mapper where you map BEL, it would make this redundant.
$ZSDATA.IDOC.EDL2.EDL4.hasPath("BEL")