<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Proper() not capitalizing Names with special characters</title><link>https://community.appian.com/discussions/f/new-to-appian/34834/proper-not-capitalizing-names-with-special-characters</link><description>Hi All, 
 
 I&amp;#39;m not having the desired result when using proper() with words including special characters. We receive the error when the user&amp;#39;s name has special characters. 
 EXP) O&amp;#39;Neal is being saved as O&amp;#39;neal, Aube-Kubel as Aube-kubel, etc. 
 I need</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Proper() not capitalizing Names with special characters</title><link>https://community.appian.com/thread/134534?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2024 16:27:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:56a8cca7-eb41-47c5-806f-2d90e3e4057f</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;As another option with OOTB functions, you can create your own expression rule that determines which characters should be translated to upper case.&amp;nbsp; In this example, we maintain a list of characters that determine that the following character should be upper case (space, dash, apostrophe, etc).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!chars: {&amp;quot;&amp;#39;&amp;quot;,&amp;quot; &amp;quot;,&amp;quot;-&amp;quot;}, /* Any leading char that determins upper next */
  local!capIndex: reject(
    fn!isnull,
    a!forEach(
      items: 1+enumerate(len(ri!string)),
      expression: if(
        or(
          fv!isFirst,
          contains(local!chars,charat(ri!string,fv!index))
        ),
        if(fv!isFirst,1,fv!index+1),
        null
      )
    )
  ),
  
  concat(
    a!forEach(
      items: 1+enumerate(len(ri!string)),
      expression: if(
        contains(local!capIndex,fv!index),
        upper(charat(ri!string,fv!index)),
        charat(ri!string,fv!index)
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1714494387024v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper() not capitalizing Names with special characters</title><link>https://community.appian.com/thread/134510?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2024 13:55:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8c055225-343b-4496-bfdf-256d88908c7a</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Maybe this works for you.&lt;/p&gt;
&lt;p&gt;I use a regex to find all first characters at word boundaries. The function returns the start and end positions of the matches. Then I increase the start positions by one as it is zero based.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I then use reduce() to iterate on the list of start positions to replace that character by its upper case version.&lt;/p&gt;
&lt;p&gt;Any better version is welcome.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!texts: {&amp;quot;o&amp;#39;neal&amp;quot;, &amp;quot;aube-kubel&amp;quot;},
  a!forEach(
    items: local!texts,
    expression: reduce(
      rule!SSH_Upper(_,_),
      fv!item,
      tointeger(regexsearch(&amp;quot;(\b[a-zA-Z](?!\s))&amp;quot;, fv!item, &amp;quot;gms&amp;quot;, false).startPosition) + 1
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1714485329342v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;My helper expression:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fn!replace(ri!string, ri!index, 1, upper(ri!string[ri!index]))&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1714485183544v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>