Displaying a district name instead of number (number from a scanned ID card)?

This isn't possible with classic javarosa functionality, though may be
possible with newer itemsets. Copying odk-community in case anyone there
has a suggestion.
The closest thing I know if is of cascading selects, but having the first
question being extracted from an ID pretty much precludes that, I believe.

··· On Tue, May 7, 2013 at 7:31 AM, wrote:

Hi,

I am working on a large public health trial in southern Nepal, and we are
trying to check that our staff are working in the correct district each
day, and we would like to know where they are if not.

Our current logic is:

  1. Scan ID card
  2. Extract first four digits of this card (corresponding to a code for the
    district) [substr(${nm_barcode},0,4)]
  3. Ask the question "Are you in district 1234?"
  4. If not, they choose the correct district from a drop down list of 80
    districts (with the name being the 4 digit code and the label being the
    district name) [selected(${right_vdc_check},'n')]

I would like it to ask, for example, "Are you in Yadukush district?"
instead of "Are you in district 7101?", so the substring of the ID card
needs to somehow produce the appropriate label for the question.

Is there a way of doing this, short of producing 80 conditional questions
based on the value of the first four digits of the card?

Thanks,

Matt

--
You received this message because you are subscribed to the Google Groups
"formhub-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to formhub-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Prabhas Pokharel
http://prabhasp.com
US mobile: +1 347 948 7654
twitter/skype/facebook/whatever: prabhasp

Matt,

Here's how you might do it using a cascading-select:

  1. Add your 80 districts into the choices sheet as you described (list_name
    "district", e.g.).

  2. Add an "id" column into the choices sheet, and copy your "name" column
    into that "id" column for all 80 districts.

  3. Add a new, 81st district with name "0", label "Other", and id "0".

  4. In your survey worksheet, add a "choice_filter" column.

  5. Add a new "select_one district" question to confirm the choice of
    district. In the choice_filter column, put: "id=${youridfield} or id=0".
    That should show exactly two choices: the name of the district already
    chosen by ID, and the "Other" option.

  6. Use the relevance column to see if they select 0, and, if so, walk them
    through choosing a district. (You might further use cascading-selects to
    have them choose a region first, etc.)

(This assumes that formhub supports the new-style cascading selects. I
presume that it does.) (This is the kind of thing that's also easy to do
with SurveyCTO's upcoming pre-load functionality: you would include a .csv
file that indicates all of the district names by ID, then you could easily
pull district names from that .csv in response to user input. But you can
also manage, I think, using clever use of cascading selects.)

Best,

Chris

··· On Tue, May 7, 2013 at 9:04 AM, Prabhas Pokharel <prabhas.pokharel@gmail.com wrote:

This isn't possible with classic javarosa functionality, though may be
possible with newer itemsets. Copying odk-community in case anyone there
has a suggestion.
The closest thing I know if is of cascading selects, but having the first
question being extracted from an ID pretty much precludes that, I believe.

On Tue, May 7, 2013 at 7:31 AM, lbwsat@gmail.com wrote:

Hi,

I am working on a large public health trial in southern Nepal, and we are
trying to check that our staff are working in the correct district each
day, and we would like to know where they are if not.

Our current logic is:

  1. Scan ID card
  2. Extract first four digits of this card (corresponding to a code for
    the district) [substr(${nm_barcode},0,4)]
  3. Ask the question "Are you in district 1234?"
  4. If not, they choose the correct district from a drop down list of 80
    districts (with the name being the 4 digit code and the label being the
    district name) [selected(${right_vdc_check},'n')]

I would like it to ask, for example, "Are you in Yadukush district?"
instead of "Are you in district 7101?", so the substring of the ID card
needs to somehow produce the appropriate label for the question.

Is there a way of doing this, short of producing 80 conditional questions
based on the value of the first four digits of the card?

Thanks,

Matt

--
You received this message because you are subscribed to the Google Groups
"formhub-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to formhub-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Prabhas Pokharel
http://prabhasp.com
US mobile: +1 347 948 7654
twitter/skype/facebook/whatever: prabhasp

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

Thanks for the input, it works perfectly. I had made a mistake with the
syntax, leaving the "" in around the choice_filter. This makes our question
flow much more intuitive and less prone to mistakes, which is great.

Thanks again,

Matt

··· On Tuesday, May 7, 2013 12:49:05 PM UTC+5:45, Prabhas P. wrote: > > This isn't possible with classic javarosa functionality, though may be > possible with newer itemsets. Copying odk-community in case anyone there > has a suggestion. > The closest thing I know if is of cascading selects, but having the first > question being extracted from an ID pretty much precludes that, I believe. > > > On Tue, May 7, 2013 at 7:31 AM, <lbw...@gmail.com > wrote: > >> Hi, >> >> I am working on a large public health trial in southern Nepal, and we are >> trying to check that our staff are working in the correct district each >> day, and we would like to know where they are if not. >> >> Our current logic is: >> >> 1. Scan ID card >> 2. Extract first four digits of this card (corresponding to a code for >> the district) [substr(${nm_barcode},0,4)] >> 3. Ask the question "Are you in district 1234?" >> 4. If not, they choose the correct district from a drop down list of 80 >> districts (with the name being the 4 digit code and the label being the >> district name) [selected(${right_vdc_check},'n')] >> >> I would like it to ask, for example, "Are you in Yadukush district?" >> instead of "Are you in district 7101?", so the substring of the ID card >> needs to somehow produce the appropriate label for the question. >> >> Is there a way of doing this, short of producing 80 conditional questions >> based on the value of the first four digits of the card? >> >> Thanks, >> >> Matt >> >> -- >> You received this message because you are subscribed to the Google Groups >> "formhub-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to formhub-user...@googlegroups.com . >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Prabhas Pokharel > http://prabhasp.com > US mobile: +1 347 948 7654 > twitter/skype/facebook/whatever: prabhasp >

I believe the question mentioned that the first ID should be scanned, not
selected, no?

(Formhub does support both new and old cascading selects.)

··· On May 7, 2013 9:13 AM, "Christopher Robert" wrote:

Matt,

Here's how you might do it using a cascading-select:

  1. Add your 80 districts into the choices sheet as you described
    (list_name "district", e.g.).

  2. Add an "id" column into the choices sheet, and copy your "name" column
    into that "id" column for all 80 districts.

  3. Add a new, 81st district with name "0", label "Other", and id "0".

  4. In your survey worksheet, add a "choice_filter" column.

  5. Add a new "select_one district" question to confirm the choice of
    district. In the choice_filter column, put: "id=${youridfield} or id=0".
    That should show exactly two choices: the name of the district already
    chosen by ID, and the "Other" option.

  6. Use the relevance column to see if they select 0, and, if so, walk them
    through choosing a district. (You might further use cascading-selects to
    have them choose a region first, etc.)

(This assumes that formhub supports the new-style cascading selects. I
presume that it does.) (This is the kind of thing that's also easy to do
with SurveyCTO's upcoming pre-load functionality: you would include a .csv
file that indicates all of the district names by ID, then you could easily
pull district names from that .csv in response to user input. But you can
also manage, I think, using clever use of cascading selects.)

Best,

Chris

On Tue, May 7, 2013 at 9:04 AM, Prabhas Pokharel < prabhas.pokharel@gmail.com> wrote:

This isn't possible with classic javarosa functionality, though may be
possible with newer itemsets. Copying odk-community in case anyone there
has a suggestion.
The closest thing I know if is of cascading selects, but having the first
question being extracted from an ID pretty much precludes that, I believe.

On Tue, May 7, 2013 at 7:31 AM, lbwsat@gmail.com wrote:

Hi,

I am working on a large public health trial in southern Nepal, and we
are trying to check that our staff are working in the correct district each
day, and we would like to know where they are if not.

