Restricting characters entered into a field

Dear all,

I am very new in creating forms in ODK. This is my 5th day in learning ODK.
I would like to restrict field data collectors to enter only certain number
of text in a field but don't how.

For example, I have a field called "Initials" and would like them to enter
only two letters for their intials and not more than that.

Is there a way I can do that in the Excel before uploading to the ODK
Aggregate. Could any one please assist me in this.

Thankyou in advance for your time and consideration.

Many thanks,

Yangta

This page here lists all the contraints that you can enter with ODK.
http://opendatakit.org/help/form-design/binding/

This part in particular will be of interest to you:
Constraints: Answer must between 4 and 10 characters long (inclusive)

The above covers the XML that is required.
However, you need to work out the XLS format so that it gets converted to
XML.
Something like this will probably help as a start - put it in the
'constraint' column for the initials question.
string-length(.)<=2

Hope that helps as a start.

··· On Monday, 15 June 2015 15:37:23 UTC+1, Young Ura wrote: > > Dear all, > > I am very new in creating forms in ODK. This is my 5th day in learning > ODK. I would like to restrict field data collectors to enter only certain > number of text in a field but don't how. > > For example, I have a field called "Initials" and would like them to > enter only two letters for their intials and not more than that. > > Is there a way I can do that in the Excel before uploading to the ODK > Aggregate. Could any one please assist me in this. > > Thankyou in advance for your time and consideration. > > Many thanks, > > Yangta > > >

Can confirm. Just tested this myself and if you put the following code in
the constraint field it'll work as you want.
string-length(.)<=2

··· On Monday, 15 June 2015 15:37:23 UTC+1, Young Ura wrote: > > Dear all, > > I am very new in creating forms in ODK. This is my 5th day in learning > ODK. I would like to restrict field data collectors to enter only certain > number of text in a field but don't how. > > For example, I have a field called "Initials" and would like them to > enter only two letters for their intials and not more than that. > > Is there a way I can do that in the Excel before uploading to the ODK > Aggregate. Could any one please assist me in this. > > Thankyou in advance for your time and consideration. > > Many thanks, > > Yangta > > >

Hi Ben,

Thankyou so much for your help. It's working so well.

Thanks once again

Yangta

··· On Monday, June 15, 2015 at 4:37:23 PM UTC+2, Young Ura wrote:

Dear all,

I am very new in creating forms in ODK. This is my 5th day in learning
ODK. I would like to restrict field data collectors to enter only certain
number of text in a field but don't how.

For example, I have a field called "Initials" and would like them to
enter only two letters for their intials and not more than that.

Is there a way I can do that in the Excel before uploading to the ODK
Aggregate. Could any one please assist me in this.

Thankyou in advance for your time and consideration.

Many thanks,

Yangta