I'm trying to extract sub-string (e.g, first 4 digits) from a text entry
(Institution_name) to a field such as "Institution_code" using
calculate="substr('/data/Institution_name',0,4)", but this only results
---- /dat , where I expect the first 4 digits of the inserted Institution
name like "LEFT" function of excel.
The single-quotes around the path '/data/institution_name' mean that this
is a literal string value. To access the contents of that field, you
should write:
calculate="substr(/data/institution_name,0,4)"
i.e., no quotes around the path
···
On Mon, Nov 11, 2013 at 11:34 PM, Maeshal wrote:
Hello !!!
I'm trying to extract sub-string (e.g, first 4 digits) from a text entry
(Institution_name) to a field such as "Institution_code" using
calculate="substr('/data/Institution_name',0,4)", but this only results
---- /dat , where I expect the first 4 digits of the inserted Institution
name like "LEFT" function of excel.
I tried this way (without quotes around the path i.e.
calculate="substr(/data/Institution_name,0,4)" ) too but it doesn't work.
ODK validator 1.3 says: "java.lang.StringIndexOutOfBoundsException: String
index out of range: 4"
&
"ODK collect v1.3 rev 1029" is unable to parse the form.
Any thing else that I should try? Please, suggest !
Thank you,
M
···
On Tuesday, November 12, 2013 11:45:34 PM UTC+6, Mitch Sundt wrote:
>
> The single-quotes around the path '/data/institution_name' mean that this
> is a literal string value. To access the contents of that field, you
> should write:
>
> calculate="substr(/data/institution_name,0,4)"
>
> i.e., no quotes around the path
>
>
> On Mon, Nov 11, 2013 at 11:34 PM, Maeshal <tito.f...@gmail.com wrote:
>
>> Hello !!!
>>
>> I'm trying to extract sub-string (e.g, first 4 digits) from a text entry
>> (Institution_name) to a field such as "Institution_code" using
>> calculate="substr('/data/Institution_name',0,4)", but this only results
>> ---- /dat , where I expect the first 4 digits of the inserted Institution
>> name like "LEFT" function of excel.
>>
>>
>> Please help .... !
>>
>> Thanks,
>> M
>>
>>
>> --
>> --
>> Post: opend...@googlegroups.com
>> Unsubscribe: opendatakit...@googlegroups.com
>> Options: http://groups.google.com/group/opendatakit?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "ODK Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to opendatakit...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Mitch Sundt
> Software Engineer
> University of Washington
> mitche...@gmail.com
>
···
On Tue, Nov 12, 2013 at 9:16 PM, Maeshal wrote:
Thank you Mitch,
I tried this way (without quotes around the path i.e.
calculate="substr(/data/Institution_name,0,4)" ) too but it doesn't work.
ODK validator 1.3 says: "java.lang.StringIndexOutOfBoundsException:
String index out of range: 4"
&
"ODK collect v1.3 rev 1029" is unable to parse the form.
Any thing else that I should try? Please, suggest !
Thank you,
M
On Tuesday, November 12, 2013 11:45:34 PM UTC+6, Mitch Sundt wrote:
The single-quotes around the path '/data/institution_name' mean that this
is a literal string value. To access the contents of that field, you
should write:
I'm trying to extract sub-string (e.g, first 4 digits) from a text entry
(Institution_name) to a field such as "Institution_code" using
calculate="substr('/data/Institution_name',0,4)", but this only results
---- /dat , where I expect the first 4 digits of the inserted Institution
name like "LEFT" function of excel.
You received this message because you are subscribed to the Google
Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit...@googlegroups.com.