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
7 replies
Subscribers
8 subscribers
Views
3834 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hello, I want to create a rule that takes in a text string and capita
issamd
over 9 years ago
Hello,
I want to create a rule that takes in a text string and capitalizes in appropriately, but the proper() function won't work.
For example, if the string passed in is "MMB bank", the proper() function will return "Mmb Bank", when I need "MMB Bank".
Does anybody have a suggestion that I can use?
OriginalPostID-206475
OriginalPostID-206475
Discussion posts and replies are publicly visible
0
fabricec
over 9 years ago
Hello, if it's always the same patern "X Y" you can split the text with space and use the proper() function with the second part.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
issamd
over 9 years ago
That's the thing, it will likely not always be the same pattern, it could very well be "Bank of MMB" or "National Bank of MMB".
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabricec
over 9 years ago
Ok, so you can split the text with spaces, then for each part, you can test if the part is in uppercase (with the like() function, using regular expression) and if not, use the proper function.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
issamd
over 9 years ago
I appreciate your help but I apologize if I'm not quite picking up on your suggestion.
So I will split MMB Bank into MMB ; Bank, but how do I use the like() to determine if it's uppercase?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabricec
over 9 years ago
My bad, I thought the like function could be a good idea but no. You can construct a function isInUpper(text) like this : =exact(upper(ri!text), ri!text).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
issamd
over 9 years ago
That's a good idea, I'll try that, thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
gpolk
over 9 years ago
I think you might still run into trouble if your user entered THE BANK OF MMB AND XYZ. You may have difficulty telling the difference between MMB & XYZ strings which should be all caps and the AND string which should be proper case.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel