Populating multiple choice options

Hello. I'm trying create a form that is able to capture details about a new
child from a certain school. That’s is my idea for the one form and case.
The other form is supposed to be an attendance register that is populated
by the specific school the children are registered for, just a simple
question with multiple checkboxes to check off whether the child is present
or not.

My question: is it possible to populate a multiple choice question’s
options with children/cases that have been created?

I'm not sure if I'm phrasing my question clearly enough. I'm also not sure
how one can go about populating the multiple choice options from XML, but
if anyone can point me in the right direction or can suggest an alternative
way to approach the problem I'd appreciate it.

Simone,

Hi. So what you're looking to do is create a multiselect that lists cases
to be selected? That's definitely possible in CommCare, but unfortunately
it's not supported yet by the application builder.

I'll describe below how you can pull it off by editing the XForm by hand,
but if that's not something your comfortable doing, we can also keep you up
to date about when something like this is possible.

If you are comfortable hacking around in the XForm, you can set up what you
want by setting up an "itemset" which is based on the case database.
Essentially: You'd create a select question, edit the XML, find the
block which represents your placeholder question and replace its
tags with the following (Only the bold parts of the XML below are
changes. Everything else is what was there before). You'll need to include
your case's "type" in the xml where noted

* * * * * *** * *

If you are not already using a form which required selecting a case, you
will also need to add this xml right above where the app places all of the
tags

-Clayton

··· On Tue, May 7, 2013 at 3:25 AM, Simoné wrote:

Hello. I'm trying create a form that is able to capture details about a
new child from a certain school. That’s is my idea for the one form and
case. The other form is supposed to be an attendance register that is
populated by the specific school the children are registered for, just a
simple question with multiple checkboxes to check off whether the child is
present or not.

My question: is it possible to populate a multiple choice question’s
options with children/cases that have been created?

I'm not sure if I'm phrasing my question clearly enough. I'm also not sure
how one can go about populating the multiple choice options from XML, but
if anyone can point me in the right direction or can suggest an alternative
way to approach the problem I'd appreciate it.

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

Hello Clayton

I've applied your suggestion and it works well to display one value per
multi select option. I'm still not that familiar with working with the XML
yet, but here is what I want for the option to display as well.

I want to concatenate two values together (the name and surname from each
case) and it should only load the specific cases for a certain region. For
that I've added a single select option before the multi select, but I'm
unsure of how to set the condition since the values are populated through
XML.

I'm not sure if I'm being that clear, but any help is appreciated.

··· On Tuesday, 7 May 2013 17:13:12 UTC+2, Clayton Sims wrote: > > Simone, > > Hi. So what you're looking to do is create a multiselect that lists cases > to be selected? That's definitely possible in CommCare, but unfortunately > it's not supported yet by the application builder. > > I'll describe below how you can pull it off by editing the XForm by hand, > but if that's not something your comfortable doing, we can also keep you up > to date about when something like this is possible. > > If you are comfortable hacking around in the XForm, you can set up what > you want by setting up an "itemset" which is based on the case database. > Essentially: You'd create a select question, edit the XML, find the > block which represents your placeholder question and replace its > tags with the following (Only the *bold* parts of the XML below > are changes. Everything else is what was there before). You'll need to > include your case's "type" in the xml where noted > > > > * nodeset="instance('casedb')/casedb/case[@case_type='your_type']">* > * * > * *** > * * > > > If you are not already using a form which required selecting a case, you > will also need to add this xml right above where the app places all of the > tags > > > > > -Clayton > > On Tue, May 7, 2013 at 3:25 AM, Simoné <smhen...@gmail.com >wrote: > >> Hello. I'm trying create a form that is able to capture details about a >> new child from a certain school. That’s is my idea for the one form and >> case. The other form is supposed to be an attendance register that is >> populated by the specific school the children are registered for, just a >> simple question with multiple checkboxes to check off whether the child is >> present or not. >> >> My question: is it possible to populate a multiple choice question’s >> options with children/cases that have been created? >> >> I'm not sure if I'm phrasing my question clearly enough. I'm also not >> sure how one can go about populating the multiple choice options from XML, >> but if anyone can point me in the right direction or can suggest an >> alternative way to approach the problem I'd appreciate it. >> >> -- >> 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/groups/opt_out. >> >> >> > >

Simone,

Filters are added to these expressions using the part of the expression in
brackets (highlighted below in bold)

instance('casedb')/casedb/case[@case_type='your_type']

··· * * If you want to add additional filters (only in a certain region) you can do so by adding an additional clause with your new test (if that region is selected in the form, replace 'someregion' below with the /path/to/yourregionselect)

instance('casedb')/casedb/case[@case_type='your_
type'][region_variable='someregion']

If you want to construct a string to display, you can use the "concat"
function as outlined at:
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-concat

so something like

  •  <label ref="concat(last_name, ', ', first_name)"/>*
    

Hope that helps, let me know if you have any other questions.

-Clayton

On Mon, Jul 29, 2013 at 6:25 AM, Simoné smhendricks@gmail.com wrote:

Hello Clayton

I've applied your suggestion and it works well to display one value per
multi select option. I'm still not that familiar with working with the XML
yet, but here is what I want for the option to display as well.

I want to concatenate two values together (the name and surname from each
case) and it should only load the specific cases for a certain region. For
that I've added a single select option before the multi select, but I'm
unsure of how to set the condition since the values are populated through
XML.

I'm not sure if I'm being that clear, but any help is appreciated.

On Tuesday, 7 May 2013 17:13:12 UTC+2, Clayton Sims wrote:

Simone,

Hi. So what you're looking to do is create a multiselect that lists cases
to be selected? That's definitely possible in CommCare, but unfortunately
it's not supported yet by the application builder.

I'll describe below how you can pull it off by editing the XForm by hand,
but if that's not something your comfortable doing, we can also keep you up
to date about when something like this is possible.

If you are comfortable hacking around in the XForm, you can set up what
you want by setting up an "itemset" which is based on the case database.
Essentially: You'd create a select question, edit the XML, find the
block which represents your placeholder question and replace its
tags with the following (Only the bold parts of the XML below
are changes. Everything else is what was there before). You'll need to
include your case's "type" in the xml where noted

* * * * * *** * *

If you are not already using a form which required selecting a case, you
will also need to add this xml right above where the app places all of the
tags

-Clayton

On Tue, May 7, 2013 at 3:25 AM, Simoné smhen...@gmail.com wrote:

Hello. I'm trying create a form that is able to capture details about a
new child from a certain school. That’s is my idea for the one form and
case. The other form is supposed to be an attendance register that is
populated by the specific school the children are registered for, just a
simple question with multiple checkboxes to check off whether the child is
present or not.

My question: is it possible to populate a multiple choice question’s
options with children/cases that have been created?

I'm not sure if I'm phrasing my question clearly enough. I'm also not
sure how one can go about populating the multiple choice options from XML,
but if anyone can point me in the right direction or can suggest an
alternative way to approach the problem I'd appreciate it.

--
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/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

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

Hi Clayton,

I've been attempting to achieve a similar concatenation result here, except
with two different case properties. I've attempted the following:

But I get this error:

Errors making a new version:

  • Validation Error: XPath evaluation: type mismatch
    Expected XPath path, got XPath expression: [concat(case_name, '-',
    Vodacom_Phone_Number)],null in form

This is the same syntax that you've used in your last post on this thread.
Any suggestions here?

Thanks!
Lexa

··· On Monday, July 29, 2013 at 5:07:17 PM UTC+2, Clayton Sims wrote: > > Simone, > > Filters are added to these expressions using the part of the expression in > brackets (highlighted below in bold) > > instance('casedb')/casedb/case*[@case_type='your_type']* > > If you want to add additional filters (only in a certain region) you can > do so by adding an additional clause with your new test (if that region is > selected in the form, replace 'someregion' below with the > /path/to/yourregionselect) > > instance('casedb')/casedb/case > *[@case_type='your_type'][region_variable='someregion']* > > If you want to construct a string to display, you can use the "concat" > function as outlined at: > https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-concat > > so something like > > * * > > Hope that helps, let me know if you have any other questions. > > -Clayton > > On Mon, Jul 29, 2013 at 6:25 AM, Simoné <smhen...@gmail.com > wrote: > >> Hello Clayton >> >> I've applied your suggestion and it works well to display one value per >> multi select option. I'm still not that familiar with working with the XML >> yet, but here is what I want for the option to display as well. >> >> I want to concatenate two values together (the name and surname from each >> case) and it should only load the specific cases for a certain region. For >> that I've added a single select option before the multi select, but I'm >> unsure of how to set the condition since the values are populated through >> XML. >> >> I'm not sure if I'm being that clear, but any help is appreciated. >> >> >> On Tuesday, 7 May 2013 17:13:12 UTC+2, Clayton Sims wrote: >> >>> Simone, >>> >>> Hi. So what you're looking to do is create a multiselect that lists >>> cases to be selected? That's definitely possible in CommCare, but >>> unfortunately it's not supported yet by the application builder. >>> >>> I'll describe below how you can pull it off by editing the XForm by >>> hand, but if that's not something your comfortable doing, we can also keep >>> you up to date about when something like this is possible. >>> >>> If you are comfortable hacking around in the XForm, you can set up what >>> you want by setting up an "itemset" which is based on the case database. >>> Essentially: You'd create a select question, edit the XML, find the >>> block which represents your placeholder question and replace its >>> tags with the following (Only the *bold* parts of the XML below >>> are changes. Everything else is what was there before). You'll need to >>> include your case's "type" in the xml where noted >>> >>> >>> >>> * >> nodeset="instance('casedb')/casedb/case[@case_type='your_type']">* >>> * * >>> ** >>> * * >>> >>> >>> If you are not already using a form which required selecting a case, you >>> will also need to add this xml right above where the app places all of the >>> tags >>> >>> >>> >>> >>> -Clayton >>> >>> On Tue, May 7, 2013 at 3:25 AM, Simoné wrote: >>> >>>> Hello. I'm trying create a form that is able to capture details about a >>>> new child from a certain school. That’s is my idea for the one form and >>>> case. The other form is supposed to be an attendance register that is >>>> populated by the specific school the children are registered for, just a >>>> simple question with multiple checkboxes to check off whether the child is >>>> present or not. >>>> >>>> My question: is it possible to populate a multiple choice question’s >>>> options with children/cases that have been created? >>>> >>>> I'm not sure if I'm phrasing my question clearly enough. I'm also not >>>> sure how one can go about populating the multiple choice options from XML, >>>> but if anyone can point me in the right direction or can suggest an >>>> alternative way to approach the problem I'd appreciate it. >>>> >>>> -- >>>> 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/groups/opt_out. >>>> >>>> >>>> >>> >>> -- >> 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/groups/opt_out. >> >> >> > >

Hi Lexa,

Can you confirm that Vodacom_Phone_Number is a case property and that if
properly evaluated that expression will evaluate to another case property?

It can be helpful to debug statements like this with an output value
https://confluence.dimagi.com/display/commcarepublic/Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output
in
a label.

Thanks,
Will

··· On Thu, May 19, 2016 at 3:11 PM, wrote:

Vodacom_Phone_Number

Hi Will,

Thanks for your reply, Will. I can confirm that Vodacom_Phone_Number is a
case property. I thought that maybe because Vodacom_Phone_Number is a case
property of format = Phone, that was one of the reasons it wasn't working.
I changed it to "Plain" format, but still received the same error.

I don't understand the second part of your response: Why does the
concatenated expression need to evaluate to another case property? I'm
simply trying to concatenate two case properties (name + phone number) from
a case to display as a label in a checkbox lookup table that references a
list of cases (see below). We want the table to display name as well as
phone to make it as easy as possible for the mobile worker to identify the
correct participant. I'm not sure how I'll use an output value to debug the
statement, since the form is under a module that references a different
case_type than the one in this list.

This is the expression that I'm working with. It displays a list of cases
in a mutli-select list:

* * ** * *

Thanks!
Lexa

··· On Friday, May 20, 2016 at 4:09:19 PM UTC+2, William Pride wrote: > > > Hi Lexa, > > Can you confirm that Vodacom_Phone_Number is a case property and that if > properly evaluated that expression will evaluate to another case property? > > It can be helpful to debug statements like this with an output value > in > a label. > > Thanks, > Will > > On Thu, May 19, 2016 at 3:11 PM, <le...@verasolutions.org > wrote: > >> Vodacom_Phone_Number > > > >

Hi Lexa,

I think I must have been mistaken with my original comment, apologies.

The XForm specification unfortunately does not permit an arbitrary
expression in the "label" field, the spec is restricted to only allowing a
path expression in that field. This is a constraint we are looking to work
around, but haven't settled on an extension for which will let people use
more complex expressions with itemsets, but also retain form compatibility.

-Clayton

··· On Thu, May 26, 2016 at 11:10 AM, wrote:

Hi Will,

Thanks for your reply, Will. I can confirm that Vodacom_Phone_Number is a
case property. I thought that maybe because Vodacom_Phone_Number is a case
property of format = Phone, that was one of the reasons it wasn't working.
I changed it to "Plain" format, but still received the same error.

I don't understand the second part of your response: Why does the
concatenated expression need to evaluate to another case property? I'm
simply trying to concatenate two case properties (name + phone number) from
a case to display as a label in a checkbox lookup table that references a
list of cases (see below). We want the table to display name as well as
phone to make it as easy as possible for the mobile worker to identify the
correct participant. I'm not sure how I'll use an output value to debug the
statement, since the form is under a module that references a different
case_type than the one in this list.

This is the expression that I'm working with. It displays a list of cases
in a mutli-select list:

* * ** * *

Thanks!
Lexa

On Friday, May 20, 2016 at 4:09:19 PM UTC+2, William Pride wrote:

Hi Lexa,

Can you confirm that Vodacom_Phone_Number is a case property and that if
properly evaluated that expression will evaluate to another case property?

It can be helpful to debug statements like this with an output value
https://confluence.dimagi.com/display/commcarepublic/Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output in
a label.

Thanks,
Will

On Thu, May 19, 2016 at 3:11 PM, le...@verasolutions.org wrote:

Vodacom_Phone_Number

--
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-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Clayton,

Thanks for your reply. This would be a really helpful feature, especially
when trying to identify participants from a list who might have duplicate
names.

As a workaround for this particular situation, if I created a hidden value
field on the case that was a concatenation of Name and
Vodacome_Phone_Number and referenced this field in the XForm, would this be
a viable workaround?

Thanks,
Lexa

··· On Thursday, June 2, 2016 at 6:14:06 PM UTC+2, Clayton Sims wrote: > > Hi Lexa, > > I think I must have been mistaken with my original comment, apologies. > > The XForm specification unfortunately does not permit an arbitrary > expression in the "label" field, the spec is restricted to only allowing a > path expression in that field. This is a constraint we are looking to work > around, but haven't settled on an extension for which will let people use > more complex expressions with itemsets, but also retain form compatibility. > > -Clayton > > On Thu, May 26, 2016 at 11:10 AM, <le...@verasolutions.org > wrote: > >> Hi Will, >> >> Thanks for your reply, Will. I can confirm that Vodacom_Phone_Number is a >> case property. I thought that maybe because Vodacom_Phone_Number is a case >> property of format = Phone, that was one of the reasons it wasn't working. >> I changed it to "Plain" format, but still received the same error. >> >> I don't understand the second part of your response: Why does the >> concatenated expression need to evaluate to another case property? I'm >> simply trying to concatenate two case properties (name + phone number) from >> a case to display as a label in a checkbox lookup table that references a >> list of cases (see below). We want the table to display name as well as >> phone to make it as easy as possible for the mobile worker to identify the >> correct participant. I'm not sure how I'll use an output value to debug the >> statement, since the form is under a module that references a different >> case_type than the one in this list. >> >> This is the expression that I'm working with. It displays a list of cases >> in a mutli-select list: >> >> >> >> * > nodeset="instance('casedb')/casedb/case[@case_type='Participant']">* >> >> ** >> * * >> >> >> Thanks! >> Lexa >> >> On Friday, May 20, 2016 at 4:09:19 PM UTC+2, William Pride wrote: >>> >>> >>> Hi Lexa, >>> >>> Can you confirm that Vodacom_Phone_Number is a case property and that if >>> properly evaluated that expression will evaluate to another case property? >>> >>> It can be helpful to debug statements like this with an output value >>> in >>> a label. >>> >>> Thanks, >>> Will >>> >>> On Thu, May 19, 2016 at 3:11 PM, wrote: >>> >>>> Vodacom_Phone_Number >>> >>> >>> >>> -- >> 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. >> > >

Hi Lexa,

Yes, saving the concatenated fields as a case property and referencing this
would work correctly.

Best,
Will

··· On Mon, Jun 6, 2016 at 5:53 AM, wrote:

Hi Clayton,

Thanks for your reply. This would be a really helpful feature, especially
when trying to identify participants from a list who might have duplicate
names.

As a workaround for this particular situation, if I created a hidden value
field on the case that was a concatenation of Name and
Vodacome_Phone_Number and referenced this field in the XForm, would this be
a viable workaround?

Thanks,
Lexa

On Thursday, June 2, 2016 at 6:14:06 PM UTC+2, Clayton Sims wrote:

Hi Lexa,

I think I must have been mistaken with my original comment, apologies.

The XForm specification unfortunately does not permit an arbitrary
expression in the "label" field, the spec is restricted to only allowing a
path expression in that field. This is a constraint we are looking to work
around, but haven't settled on an extension for which will let people use
more complex expressions with itemsets, but also retain form compatibility.

-Clayton

On Thu, May 26, 2016 at 11:10 AM, le...@verasolutions.org wrote:

Hi Will,

Thanks for your reply, Will. I can confirm that Vodacom_Phone_Number is
a case property. I thought that maybe because Vodacom_Phone_Number is a
case property of format = Phone, that was one of the reasons it wasn't
working. I changed it to "Plain" format, but still received the same error.

I don't understand the second part of your response: Why does the
concatenated expression need to evaluate to another case property? I'm
simply trying to concatenate two case properties (name + phone number) from
a case to display as a label in a checkbox lookup table that references a
list of cases (see below). We want the table to display name as well as
phone to make it as easy as possible for the mobile worker to identify the
correct participant. I'm not sure how I'll use an output value to debug the
statement, since the form is under a module that references a different
case_type than the one in this list.

This is the expression that I'm working with. It displays a list of
cases in a mutli-select list:

* * ** * *

Thanks!
Lexa

On Friday, May 20, 2016 at 4:09:19 PM UTC+2, William Pride wrote:

Hi Lexa,

Can you confirm that Vodacom_Phone_Number is a case property and that
if properly evaluated that expression will evaluate to another case
property?

It can be helpful to debug statements like this with an output value
https://confluence.dimagi.com/display/commcarepublic/Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output in
a label.

Thanks,
Will

On Thu, May 19, 2016 at 3:11 PM, le...@verasolutions.org wrote:

Vodacom_Phone_Number

--
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.

--
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-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi all,

Another question regarding the feature of populating multiple choice
questions with cases as choices. Is it possible to sort the values that
populate? Right now, all the values seem to appear in the order that the
cases were created. Is there a way to customize the sorting? Ideally we
want the names of cases to be sorted alphabetically.

Thanks!
Lexa

··· On Monday, June 6, 2016 at 3:29:24 PM UTC+2, William Pride wrote: > > Hi Lexa, > > Yes, saving the concatenated fields as a case property and referencing > this would work correctly. > > Best, > Will > > On Mon, Jun 6, 2016 at 5:53 AM, <le...@verasolutions.org > wrote: > >> Hi Clayton, >> >> Thanks for your reply. This would be a really helpful feature, especially >> when trying to identify participants from a list who might have duplicate >> names. >> >> As a workaround for this particular situation, if I created a hidden >> value field on the case that was a concatenation of Name and >> Vodacome_Phone_Number and referenced this field in the XForm, would this be >> a viable workaround? >> >> Thanks, >> Lexa >> >> On Thursday, June 2, 2016 at 6:14:06 PM UTC+2, Clayton Sims wrote: >>> >>> Hi Lexa, >>> >>> I think I must have been mistaken with my original comment, apologies. >>> >>> The XForm specification unfortunately does not permit an arbitrary >>> expression in the "label" field, the spec is restricted to only allowing a >>> path expression in that field. This is a constraint we are looking to work >>> around, but haven't settled on an extension for which will let people use >>> more complex expressions with itemsets, but also retain form compatibility. >>> >>> -Clayton >>> >>> On Thu, May 26, 2016 at 11:10 AM, wrote: >>> >>>> Hi Will, >>>> >>>> Thanks for your reply, Will. I can confirm that Vodacom_Phone_Number is >>>> a case property. I thought that maybe because Vodacom_Phone_Number is a >>>> case property of format = Phone, that was one of the reasons it wasn't >>>> working. I changed it to "Plain" format, but still received the same error. >>>> >>>> I don't understand the second part of your response: Why does the >>>> concatenated expression need to evaluate to another case property? I'm >>>> simply trying to concatenate two case properties (name + phone number) from >>>> a case to display as a label in a checkbox lookup table that references a >>>> list of cases (see below). We want the table to display name as well as >>>> phone to make it as easy as possible for the mobile worker to identify the >>>> correct participant. I'm not sure how I'll use an output value to debug the >>>> statement, since the form is under a module that references a different >>>> case_type than the one in this list. >>>> >>>> This is the expression that I'm working with. It displays a list of >>>> cases in a mutli-select list: >>>> >>>> >>>> >>>> * >>> nodeset="instance('casedb')/casedb/case[@case_type='Participant']">* >>>> >>>> ** >>>> * * >>>> >>>> >>>> Thanks! >>>> Lexa >>>> >>>> On Friday, May 20, 2016 at 4:09:19 PM UTC+2, William Pride wrote: >>>>> >>>>> >>>>> Hi Lexa, >>>>> >>>>> Can you confirm that Vodacom_Phone_Number is a case property and that >>>>> if properly evaluated that expression will evaluate to another case >>>>> property? >>>>> >>>>> It can be helpful to debug statements like this with an output value >>>>> in >>>>> a label. >>>>> >>>>> Thanks, >>>>> Will >>>>> >>>>> On Thu, May 19, 2016 at 3:11 PM, wrote: >>>>> >>>>>> Vodacom_Phone_Number >>>>> >>>>> >>>>> >>>>> -- >>>> 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. >>>> >>> >>> -- >> 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. >> > >

Hi William and Clayton,

I wanted to nudge on Lexa's question. Is it possible in any way to sort the
case_ids in the lookup table?

Thanks,
Jesse

··· On Wednesday, June 15, 2016 at 1:07:15 PM UTC+2, le...@verasolutions.org wrote: > > Hi all, > > Another question regarding the feature of populating multiple choice > questions with cases as choices. Is it possible to sort the values that > populate? Right now, all the values seem to appear in the order that the > cases were created. Is there a way to customize the sorting? Ideally we > want the names of cases to be sorted alphabetically. > > Thanks! > Lexa > > On Monday, June 6, 2016 at 3:29:24 PM UTC+2, William Pride wrote: >> >> Hi Lexa, >> >> Yes, saving the concatenated fields as a case property and referencing >> this would work correctly. >> >> Best, >> Will >> >> On Mon, Jun 6, 2016 at 5:53 AM, wrote: >> >>> Hi Clayton, >>> >>> Thanks for your reply. This would be a really helpful feature, >>> especially when trying to identify participants from a list who might have >>> duplicate names. >>> >>> As a workaround for this particular situation, if I created a hidden >>> value field on the case that was a concatenation of Name and >>> Vodacome_Phone_Number and referenced this field in the XForm, would this be >>> a viable workaround? >>> >>> Thanks, >>> Lexa >>> >>> On Thursday, June 2, 2016 at 6:14:06 PM UTC+2, Clayton Sims wrote: >>>> >>>> Hi Lexa, >>>> >>>> I think I must have been mistaken with my original comment, apologies. >>>> >>>> The XForm specification unfortunately does not permit an arbitrary >>>> expression in the "label" field, the spec is restricted to only allowing a >>>> path expression in that field. This is a constraint we are looking to work >>>> around, but haven't settled on an extension for which will let people use >>>> more complex expressions with itemsets, but also retain form compatibility. >>>> >>>> -Clayton >>>> >>>> On Thu, May 26, 2016 at 11:10 AM, wrote: >>>> >>>>> Hi Will, >>>>> >>>>> Thanks for your reply, Will. I can confirm that Vodacom_Phone_Number >>>>> is a case property. I thought that maybe because Vodacom_Phone_Number is a >>>>> case property of format = Phone, that was one of the reasons it wasn't >>>>> working. I changed it to "Plain" format, but still received the same error. >>>>> >>>>> I don't understand the second part of your response: Why does the >>>>> concatenated expression need to evaluate to another case property? I'm >>>>> simply trying to concatenate two case properties (name + phone number) from >>>>> a case to display as a label in a checkbox lookup table that references a >>>>> list of cases (see below). We want the table to display name as well as >>>>> phone to make it as easy as possible for the mobile worker to identify the >>>>> correct participant. I'm not sure how I'll use an output value to debug the >>>>> statement, since the form is under a module that references a different >>>>> case_type than the one in this list. >>>>> >>>>> This is the expression that I'm working with. It displays a list of >>>>> cases in a mutli-select list: >>>>> >>>>> >>>>> >>>>> * >>>> nodeset="instance('casedb')/casedb/case[@case_type='Participant']">* >>>>> >>>>> ** >>>>> * * >>>>> >>>>> >>>>> Thanks! >>>>> Lexa >>>>> >>>>> On Friday, May 20, 2016 at 4:09:19 PM UTC+2, William Pride wrote: >>>>>> >>>>>> >>>>>> Hi Lexa, >>>>>> >>>>>> Can you confirm that Vodacom_Phone_Number is a case property and that >>>>>> if properly evaluated that expression will evaluate to another case >>>>>> property? >>>>>> >>>>>> It can be helpful to debug statements like this with an output value >>>>>> in >>>>>> a label. >>>>>> >>>>>> Thanks, >>>>>> Will >>>>>> >>>>>> On Thu, May 19, 2016 at 3:11 PM, wrote: >>>>>> >>>>>>> Vodacom_Phone_Number >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>> 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. >>>>> >>>> >>>> -- >>> 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. >>> >> >>

I've just seen here
https://groups.google.com/forum/#!topic/commcare-users/fdW5nV4xYwo that
it isn't possible. Is there a particular order that it's populating in by
default?

··· On Monday, July 25, 2016 at 2:07:04 PM UTC+2, Jesse Twum-Boafo wrote: > > Hi William and Clayton, > > I wanted to nudge on Lexa's question. Is it possible in any way to sort > the case_ids in the lookup table? > > Thanks, > Jesse > > On Wednesday, June 15, 2016 at 1:07:15 PM UTC+2, le...@verasolutions.org wrote: >> >> Hi all, >> >> Another question regarding the feature of populating multiple choice >> questions with cases as choices. Is it possible to sort the values that >> populate? Right now, all the values seem to appear in the order that the >> cases were created. Is there a way to customize the sorting? Ideally we >> want the names of cases to be sorted alphabetically. >> >> Thanks! >> Lexa >> >> On Monday, June 6, 2016 at 3:29:24 PM UTC+2, William Pride wrote: >>> >>> Hi Lexa, >>> >>> Yes, saving the concatenated fields as a case property and referencing >>> this would work correctly. >>> >>> Best, >>> Will >>> >>> On Mon, Jun 6, 2016 at 5:53 AM, wrote: >>> >>>> Hi Clayton, >>>> >>>> Thanks for your reply. This would be a really helpful feature, >>>> especially when trying to identify participants from a list who might have >>>> duplicate names. >>>> >>>> As a workaround for this particular situation, if I created a hidden >>>> value field on the case that was a concatenation of Name and >>>> Vodacome_Phone_Number and referenced this field in the XForm, would this be >>>> a viable workaround? >>>> >>>> Thanks, >>>> Lexa >>>> >>>> On Thursday, June 2, 2016 at 6:14:06 PM UTC+2, Clayton Sims wrote: >>>>> >>>>> Hi Lexa, >>>>> >>>>> I think I must have been mistaken with my original comment, apologies. >>>>> >>>>> The XForm specification unfortunately does not permit an arbitrary >>>>> expression in the "label" field, the spec is restricted to only allowing a >>>>> path expression in that field. This is a constraint we are looking to work >>>>> around, but haven't settled on an extension for which will let people use >>>>> more complex expressions with itemsets, but also retain form compatibility. >>>>> >>>>> -Clayton >>>>> >>>>> On Thu, May 26, 2016 at 11:10 AM, wrote: >>>>> >>>>>> Hi Will, >>>>>> >>>>>> Thanks for your reply, Will. I can confirm that Vodacom_Phone_Number >>>>>> is a case property. I thought that maybe because Vodacom_Phone_Number is a >>>>>> case property of format = Phone, that was one of the reasons it wasn't >>>>>> working. I changed it to "Plain" format, but still received the same error. >>>>>> >>>>>> I don't understand the second part of your response: Why does the >>>>>> concatenated expression need to evaluate to another case property? I'm >>>>>> simply trying to concatenate two case properties (name + phone number) from >>>>>> a case to display as a label in a checkbox lookup table that references a >>>>>> list of cases (see below). We want the table to display name as well as >>>>>> phone to make it as easy as possible for the mobile worker to identify the >>>>>> correct participant. I'm not sure how I'll use an output value to debug the >>>>>> statement, since the form is under a module that references a different >>>>>> case_type than the one in this list. >>>>>> >>>>>> This is the expression that I'm working with. It displays a list of >>>>>> cases in a mutli-select list: >>>>>> >>>>>> >>>>>> >>>>>> * >>>>> nodeset="instance('casedb')/casedb/case[@case_type='Participant']">* >>>>>> >>>>>> ** >>>>>> * * >>>>>> >>>>>> >>>>>> Thanks! >>>>>> Lexa >>>>>> >>>>>> On Friday, May 20, 2016 at 4:09:19 PM UTC+2, William Pride wrote: >>>>>>> >>>>>>> >>>>>>> Hi Lexa, >>>>>>> >>>>>>> Can you confirm that Vodacom_Phone_Number is a case property and >>>>>>> that if properly evaluated that expression will evaluate to another case >>>>>>> property? >>>>>>> >>>>>>> It can be helpful to debug statements like this with an output value >>>>>>> in >>>>>>> a label. >>>>>>> >>>>>>> Thanks, >>>>>>> Will >>>>>>> >>>>>>> On Thu, May 19, 2016 at 3:11 PM, wrote: >>>>>>> >>>>>>>> Vodacom_Phone_Number >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>> 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. >>>>>> >>>>> >>>>> -- >>>> 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. >>>> >>> >>>

Jesse,

I believe it's not intentional or well-defined, but I think the default
would be to return the records in the order that they come out of the
database, which in this case would be roughly correlated with when the
cases are created the first time and have an ID assigned.

-Clayton

··· On Mon, Jul 25, 2016 at 8:13 AM, Jesse Twum-Boafo wrote:

I've just seen here
https://groups.google.com/forum/#!topic/commcare-users/fdW5nV4xYwo that
it isn't possible. Is there a particular order that it's populating in by
default?

On Monday, July 25, 2016 at 2:07:04 PM UTC+2, Jesse Twum-Boafo wrote:

Hi William and Clayton,

I wanted to nudge on Lexa's question. Is it possible in any way to sort
the case_ids in the lookup table?

Thanks,
Jesse

On Wednesday, June 15, 2016 at 1:07:15 PM UTC+2, le...@verasolutions.org wrote:

Hi all,

Another question regarding the feature of populating multiple choice
questions with cases as choices. Is it possible to sort the values that
populate? Right now, all the values seem to appear in the order that the
cases were created. Is there a way to customize the sorting? Ideally we
want the names of cases to be sorted alphabetically.

Thanks!
Lexa

On Monday, June 6, 2016 at 3:29:24 PM UTC+2, William Pride wrote:

Hi Lexa,

Yes, saving the concatenated fields as a case property and referencing
this would work correctly.

Best,
Will

On Mon, Jun 6, 2016 at 5:53 AM, le...@verasolutions.org wrote:

Hi Clayton,

Thanks for your reply. This would be a really helpful feature,
especially when trying to identify participants from a list who might have
duplicate names.

As a workaround for this particular situation, if I created a hidden
value field on the case that was a concatenation of Name and
Vodacome_Phone_Number and referenced this field in the XForm, would this be
a viable workaround?

Thanks,
Lexa

On Thursday, June 2, 2016 at 6:14:06 PM UTC+2, Clayton Sims wrote:

Hi Lexa,

I think I must have been mistaken with my original comment, apologies.

The XForm specification unfortunately does not permit an arbitrary
expression in the "label" field, the spec is restricted to only allowing a
path expression in that field. This is a constraint we are looking to work
around, but haven't settled on an extension for which will let people use
more complex expressions with itemsets, but also retain form compatibility.

-Clayton

On Thu, May 26, 2016 at 11:10 AM, le...@verasolutions.org wrote:

Hi Will,

Thanks for your reply, Will. I can confirm that Vodacom_Phone_Number
is a case property. I thought that maybe because Vodacom_Phone_Number is a
case property of format = Phone, that was one of the reasons it wasn't
working. I changed it to "Plain" format, but still received the same error.

I don't understand the second part of your response: Why does the
concatenated expression need to evaluate to another case property? I'm
simply trying to concatenate two case properties (name + phone number) from
a case to display as a label in a checkbox lookup table that references a
list of cases (see below). We want the table to display name as well as
phone to make it as easy as possible for the mobile worker to identify the
correct participant. I'm not sure how I'll use an output value to debug the
statement, since the form is under a module that references a different
case_type than the one in this list.

This is the expression that I'm working with. It displays a list of
cases in a mutli-select list:

* * ** * *

Thanks!
Lexa

On Friday, May 20, 2016 at 4:09:19 PM UTC+2, William Pride wrote:

Hi Lexa,

Can you confirm that Vodacom_Phone_Number is a case property and
that if properly evaluated that expression will evaluate to another case
property?

It can be helpful to debug statements like this with an output
value
https://confluence.dimagi.com/display/commcarepublic/Hidden+Values+Tutorial+Part+4%3A+Displaying+an+Output in
a label.

Thanks,
Will

On Thu, May 19, 2016 at 3:11 PM, le...@verasolutions.org wrote:

Vodacom_Phone_Number

--
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.

--
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.

--
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-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.