Constraint String Length and Highlighting text with **

1. What is the problem? Be very detailed.
(1) I want to constrain a text response variable to 200 characters (including spaces). In the constraint column I put: string-length(.)<=200 and regex(.,"[A-Za-z().',]{1,200}")

When I go to fill in the text response I can put as many characters as allowed, but no spaces - an error message pops up saying response invalid -- even though I put a constraint message to say 'answer limited to 200 characters'

(2) when I use ** ** around text it isn't being bolded in the the survey on the tablet I am using

2. What app or server are you using and on what device and operating system? Include version numbers.

These issues are seen in ODK Collect (latest version) and KOBOcollect on Samsung Galaxy Tab Active2, Android Version 9

3. What you have you tried to fix the problem?
searching the forum for advice - couldn't locate a topic that matched the issue I was having. Searching through the ODK website to find the correct code for the xls form.

4. What steps can we take to reproduce the problem?
Advise on the correct constraint message to limit a text string response including spaces, letters, numbers, punctuation to 200 characters.
Advise on why my constraint message from my column 'constraint_message' isn't showing up.
Advise on why ** ** isn't highlighting my text (in the label column) in the survey

You are right ** ** not working on collect.Alternatively you can use this #Text Bold.
http://xlsform.org/en/#styling-prompts
Check the attached XLS form. If it solve your problem please let us know. string_length.xlsx (18.8 KB)

1 Like

Thank you for your response. The string length works now.

I am not exactly clear on how to deal with the styling prompts based on the link you sent. Does the '#Text Bold' go in the 'appearance' column?

thanks again