Prevent first character of input of type text being uppercase?


Given the following:

section() {
    input "username", "text", title: "Username", required: true, autoCorrect: false
    input "password", "password", title: "Password", required: true, autoCorrect: false

Is there a parameter to stop the first character been capitalised?


Do you want only the first Character to not be Caps or Do you want everything to be lowercase?

I wish the inputs to be case-insensitive but the the first character not be capitalised by default.

I don’t know how to do this in the input section, but you could do something like this with groovy.

def name = "HELLO" 
name[0].toLowerCase() + name.substring(1) 

Using this you could change it after it’s been set in the input filed.

Thanks for the suggestion but that’s not what Im after. It is not possible for me to know whether the user wanted the first character capitalised or not.

So you want to prevent the first Character from auto Caps? I think that’s a feature in the OS of the phone, so I don’t know how to override that within SmartThings. Maybe someone else in the community will know how. Sorry.

Good question.

Try capitalization: "none". This doesn’t appear to be used much if at all (I can’t find any SmartApps or Device Types that use it), and I’ve only verified that it works on iOS. I’m working with engineering to see if it’s supported across mobile OS’s, or if it’s planned. For those curious, the other options are "sentences", "all" (because SOMETIMES WE WANT TO YELL), and "words" (default).

Once I get some more answers we’ll have the docs updated accordingly, and I’ll follow up here.


Worked perfectly! Thank you Jim!

Just to follow up, we verified that the capitalization option does not work for Android devices. We’ll get a ticket created to close this gap. Just know that this will only work on iOS.

I’ll try and preemptively answer the next question - when will it be supported for non-iOS devices? The ticket has not been through prioritization yet, but given the current mobile app backlog, I don’t foresee this rising to the top in terms of priority in the very near future.

I’ll follow up here and update the docs to indicate broader support when we do add support for different OS’s.