valid Input

Hi All,

I need to show one validation that - throw error if they enter anything apart from 0 to 9 and . 

How can we achieve that using some functions in appian

Can Someone suggest for this?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    It really kinda depends on what valid input(s) you're trying to accept.  If you're after only decimal values, you could wrap your save in "todecimal()" at save time, forcing any extraneous characters to go away.  If something like "10.2.3.6.8.9" would be acceptable though, you'd need to check the text manually - a regex would work, but also you could just use built-in functions like "cleanWith()" i.e.
    validations: {
      if(ri!text <> cleanWith(ri!text, "0123456789."), "Invalid Characters Entered", null())
    }

Reply
  • 0
    Certified Lead Developer

    It really kinda depends on what valid input(s) you're trying to accept.  If you're after only decimal values, you could wrap your save in "todecimal()" at save time, forcing any extraneous characters to go away.  If something like "10.2.3.6.8.9" would be acceptable though, you'd need to check the text manually - a regex would work, but also you could just use built-in functions like "cleanWith()" i.e.
    validations: {
      if(ri!text <> cleanWith(ri!text, "0123456789."), "Invalid Characters Entered", null())
    }

Children