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
5 replies
Subscribers
7 subscribers
Views
2368 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Is there a way to limit data to numerics in VARCHAR datatype? We want users to o
judym598
Certified Senior Developer
over 9 years ago
Is there a way to limit data to numerics in VARCHAR datatype? We want users to only enter numbers in a field we have on a form even though it is associated with a VARCHAR datatype.
OriginalPostID-146083
OriginalPostID-146083
Discussion posts and replies are publicly visible
0
corbinp505
over 9 years ago
You could strip out all non-numeric characters as the user types.
Here is a SAIL recipe that provides a nice example:
forum.appian.com/.../SAIL_Recipes.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
You have a number of options - most use validations and various tests - but one of the simplest is just to cast the value parameter of the text field to integer or decimal depending on your requirements:
load(
local!someValue,
a!textField(
label: "Value",
value: tointeger(local!someValue),
saveInto: local!someValue
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
judym598
Certified Senior Developer
over 9 years ago
Thanks for the suggestions! I'll test both out and see which one works best for us.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nileshr
over 9 years ago
I think changing the user input without even giving him a hint of what exactly happened will not be good practice. The user won't possibly understand why the values entered by him has changed.
You must use a validation message so as to prompt him to enter only numeric values. You can create a rule for that.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
judym598
Certified Senior Developer
over 9 years ago
Thanks - I agree. We're going to display instructions as well.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel