Proper casing issues

  

Hi community


I'm trying to convert the first letter of each input text field to upper case. For example "john" would become "John". This input text is validated from a form. How would I go about doing this? I have tried methods, which don't work such as:

Substring(), combined with the ToUpper function but this only returns the first letter of the word.

Regards

Yoonus

Hi Yoonus,

It is important to understand why do you need to capitalize the first work in a form. Personally, I would never do this. If the user wants to type it all in lower case, its up to him.

I think there is no function to Capitalize, but in any case, you can do something like this:

variable = ToUpper(SubStr(text, 0, 1)) + SubStr(text, 1, Length(text))

Function names can be different (took from the top of my head).

Cheers,
Eduardo Jauch

There is no InitCap function in Outsystems.

You must make it yourself.

Btw, I made a quick Initcap action...

OML attached (mixed in with another demo for other thread in OS Forum).

Live Demo: https://harlin.outsystemscloud.com/TestDropdownCarousel/InitCaps.aspx

I agree with Eduardo Jauch.

The problem with Initcaps, especially if forced in Input Field is:

john smith (CEO) will become John Smith (ceo)

james a.g. will become James A.g.

John Smith PhD will become John Smith Phd