cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry First letter uppercase rule

Former Member
0 Kudos

Hi,

is there a (not too complex) way to convert an uppercase string to a string where only the first characters of the words are upper case?

The field contains multiple words and every word should begin with a capital.

There are only string rules for all uppercase or all lowercase strings..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dieter,

This can be done using the JAVASCRIPT function. You can write javascript code to do the work and call that code from within an Agentry rule.

For example, the following rule (paste into your editor) is using the Javascript code on the City property  to make the first characters of the words uppercase and the rest lowercase.

(@JAVASCRIPT ((*argv[0].toLowerCase$28$$29$.replace$28$ /$28$^|\s$29$$28$[a-z]$29$/g , function$28$m,p1,p2$29${ return p1+p2.toUpperCase$28$$29$; } $29$;)) :>12"City")

jason_latko
Active Contributor
0 Kudos

Shahid,

Great suggestion, but I don't think Javascript is supported on all client platforms yet, is it?

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Works fine on ipad, thanks a lot

Former Member
0 Kudos

I think you are right. Does anyone else here have a a definite answer on which platforms support Javascript with Agentry rules? I can confirm that Win32 and IOS support it.

Former Member
0 Kudos

I saw it was added to iOS and android in 6.0.30

Answers (0)