Our current logic is:

  1. Scan ID card
  2. Extract first four digits of this card (corresponding to a code for
    the district) [substr(${nm_barcode},0,4)]
  3. Ask the question "Are you in district 1234?"
  4. If not, they choose the correct district from a drop down list of 80
    districts (with the name being the 4 digit code and the label being the
    district name) [selected(${right_vdc_check},'n')]

I would like it to ask, for example, "Are you in Yadukush district?"
instead of "Are you in district 7101?", so the substring of the ID card
needs to somehow produce the appropriate label for the question.

Is there a way of doing this, short of producing 80 conditional
questions based on the value of the first four digits of the card?

Thanks,

Matt

--
You received this message because you are subscribed to the Google
Groups "formhub-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to formhub-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Prabhas Pokharel
http://prabhasp.com
US mobile: +1 347 948 7654
twitter/skype/facebook/whatever: prabhasp

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"formhub-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to formhub-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Yes, so they can use a barcode field to scan the ID to begin with, then use
a calculate field to pull the first four digits. I was presuming that Matt
had already succeeded in those first two steps (i.e., getting to "Are you
in district 1234?"). From there, then, he can use the cascading-select
filter to filter using his four-digit district ID. Or I might be missing
something..!

Chris

··· On Tue, May 7, 2013 at 11:30 AM, Prabhas Pokharel < prabhas.pokharel@gmail.com> wrote:

I believe the question mentioned that the first ID should be scanned, not
selected, no?

(Formhub does support both new and old cascading selects.)
On May 7, 2013 9:13 AM, "Christopher Robert" crobert@surveycto.com wrote:

Matt,

Here's how you might do it using a cascading-select:

  1. Add your 80 districts into the choices sheet as you described
    (list_name "district", e.g.).

  2. Add an "id" column into the choices sheet, and copy your "name" column
    into that "id" column for all 80 districts.

  3. Add a new, 81st district with name "0", label "Other", and id "0".

  4. In your survey worksheet, add a "choice_filter" column.

  5. Add a new "select_one district" question to confirm the choice of
    district. In the choice_filter column, put: "id=${youridfield} or id=0".
    That should show exactly two choices: the name of the district already
    chosen by ID, and the "Other" option.

  6. Use the relevance column to see if they select 0, and, if so, walk
    them through choosing a district. (You might further use cascading-selects
    to have them choose a region first, etc.)

(This assumes that formhub supports the new-style cascading selects. I
presume that it does.) (This is the kind of thing that's also easy to do
with SurveyCTO's upcoming pre-load functionality: you would include a .csv
file that indicates all of the district names by ID, then you could easily
pull district names from that .csv in response to user input. But you can
also manage, I think, using clever use of cascading selects.)

Best,

Chris

On Tue, May 7, 2013 at 9:04 AM, Prabhas Pokharel < prabhas.pokharel@gmail.com> wrote:

This isn't possible with classic javarosa functionality, though may be
possible with newer itemsets. Copying odk-community in case anyone there
has a suggestion.
The closest thing I know if is of cascading selects, but having the
first question being extracted from an ID pretty much precludes that, I
believe.

On Tue, May 7, 2013 at 7:31 AM, lbwsat@gmail.com wrote:

Hi,

I am working on a large public health trial in southern Nepal, and we
are trying to check that our staff are working in the correct district each
day, and we would like to know where they are if not.

Our current logic is:

  1. Scan ID card
  2. Extract first four digits of this card (corresponding to a code for
    the district) [substr(${nm_barcode},0,4)]
  3. Ask the question "Are you in district 1234?"
  4. If not, they choose the correct district from a drop down list of 80
    districts (with the name being the 4 digit code and the label being the
    district name) [selected(${right_vdc_check},'n')]

I would like it to ask, for example, "Are you in Yadukush district?"
instead of "Are you in district 7101?", so the substring of the ID card
needs to somehow produce the appropriate label for the question.

Is there a way of doing this, short of producing 80 conditional
questions based on the value of the first four digits of the card?

Thanks,

Matt

--
You received this message because you are subscribed to the Google
Groups "formhub-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to formhub-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Prabhas Pokharel
http://prabhasp.com
US mobile: +1 347 948 7654
twitter/skype/facebook/whatever: prabhasp

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"formhub-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to formhub-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

Thanks for your replies - I have already extracted the ID code for the
district and have this code displayed in the following question - I will
try and implement the cascading selects, although I think I am a little
unclear on exactly how these work.

Thanks again,

Matt

··· On Tuesday, May 7, 2013 3:30:40 PM UTC+5:45, Christopher Robert wrote: > > Yes, so they can use a barcode field to scan the ID to begin with, then > use a calculate field to pull the first four digits. I was presuming that > Matt had already succeeded in those first two steps (i.e., getting to "Are > you in district 1234?"). From there, then, he can use the cascading-select > filter to filter using his four-digit district ID. Or I might be missing > something..! > > Chris > > > > On Tue, May 7, 2013 at 11:30 AM, Prabhas Pokharel <prabhas....@gmail.com wrote: > >> I believe the question mentioned that the first ID should be scanned, not >> selected, no? >> >> (Formhub does support both new and old cascading selects.) >> On May 7, 2013 9:13 AM, "Christopher Robert" <cro...@surveycto.com> wrote: >> >>> Matt, >>> >>> Here's how you might do it using a cascading-select: >>> >>> 1. Add your 80 districts into the choices sheet as you described >>> (list_name "district", e.g.). >>> >>> 2. Add an "id" column into the choices sheet, and copy your "name" >>> column into that "id" column for all 80 districts. >>> >>> 3. Add a new, 81st district with name "0", label "Other", and id "0". >>> >>> 4. In your survey worksheet, add a "choice_filter" column. >>> >>> 5. Add a new "select_one district" question to confirm the choice of >>> district. In the choice_filter column, put: "id=${youridfield} or id=0". >>> That should show exactly two choices: the name of the district already >>> chosen by ID, and the "Other" option. >>> >>> 6. Use the relevance column to see if they select 0, and, if so, walk >>> them through choosing a district. (You might further use cascading-selects >>> to have them choose a region first, etc.) >>> >>> (This assumes that formhub supports the new-style cascading selects. I >>> presume that it does.) (This is the kind of thing that's also easy to do >>> with SurveyCTO's upcoming pre-load functionality: you would include a .csv >>> file that indicates all of the district names by ID, then you could easily >>> pull district names from that .csv in response to user input. But you can >>> also manage, I think, using clever use of cascading selects.) >>> >>> Best, >>> >>> Chris >>> >>> >>> >>> >>> On Tue, May 7, 2013 at 9:04 AM, Prabhas Pokharel <prabhas....@gmail.com wrote: >>> >>>> This isn't possible with classic javarosa functionality, though may be >>>> possible with newer itemsets. Copying odk-community in case anyone there >>>> has a suggestion. >>>> The closest thing I know if is of cascading selects, but having the >>>> first question being extracted from an ID pretty much precludes that, I >>>> believe. >>>> >>>> >>>> On Tue, May 7, 2013 at 7:31 AM, <lbw...@gmail.com > wrote: >>>> >>>>> Hi, >>>>> >>>>> I am working on a large public health trial in southern Nepal, and we >>>>> are trying to check that our staff are working in the correct district each >>>>> day, and we would like to know where they are if not. >>>>> >>>>> Our current logic is: >>>>> >>>>> 1. Scan ID card >>>>> 2. Extract first four digits of this card (corresponding to a code for >>>>> the district) [substr(${nm_barcode},0,4)] >>>>> 3. Ask the question "Are you in district 1234?" >>>>> 4. If not, they choose the correct district from a drop down list of >>>>> 80 districts (with the name being the 4 digit code and the label being the >>>>> district name) [selected(${right_vdc_check},'n')] >>>>> >>>>> I would like it to ask, for example, "Are you in Yadukush district?" >>>>> instead of "Are you in district 7101?", so the substring of the ID card >>>>> needs to somehow produce the appropriate label for the question. >>>>> >>>>> Is there a way of doing this, short of producing 80 conditional >>>>> questions based on the value of the first four digits of the card? >>>>> >>>>> Thanks, >>>>> >>>>> Matt >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "formhub-users" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to formhub-user...@googlegroups.com . >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Prabhas Pokharel >>>> http://prabhasp.com >>>> US mobile: +1 347 948 7654 >>>> twitter/skype/facebook/whatever: prabhasp >>>> >>>> -- >>>> -- >>>> 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. >>>> >>>> >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "formhub-users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to formhub-user...@googlegroups.com . >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> -- >> -- >> 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. >> >> >> > >

Hi again,

So due to Nepali language display issues we are using a localised version
of ODK Collect for our data collection. I think I have implemented I have
used the following syntax:

type name label
calculate
choice_filter relevant
calculate nm_vdc
subsrt(${nm_barcode},0,4)
select_one vdc_no right_vdc_check Are you in this VDC (${nm_vdc})?
"id=${nm_vdc} or id=0"
select_one vdc_dis wrong_vdc Which VDC are you in?

selected(${right_vdc_check},'0')

This does not display any options when used in ODK Collect, it only says,
for example "Are you in this VDC (7052)?" with no choices displayed.
On the formhub web interface, all VDC options are displayed in a list. I
was previously using a yes/no option for "Are you in this VDC (7052)?"
which worked well - all I really wanted to do was replace, for example,
"7052" with "KajaraRamaul" in the question. Have I missed something in the
syntax here?

Thanks, and sorry if I have missed an obvious step.

Matt

··· On Wednesday, May 8, 2013 11:41:34 AM UTC+5:45, lbw...@gmail.com wrote: > > Hi, > > Thanks for your replies - I have already extracted the ID code for the > district and have this code displayed in the following question - I will > try and implement the cascading selects, although I think I am a little > unclear on exactly how these work. > > Thanks again, > > Matt > > On Tuesday, May 7, 2013 3:30:40 PM UTC+5:45, Christopher Robert wrote: >> >> Yes, so they can use a barcode field to scan the ID to begin with, then >> use a calculate field to pull the first four digits. I was presuming that >> Matt had already succeeded in those first two steps (i.e., getting to "Are >> you in district 1234?"). From there, then, he can use the cascading-select >> filter to filter using his four-digit district ID. Or I might be missing >> something..! >> >> Chris >> >> >> >> On Tue, May 7, 2013 at 11:30 AM, Prabhas Pokharel wrote: >> >>> I believe the question mentioned that the first ID should be scanned, >>> not selected, no? >>> >>> (Formhub does support both new and old cascading selects.) >>> On May 7, 2013 9:13 AM, "Christopher Robert" wrote: >>> >>>> Matt, >>>> >>>> Here's how you might do it using a cascading-select: >>>> >>>> 1. Add your 80 districts into the choices sheet as you described >>>> (list_name "district", e.g.). >>>> >>>> 2. Add an "id" column into the choices sheet, and copy your "name" >>>> column into that "id" column for all 80 districts. >>>> >>>> 3. Add a new, 81st district with name "0", label "Other", and id "0". >>>> >>>> 4. In your survey worksheet, add a "choice_filter" column. >>>> >>>> 5. Add a new "select_one district" question to confirm the choice of >>>> district. In the choice_filter column, put: "id=${youridfield} or id=0". >>>> That should show exactly two choices: the name of the district already >>>> chosen by ID, and the "Other" option. >>>> >>>> 6. Use the relevance column to see if they select 0, and, if so, walk >>>> them through choosing a district. (You might further use cascading-selects >>>> to have them choose a region first, etc.) >>>> >>>> (This assumes that formhub supports the new-style cascading selects. I >>>> presume that it does.) (This is the kind of thing that's also easy to do >>>> with SurveyCTO's upcoming pre-load functionality: you would include a .csv >>>> file that indicates all of the district names by ID, then you could easily >>>> pull district names from that .csv in response to user input. But you can >>>> also manage, I think, using clever use of cascading selects.) >>>> >>>> Best, >>>> >>>> Chris >>>> >>>> >>>> >>>> >>>> On Tue, May 7, 2013 at 9:04 AM, Prabhas Pokharel >>> >>>>> This isn't possible with classic javarosa functionality, though may be >>>>> possible with newer itemsets. Copying odk-community in case anyone there >>>>> has a suggestion. >>>>> The closest thing I know if is of cascading selects, but having the >>>>> first question being extracted from an ID pretty much precludes that, I >>>>> believe. >>>>> >>>>> >>>>> On Tue, May 7, 2013 at 7:31 AM, wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I am working on a large public health trial in southern Nepal, and we >>>>>> are trying to check that our staff are working in the correct district each >>>>>> day, and we would like to know where they are if not. >>>>>> >>>>>> Our current logic is: >>>>>> >>>>>> 1. Scan ID card >>>>>> 2. Extract first four digits of this card (corresponding to a code >>>>>> for the district) [substr(${nm_barcode},0,4)] >>>>>> 3. Ask the question "Are you in district 1234?" >>>>>> 4. If not, they choose the correct district from a drop down list of >>>>>> 80 districts (with the name being the 4 digit code and the label being the >>>>>> district name) [selected(${right_vdc_check},'n')] >>>>>> >>>>>> I would like it to ask, for example, "Are you in Yadukush district?" >>>>>> instead of "Are you in district 7101?", so the substring of the ID card >>>>>> needs to somehow produce the appropriate label for the question. >>>>>> >>>>>> Is there a way of doing this, short of producing 80 conditional >>>>>> questions based on the value of the first four digits of the card? >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Matt >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "formhub-users" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to formhub-user...@googlegroups.com. >>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Prabhas Pokharel >>>>> http://prabhasp.com >>>>> US mobile: +1 347 948 7654 >>>>> twitter/skype/facebook/whatever: prabhasp >>>>> >>>>> -- >>>>> -- >>>>> 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. >>>>> >>>>> >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "formhub-users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to formhub-user...@googlegroups.com. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> -- >>> -- >>> 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. >>> >>> >>> >> >>

Hi Matt,

It looks to me like that should work, but then I don't know about the
cascading-selects implementation in formhub's web interface, nor about its
implementation on your particular version of Collect. It could be that
neither supports this cascading-selects syntax. Maybe Prabhas or somebody
else knowledgeable about formhub would know?

Chris

··· On Wed, May 8, 2013 at 8:53 AM, wrote:

Hi again,

So due to Nepali language display issues we are using a localised version
of ODK Collect for our data collection. I think I have implemented I have
used the following syntax:

type name label
calculate
choice_filter relevant
calculate nm_vdc
subsrt(${nm_barcode},0,4)
select_one vdc_no right_vdc_check Are you in this VDC (${nm_vdc})?
"id=${nm_vdc} or id=0"
select_one vdc_dis wrong_vdc Which VDC are you in?

 selected(${right_vdc_check},'0')

This does not display any options when used in ODK Collect, it only says,
for example "Are you in this VDC (7052)?" with no choices displayed.
On the formhub web interface, all VDC options are displayed in a list. I
was previously using a yes/no option for "Are you in this VDC (7052)?"
which worked well - all I really wanted to do was replace, for example,
"7052" with "KajaraRamaul" in the question. Have I missed something in
the syntax here?

Thanks, and sorry if I have missed an obvious step.

Matt

On Wednesday, May 8, 2013 11:41:34 AM UTC+5:45, lbw...@gmail.com wrote:

Hi,

Thanks for your replies - I have already extracted the ID code for the
district and have this code displayed in the following question - I will
try and implement the cascading selects, although I think I am a little
unclear on exactly how these work.

Thanks again,

Matt

On Tuesday, May 7, 2013 3:30:40 PM UTC+5:45, Christopher Robert wrote:

Yes, so they can use a barcode field to scan the ID to begin with, then
use a calculate field to pull the first four digits. I was presuming that
Matt had already succeeded in those first two steps (i.e., getting to "Are
you in district 1234?"). From there, then, he can use the cascading-select
filter to filter using his four-digit district ID. Or I might be missing
something..!

Chris

On Tue, May 7, 2013 at 11:30 AM, Prabhas Pokharel <prabhas....@gmail.com wrote:

I believe the question mentioned that the first ID should be scanned,
not selected, no?

(Formhub does support both new and old cascading selects.)
On May 7, 2013 9:13 AM, "Christopher Robert" cro...@surveycto.com wrote:

Matt,

Here's how you might do it using a cascading-select:

  1. Add your 80 districts into the choices sheet as you described
    (list_name "district", e.g.).

  2. Add an "id" column into the choices sheet, and copy your "name"
    column into that "id" column for all 80 districts.

  3. Add a new, 81st district with name "0", label "Other", and id "0".

  4. In your survey worksheet, add a "choice_filter" column.

  5. Add a new "select_one district" question to confirm the choice of
    district. In the choice_filter column, put: "id=${youridfield} or id=0".
    That should show exactly two choices: the name of the district already
    chosen by ID, and the "Other" option.

  6. Use the relevance column to see if they select 0, and, if so, walk
    them through choosing a district. (You might further use cascading-selects
    to have them choose a region first, etc.)

(This assumes that formhub supports the new-style cascading selects. I
presume that it does.) (This is the kind of thing that's also easy to do
with SurveyCTO's upcoming pre-load functionality: you would include a .csv
file that indicates all of the district names by ID, then you could easily
pull district names from that .csv in response to user input. But you can
also manage, I think, using clever use of cascading selects.)

Best,

Chris

On Tue, May 7, 2013 at 9:04 AM, Prabhas Pokharel < prabhas....@gmail.com> wrote:

This isn't possible with classic javarosa functionality, though may
be possible with newer itemsets. Copying odk-community in case anyone there
has a suggestion.
The closest thing I know if is of cascading selects, but having the
first question being extracted from an ID pretty much precludes that, I
believe.

On Tue, May 7, 2013 at 7:31 AM, lbw...@gmail.com wrote:

Hi,

I am working on a large public health trial in southern Nepal, and
we are trying to check that our staff are working in the correct district
each day, and we would like to know where they are if not.

Our current logic is:

  1. Scan ID card
  2. Extract first four digits of this card (corresponding to a code
    for the district) [substr(${nm_barcode},0,4)]
  3. Ask the question "Are you in district 1234?"
  4. If not, they choose the correct district from a drop down list of
    80 districts (with the name being the 4 digit code and the label being the
    district name) [selected(${right_vdc_check},'**n')]

I would like it to ask, for example, "Are you in Yadukush district?"
instead of "Are you in district 7101?", so the substring of the ID card
needs to somehow produce the appropriate label for the question.

Is there a way of doing this, short of producing 80 conditional
questions based on the value of the first four digits of the card?

Thanks,

Matt

--
You received this message because you are subscribed to the Google
Groups "formhub-users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to formhub-user...@googlegroups.**com.
For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
Prabhas Pokharel
http://prabhasp.com
US mobile: +1 347 948 7654
twitter/skype/facebook/**whatever: prabhasp

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@googlegroups.**com
Options: http://groups.google.com/**group/opendatakit?hl=enhttp://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_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to the Google
Groups "formhub-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to formhub-user...@googlegroups.**com.
For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@googlegroups.**com
Options: http://groups.google.com/**group/opendatakit?hl=enhttp://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_outhttps://groups.google.com/groups/opt_out
.