Fixtures by filter

27 views
Skip to first unread message

Htet

unread,
Jul 21, 2015, 2:20:46 AM7/21/15
to commcar...@googlegroups.com
Dear colleagues,

I noticed there is a change in the display of lookup tables in our application. 
I am curious to know how the function "filter" can help for the lookup tables? 
Please kindly suggest for this and thanks. 

Htet

Fiorenzo Conte

unread,
Jul 21, 2015, 2:31:23 AM7/21/15
to commcar...@googlegroups.com
Dear Htet,

Thanks for the inquiry. This page gives you an example on how to use the filter for lookup tables https://confluence.dimagi.com/display/commcarepublic/Setup+a+Question+with+Filtered+Choices

Best,

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



--
Fiorenzo Conte
Project Manager | Gestionnaire de projet
West Africa | Afrique de l'Ouest
Dimagi, Inc
m Senegal : +221 77 293 91 89 | m Kenya: +254 706 970567
s : fioreco86



Kyaw Htet

unread,
Jul 22, 2015, 5:27:17 AM7/22/15
to commcar...@googlegroups.com
Dear Fiorenzo Conte,

Thank you so much for the suggestions. 
It helps. 

Best,
Htet

--
You received this message because you are subscribed to a topic in the Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commcare-users/1dsTioFWzkI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commcare-user...@googlegroups.com.

Htet

unread,
Jul 22, 2015, 9:39:42 AM7/22/15
to commcare-users
Dear Fiorenzo Conte,

In relation to my previous question, I would like to know using lookup tables with multiple languages. 
I have visited the site which explains about this and would like to ask a few questions. 
Following the instruction, I can upload the lookup tables with 2 languages. But I need some advice in dealing with the editing of XML. 

The following is the xml that I copied from that example. 

<select1 ref="/data/state">
<label ref="jr:itext('state-label')" />
<itemset nodeset="instance('states')/state_list/state">
<label ref="name[@lang = jr:itext('lang-code-label')]"/>
<value ref="id"/>
</itemset>
</select1> 

In the above example, "state" is used for explanation and if I would like use state, district and township, do I need to add the red color XML for each variable? Since the term "name" is not specific, how can it differentiate name for districts and township? Do we need to change that name into state/district or township? Eg. <label ref="state[@lang = jr:itext('lang-code-label')]"/>

Please kindly advice for this and thank you so much for your support. 

Htet

Nate Haduch

unread,
Jul 23, 2015, 1:36:37 PM7/23/15
to commcar...@googlegroups.com
Hi Htet,

You might be able to take advantage of the Single Answer Lookup Table question type in order to perform these actions: https://help.commcarehq.org/display/commcarepublic/Setup+a+Question+with+Filtered+Choices

Please let us know if this is helpful or if you require further assistance.

Thanks,


-- 
Nate Haduch

Technical Support Analyst
Dimagi, Inc | 585 Massachusetts Ave | Suite 3 | Cambridge, MA 02139

Sheel Shah

unread,
Jul 23, 2015, 1:44:46 PM7/23/15
to commcar...@googlegroups.com
Hi Htet,

For your specific question, whether you're referring to the list of districts or states is controlled in the <itemset nodeset.... /> line above the one that is highlighted in red.  

Using the new lookup table question type would definitely make this easier:
  • Add a lookup table question type
  • Choose your table (i.e. states or districts)
  • Set the value to the column in the table that you want to store
  • Set the label to the column in the table you want to display (ex. name).  However, you will need to update the label field so that its name[@lang = jr:itext('lang-code-label')]  You can replace name with whatever column in your chosen table you want to display.
  • You'll still be required to add a question that contains all your language codes (per the documentation here https://confluence.dimagi.com/display/commcarepublic/Using+Lookup+Tables+with+Multiple+Languages).
I'm going to update the documentation to be a bit clearer and will let you know when its complete.  

Thanks,
Sheel
Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah


Kyaw Htet

unread,
Jul 26, 2015, 11:30:39 AM7/26/15
to commcar...@googlegroups.com
Dear Nate,

Thank you for your mail. 
That link is really helpful and I can follow it well. 

Best wishes,
Htet

--
You received this message because you are subscribed to a topic in the Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commcare-users/1dsTioFWzkI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commcare-user...@googlegroups.com.

Kyaw Htet

unread,
Jul 26, 2015, 2:53:33 PM7/26/15
to commcar...@googlegroups.com
Dear Sheel,

Thank you for your explanation and it is very helpful. 
I look forward to your update version of the explanation. 

Many thanks,
Htet


--
You received this message because you are subscribed to a topic in the Google Groups "commcare-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commcare-users/1dsTioFWzkI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commcare-user...@googlegroups.com.

Sheel Shah

unread,
Jul 29, 2015, 3:41:08 PM7/29/15
to commcar...@googlegroups.com
Hi Htet,

I've updated the documentation - please let me know if you have any other questions! 

Thanks,
Sheel

Kyaw Htet

unread,
Aug 10, 2015, 3:52:04 AM8/10/15
to commcar...@googlegroups.com
Dear Sheel,

Many thanks for your help. 
It seems according to the update, we can set the label as "name[@lang = jr:itext('lang-code-label')]" and don't need to edit in the xml. Will get back to you if I have further questions. 

Best wishes,
Htet
Reply all
Reply to author
Forward
0 new messages