Sidebar

Condition node - how to discard if field contains alpha characters?

0 votes
30 views
asked May 3 by adam-d-5091 (370 points)
edited May 3 by adam-d-5091
I'm having a hard time trying to find what to place in a condition node to look in PID-3.1 and if it contains alpha characters (we only want to keep ones with just numbers in this field) then discard.

Thanks in advance for any help.

1 Answer

+1 vote
 
Best answer

One way is to set the condition node to be 'Custom' and use this code:

return StringUtils.isNumeric(source.getNode('PID-3'.1));

This will look at the field in the source message and, if it is just numbers, return true.  Otherewise, it will return false, which will cause the condition to fail.  

 

answered May 3 by jon-t-7005 (7,950 points)
selected May 3 by adam-d-5091
commented May 3 by adam-d-5091 (370 points)
Thank you, works as needed.
...