I am building a form and would like for text entered to be in uppercase (CAPS LOCK).
Any options on the layout and settings or anywhere where it will allow me to set so that when a Text question is created, all text answers are automatically converted to Uppercase?
Thanks and looking forward to hearing from you all.
Hello @Kal_Lam,
I am really sorry to say. Your version could NOT be deployed temporarily.
. But now it worked.
But it’s different to our demand (and example) to directly change the original text variable.
As I wrote in my attached XLSForm example:
Remark
Didn’t work with . Or ${} reference. Deployment error (self-reference). But works in Enketo Preview.
Also ODK Online test, shows for your ${ } version the same error as cited above.
It’s sometimes stressing, that 3 ODK/KoBo tools show different behaviour. Our lesson learnt hard is: You cannot trust by testing in Preview that the form will then work for deployment and also not that it will act the same way then in KoBoCollect and in ODK Collect.
Kind regards
Wolfgang
FYI please re-try @Kal_Lam’s form on XLSForm Online. It appears to be working now. (there are some h/w & s/w issues with the server that are being looked into, but have been causing it to sometimes misbehave…).
Hello @Xiphware,
Thanks. Yes, the version of @Kal_Lam worked now (I updated the previous post).
But to create a second variable (in Uppercase) was not the solution I am looking for.
Our Question is:
How can we change the original text variable (Q2) to Uppercase?
You may have a look at our example: UPPER CASE 02 (Translate).xlsx (9.4 KB)
If we use /data/Q2 (absolute path) as reference in the translate (calculation), it WORKS in Preview, can be deployed in KoBoToolbox and then works in KoBoCollect & ODK Collect, but only on SAVE/Re-Edit (not yet when moving out the field, like in Preview).
But it still gives an error in XLSFormOnline. (So, won’t work for deployment with ODK. But may work as XForm too?)
If we use . or ${Q2} as reference form, it gives an error on employment in addition. (But also works in Preview).
Here the output for our XLSForm in Preview, after entering “ab” + return (or validate or just mouse-click)
(upload://lGda6S3ThR2aIutvnMHiEIqERgr.xlsx) (9.4 KB)
So, maybe there is another option for the path reference? (Or something like bind: with set_value)?? Or at least, can you confirm that this will keep working in KoBoCollect/ Enketo?
Kind regards
Wolfgang
P.S. In summary: we have a function/constellation here, which:
Can be deployed with KoBoToolbox
Cannot be deployed with XLSForm Online
Works then in KoBoCollect & in ODKCollect
But works differently in KoBo/Enketo Preview (activated on move/click) to Collect (activated only on Save/Re-Edit only).
My feeling is, this might be similar with other self-referencing examples.
Any idea how we can better avoid those trial-and-error experience?
Maybe new things might even happen with the example after the server updates tomorrow?
Hi @wroos
I have elaborately tested all the scenarios and we arrived at the same conclusions. As a general rule of thumb, users should avoid self-referencing in calculations, triggers, and relevant columns. As it is, we notice that the preview behavior does not mimic the Enketo behavior which is something that the developers are looking into, from a macro perspective. On a specific recommendation for this particular translate need, I recommend that you use a calculate question as earlier suggested. This one step aids in ensuring you achieve your intended goal without potential exposure to dependency issues caused by self-referencing.
You can also follow the github discussion that seems more closely related to this issue
Thanks so much for pointing this out, and for your continuous contributions on this platform.
Hello collegues!
Please I have the same problem.
I want to convert automatically characters with high and low accents to uppercase with
XLSFORM
I used [translate(${Q2}, “abcdefghijklmnopqrstuvwxyz”, “ABCDEFGHIJKLMNOPQRSTUVWXYZ”)] and it works but if there’s low accent (eg: école) or (eg: élève) in the text, it can’t convert.
Please I need your help
Hello @kassim.dogawa,
Of course, you need to enhance the translate formula with all special French letters. Here is an example working well. UPPER CASE 03 (Translate).xlsx (9.2 KB)
I just solved the problem by adding in the syntax any kind of possible accent that could be entered and I did the test and I noticed it’s good after exporting the data. Lower case characters are converted to upper case and characters with accents are converted to upper case as well.