Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
8 subscribers
Views
2274 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi, my users have to enter a 10 digit barcode number. I want to do some bas
moritzw
over 10 years ago
Hi,
my users have to enter a 10 digit barcode number. I want to do some basic validations on the field:
if(len(tointeger(ri!barcodeNumberValue_txt))<>10,"Error Msg.",""),
if(len(tointeger(ri!barcodeNumberValue_txt))<>len(ri!barcodeNumberValue_txt),"Error Msg.","")
The first one works fine, but the latter one doesn't work for large numbers. Any ideas how could validate that the field only contains digits?
TIA, Moritz
OriginalPostID-139230
OriginalPostID-139230
Discussion posts and replies are publicly visible
Parents
0
Conor Cahill
Certified Lead Developer
over 10 years ago
You'll also want to be careful doing an len() after tointeger(). Leading 0's will be taken off and not counted for the length (e.g. len(tointeger("001")) returns 1). Assuming you go with the cleanwith() approach you won't be using the tointeger() so you won't need to worry about this, but it's something to keep in mind.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Conor Cahill
Certified Lead Developer
over 10 years ago
You'll also want to be careful doing an len() after tointeger(). Leading 0's will be taken off and not counted for the length (e.g. len(tointeger("001")) returns 1). Assuming you go with the cleanwith() approach you won't be using the tointeger() so you won't need to worry about this, but it's something to keep in mind.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data