Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

vRO 6 - input validation on array of values - array of IP addresses

$
0
0

I'm working on a workflow, where the users have to input an array of IP addresses. The validation takes place in the user presentation, via Custom Validation, where the input IP address array is called and an action with the following code is executed:

 

var re = new RegExp("^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$");

for each (IP in IPAdresses){
    System.log("Checking IP: " + IP);    if (!IP.match(re)) { return "IP " + IP + " incorrect" } else { return null }
}

 

This works for a single input, with an array, only the top element (the last inserted) is checked in the user presentation. How should I modify the action, so that all input values are validated?

Thanks in advance...


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>