How to validate input value with external data?