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
4 replies
Subscribers
7 subscribers
Views
1816 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
On a customer name field, we wish to handle user input in incorrect case. So &q
alastairw
over 11 years ago
On a customer name field, we wish to handle user input in incorrect case. So "SMITH" and "smith" should both becode "Smith".
The obvious way to do this is proper(ac!surname). However, proper("Cholmondley-Warner") results in "Cholmondley-warner" since hyphen is not a word delimiter. Any suggestions for a workaround?...
OriginalPostID-75738
OriginalPostID-75738
Discussion posts and replies are publicly visible
0
Sathya Srinivasan
Appian Employee
over 11 years ago
Other than writing code that strip spl characters and put them back in after changing the case, the straight-forward way to handle this is to not use special characters in the name. Given that this is a name, a hyphen-versus-a space should be "visibly" the same. However, if you want them differentiated, you can use an additional column to store the data with special character and a normalized one (i.e. you can use strip() function to remove spl characters) and store this to search the data against. But be advised that 99.9% of your names may not have these special character and you will be including additional overhead by adding a new column. A reverse-index in a 'search' engine uses the above method to make a search result more effective. However you need to weigh the benefits against cost of development and maintenance.
Talking about writing code, you can write a simple plug-in expression function that'd do what you are looking for (and share it in Appian forum for others to benefit from as well)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
elizabeth.epstein
over 11 years ago
If the only special case you are worried about is hyphen, you can write a reasonably simple rule to handle it. I called this convertToProper with a Text input called txt.
=if(search("-",ri!txt)=0,proper(ri!txt),
substitute(proper(substitute(ri!txt,"-"," "))," ","-"))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
alastairw
over 11 years ago
Thanks Elizabeth, I've taken your rule (with credit)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 11 years ago
Something to look-out for:- With the above rule, if your text contains a genuine space and a hyphen, for e.g. "joe-mc donald", then the output will become "Joe-Mc-Donald" where the other spaces will be replaced by hyphen.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel