Forum Discussion

Sahil's avatar
Sahil
Contributor
4 years ago
Solved

Check if element exists in xml or not

Hi, a requirement where to check if <VW>ER</VW> exists in xml or not. sample xml 1:- <?xml version="1.0" encoding="UTF-8"?> <ORDER> <IDOC BEGIN="1"> <KA1 SEGMENT="1"> <VW>ZB</VW> <T...
  • viktor_n's avatar
    4 years ago

    Hi @Sahil,

    Try this expression. In Mapper also need to check Pass Though.

    sl.ensureArray($ORDER.IDOC.KA1).find(f => f.get("VW") == "ER") != null ? "Y" :  "N"
    

    Regards,
    Viktor