07-16-2024 10:41 AM
Hello,
I have source data in XML format and all the column entities have "@" as a prefix. I am trying the following expression using "hasPath" function in a mapper to determine if the output of the file has data.
$.hasPath('Extract.Locations.Location.@ID') ? $Extract.Locations.Location : null
It is returning null even though the output has locations data with "@ID" entity.
Below is the screenshot of the XML template and output from the Snaplogic expression window.
How to mention the entities with any special character prefixes in the expression.
Thanks
Aravind N
Solved! Go to Solution.
07-17-2024 01:53 AM - edited 07-17-2024 01:59 AM
07-17-2024 01:53 AM - edited 07-17-2024 01:59 AM
07-17-2024 05:45 PM
@svatada. Thanks for the solution. yes it works with the escape character mentioned in the expression.
works for both $.hasOwnProperty('[\'@ID\']') and $.hasPath('[\'@ID\']').