How convert a string to all upper case?

Hi folks…

I have a field where a user is asked to input a two digit string. Depending
on the behavior of android’s autocorrect, etc, they may therefore enter *er
*or possibly Er.

But what I’d like the app to then convert it to would be all upper case:
ER

What’s your recommended method if you wanted to implement that? I looked
at the functions for a bit but nothing jumped right out at me… thanks
much! Happy Friday –

Eric

Hi Eric,

Unfortunately we don’t have a function that can convert text to uppercase.
For now, I would recommend disabling Auto Correct on the phone. This is
something we recommend for most deployments, especially if users are
entering codes or text in another language.

Thanks!
Sheel

··· On Fri, Dec 12, 2014 at 2:57 AM, Eric Stephan wrote: > > > Hi folks... > > I have a field where a user is asked to input a two digit string. > Depending on the behavior of android's autocorrect, etc, they may therefore > enter *er *or possibly *Er*. > > But what I'd like the app to then convert it to would be all upper case: > *ER* > > What's your recommended method if you wanted to implement that? I looked > at the functions for a bit but nothing jumped right out at me... thanks > much! Happy Friday -- > > Eric > > -- > You received this message because you are subscribed to the Google Groups > "commcare-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to commcare-users+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >


Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah

Thanks much. This is a little bit of an issue for my app, since the app is
constructing a UIC code for the client… and even if we turned off
autocorrect, the possibilty that one user would enter 8754ES and another
would enter 8754es, and the two would at some point not be considered
identical, would be unfortunate.

– Is there an ASC function to find out the ascii value of a single
character? Since I am lucky that this string is only two characters long,
I could maybe do one mathematical IF that added a certain number to the
ascii value if it was in a certain lower range… and then I would just do
that for the first character and also the second character.

Thanks!
Eric

Eric,

We do support regular expression matching with the regex function. You
could run a regex match for whether the current string contains any
lowercase characters in a validation condition to let users know if they’ve
entered an invalid pattern.

-Clayton

··· On Mon, Dec 15, 2014 at 4:32 AM, Eric Stephan wrote: > > > Thanks much. This is a little bit of an issue for my app, since the app is > constructing a UIC code for the client... and even if we turned off > autocorrect, the possibilty that one user would enter 8754ES and another > would enter 8754es, and the two would at some point not be considered > identical, would be unfortunate. > > -- Is there an ASC function to find out the ascii value of a single > character? Since I am lucky that this string is only two characters long, > I could maybe do one mathematical IF that added a certain number to the > ascii value if it was in a certain lower range... and then I would just do > that for the first character and also the second character. > > Thanks! > Eric > > -- > You received this message because you are subscribed to the Google Groups > "commcare-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to commcare-users+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

OK, thanks much. – Hey, just so I’m certain I know the lay of the land –
am I correct that there is no variety of ASC() command that would return
the numerical value of a character, and no CHAR() command that would return
the character of a given numerical value?

Thanks much!
Eric

Eric -

I do not believe we have such a function.

-Will

··· On Thu, Dec 25, 2014 at 9:57 PM, Eric Stephan wrote:

OK, thanks much. – Hey, just so I’m certain I know the lay of the land –
am I correct that there is no variety of ASC() command that would return
the numerical value of a character, and no CHAR() command that would return
the character of a given numerical value?

Thanks much!
Eric


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric,

I’ve also added support for

upper-case()

and

lower-case()

to our list of xpath functions that need to be implemented, but
unfortunately I can’t offer a specific timeline on that. When support is
included it should be noted in the Release Notes for the upcoming version

-Clayton

··· On Fri, Dec 26, 2014 at 1:42 PM, William Pride wrote:

Eric -

I do not believe we have such a function.

-Will

On Thu, Dec 25, 2014 at 9:57 PM, Eric Stephan estephan@fhi360.org wrote:

OK, thanks much. – Hey, just so I’m certain I know the lay of the land
– am I correct that there is no variety of ASC() command that would return
the numerical value of a character, and no CHAR() command that would return
the character of a given numerical value?

Thanks much!
Eric


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

thank you! that would be fantastic. and maybe I’m wrong, but I think in an
era when everyone and their uncle is talking about implementing UIC codes
(just as I have to,) people are going to need this ability to string
together odd snippets of text that wind up being the elements of a person’s
UIC code — extracting their initials, "last two letters of a first name,"
etc – and therefore this kind of conversion to upper case will be
extremely relevant for many folks.

eric

Hello folks –

I just wanted to say that I am celebrating now that I have stumbled across
the fact that this problem is now solved!

I inadvertently stumbled on the newer version of your Functions List
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions

And I see an amazing collection of string manipulation functions that will
make this problem go away… and make other problems easier too!

Wonderful! I don’t know if you announced these additions at all? If you
did, I missed it.

I’ve tested the upper-case one and of course it works fine. (BUT I did have
to upgrade my copy of CommCare to the newer version 2.19, I was still on
2.18.

Thanks much! --Eric

Eric,

Sorry! We included the string function announcement in our Product
Announcements email which we generally send out on each new release.

If you aren’t signed up to receive those emails you can get on the list
here:
http://commcarehq.us5.list-manage2.com/subscribe?u=3723a6bdc9bae1db8dda1623e&id=d293020202

Cheers!
-Clayton

··· On Fri, Mar 13, 2015 at 2:01 AM, Eric Stephan wrote:

Hello folks –

I just wanted to say that I am celebrating now that I have stumbled across
the fact that this problem is now solved!

I inadvertently stumbled on the newer version of your Functions List –
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions

And I see an amazing collection of string manipulation functions that will
make this problem go away… and make other problems easier too!

Wonderful! I don’t know if you announced these additions at all? If you
did, I missed it.

I’ve tested the upper-case one and of course it works fine. (BUT I did
have to upgrade my copy of CommCare to the newer version 2.19, I was still
on 2.18.

Thanks much! --Eric


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.