How to uppercase the first letter of a string in appsheet

How to uppercase the first letter of a string in appsheet

I think this would work to capitalize the first letter of [Your text]:

concatenate(UPPER(left([Your text],1)),mid([Your text],2,100))

1 Like

That works if we assume that the original text is lowercase, and only for the first word.
I can not believe that there is no expression that capitalizes the first letter of each word! (I think I remember using an expression that did it but I can’t find it)
Thanks anyway for confirming that it does not exist, I will work to do it this way.

There is no function to do that. The closest AppSheet provides is this:

2 Likes

@Steve It is not to get the initials what I am looking for, but to capitalize them.
This is what I did and it seems to work well, with the limitations of up to 5 words and 100 characters (in this case).

I created a virtual column named [Nombre y Apellido] where I put all the first and last name in lowercase letters and separate it in a list.

SPLIT(LOWER([Nombre]&" β€œ&[Apellido]),” ")

Then in another virtual column I change the first letter to uppercase, to the first 5 items of the splited list.
I only have one detail left that I can’t find: in the end of the string I have a comma β€œ,” and I can’t find out where it is generated, since it should be taken as a blank item in the list.

CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],1),1)),MID(INDEX([Nombre y Apellido],1),2,100))&" β€œ&
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],2),1)),MID(INDEX([Nombre y Apellido],2),2,100))&” β€œ&
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],3),1)),MID(INDEX([Nombre y Apellido],3),2,100))&” β€œ&
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],4),1)),MID(INDEX([Nombre y Apellido],4),2,100))&” "&
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],5),1)),MID(INDEX([Nombre y Apellido],5),2,100))

Anyway I solved it in the unorthodox way:

SUBSTITUTE(
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],1),1)),MID(INDEX([Nombre y Apellido],1),2,100))&" β€œ&
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],2),1)),MID(INDEX([Nombre y Apellido],2),2,100))&” β€œ&
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],3),1)),MID(INDEX([Nombre y Apellido],3),2,100))&” β€œ&
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],4),1)),MID(INDEX([Nombre y Apellido],4),2,100))&” β€œ&
CONCATENATE(UPPER(LEFT(INDEX([Nombre y Apellido],5),1)),MID(INDEX([Nombre y Apellido],5),2,100))
,”,","")

To quote myself:

If you ever wanted to remove the 100 character limit (though I can’t possibly understand a name longer than that) you could swap MID(INDEX([Nombre y Apellido],1),2,100) with RIGHT(INDEX([Nombre y Apellido],1), LEN(INDEX([Nombre y Apellido],1)-1).

If possible I try to make sure not to program hard limits into my Apps unless it’s absolutely necessary for functionality (i.e. going through a string one word at a time) or for sync time.