Select to view content in your preferred language

Using Caplock with mask in Survey123 how can we have spaces between words?

3286
11
03-21-2018 07:52 AM
DiegoLlamas
Esri Contributor

Hello,

I have been doing some test with caplock for my text fields in survey123. I was able to do it. 

In Esri:inputMask y add this symbol > and xxxxxxxxxxx for the quantity of letters we think we will be using

We write with spaces in survey 123

But when we see the info on a map we can see the info but with no spaces between them

If we open the survey we send we see the same behavior. No space between words

I asume it is because in Mask we do not have any space between x but we do not have control what the user is going to write, so, my question is How can we have caplock for words and respect the space we put on them? is it possible?

>PLEASESAYYES

Thanks for your help!

Diego Llamas

0 Kudos
11 Replies
BrandonArmstrong
Esri Regular Contributor

Hi Diego,

One option might be to apply a regular expression in the Constraint column of your XLSForm

Something like the following...

regex(.,'^[A-Z ]*$')

Although this does not limit the total number of characters that can be submitted, it should limit valid submissions to all capital letters and allow for spaces in between

DiegoLlamas
Esri Contributor

Hello Brandon Armstrong,

I tried your suggestion adding regex to Constraint column.

But when I was doing some test my letters did capitalize and I got an invalid error

Now I know that Mask option will not help me to capitalize automatically the letters people writes in text fields.

Thanks for your help!,

Diego LLamas

0 Kudos
BrandonArmstrong
Esri Regular Contributor

Hi Diego,

The error you are getting is intended, as the regular expression is specifying that the letters must be all capital.

In your screenshot, it appears that the letters are lowercase, therefore warning the submitter that it is not a valid answer.  Adding a Constraint Message could give the submitter guidance, that the input must use capitals.

Please let me know if you have questions related to this information.

Best,

Brandon

0 Kudos
DiegoLlamas
Esri Contributor

Hello Brandon Armstrong‌ maybe i didn't explain my self clearly. What I want to do is, even though my users use  lowercase to write in my text fields in my survey, I want that automatically the letters are capitalized. Using this symbol (>) with certain number of x (>xxxxxxxxxxxxxx) in esri:inputMask field I was able to do so. all my letters are capital letters but because in mask field I used >xxxxxxxxxxxxx.... with no space, all my word get together because in Mask there aren't any space. 

what I want to know is, if it is possible to survey capitalize all my letters when I write something using lowercase and respect the spaces between words. As I said. I was able to capitalize letters using >xxxxx... but this does not respect spaces between words.

Thanks for your help!

Diego

0 Kudos
BrandonArmstrong
Esri Regular Contributor

Hi Diego,

Unfortunately, Input Masks cannot be used to accomplish the honoring of dynamic spacing placed in the input.  You would need to explicitly define the placement of spaces within the Input Mask.

Best,

Brandon

0 Kudos
DiegoLlamas
Esri Contributor

Hi Brandon,

And, is there any way i could capitalize my text fields automatically, I was trying using UPPER option y calculation field but didn't work.

0 Kudos
BrandonArmstrong
Esri Regular Contributor

Hi Diego,

The Input Mask can be used in order to force capitalization, but not to allow for the dynamic placement of spaces.  If the prevention of an input using a relevant expression does not work for you, maybe consider converting the input to uppercase post collection?

One option might be to use the field calculator in ArcGIS Online or ArcGIS Pro to convert the input of the field to all uppercase.

Best,

Brandon

0 Kudos
LAG155
by
Occasional Contributor

Hi Diego,

Hello I had the same problem!

To this day I solved it with JavaScript.

Generating a function to pass the receipt data to Uppercase

LMedeirosUI
Frequent Contributor

Worked for me! ESRI really should have made this an option years ago, but at least other people figured out an elegant workaround. Thanks!

0 Kudos