Display multiple choice "display text" in a label

Hi. Does anyone know if it is possible to use the display text of the
multiple choice question (case property) in a label? For example, if I have
First Name, Last Name, State saved as properties, and I want to display it
in a label like this:

John Doe resident of the state of New York

I would

concat( #case/first_name, " ", #case/last_name, " resident of the state
of ", #case/state)

But the result would be: John Doe resident of the state of new_york

Can I somehow display the label instead?

Thanks

Hi Gio,
I am not too sure if I got you right but what I would do is to use a Label
question and then drag the case properties onto it. Thus, you will have
something like:
is a resident of . With this you will
have something like “John Doe is a resident of New York”

You can use the concat function to merge the name into a Hidden Value also
and then use it on the label.

Hope this helps.
Yaw

··· On 22 Apr 2017 20:19, "Gio" wrote:

Hi. Does anyone know if it is possible to use the display text of the
multiple choice question (case property) in a label? For example, if I have
First Name, Last Name, State saved as properties, and I want to display it
in a label like this:

John Doe resident of the state of New York

I would

concat( #case/first_name, " ", #case/last_name, " resident of the state
of ", #case/state)

But the result would be: John Doe resident of the state of new_york

Can I somehow display the label instead?

Thanks


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 Yaw, that actually doesn’t work because when you use property, it just
outputs key values, e.g. new_york, not the actual label New York. This just
is not good formating if you want to concatenate many variables into easily
readable sentence.

··· On Saturday, April 22, 2017 at 11:19:57 PM UTC+3, Gio wrote: > > Hi. Does anyone know if it is possible to use the display text of the > multiple choice question (case property) in a label? For example, if I have > First Name, Last Name, State saved as properties, and I want to display it > in a label like this: > > John Doe resident of the state of New York > > I would > > concat( #case/first_name, " ", #case/last_name, " resident of the state > of ", #case/state) > > But the result would be: John Doe resident of the state of new_york > > Can I somehow display the label instead? > > Thanks >

Gio,

One workflow for this is involves using lookup tables
https://confluence.dimagi.com/display/commcarepublic/Using+Lookup+Tables+with+Multiple+Languages
to
map between the property key and the display text, then using an XPath
expression that looks up the correct value to display given the property
input.

Cheers,
Will

··· On Sun, Apr 23, 2017 at 10:31 PM, Gio wrote:

Hi Yaw, that actually doesn’t work because when you use property, it just
outputs key values, e.g. new_york, not the actual label New York. This just
is not good formating if you want to concatenate many variables into easily
readable sentence.

On Saturday, April 22, 2017 at 11:19:57 PM UTC+3, Gio wrote:

Hi. Does anyone know if it is possible to use the display text of the
multiple choice question (case property) in a label? For example, if I have
First Name, Last Name, State saved as properties, and I want to display it
in a label like this:

John Doe resident of the state of New York

I would

concat( #case/first_name, " ", #case/last_name, " resident of the state
of ", #case/state)

But the result would be: John Doe resident of the state of new_york

Can I somehow display the label instead?

Thanks


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.