We are currently performing maintenance on Appian Community. As a result, discussions posts and replies are temporarily unavailable. We appreciate your patience.

On a customer name field, we wish to handle user input in incorrect case. So &q

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

  • 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)
  • 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,"-"," "))," ","-"))
  • 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.