Display Text in choice value

Hello, Could you please give me a hand ? I would like to display Text in choice value from lookuptable (eg: Clinic name : Kyoe Win, not kyoe_win). Thank you.

I write " jr:itext(concat('area_name-', /data/area_name, '-label'))" , but is not working.

this code works in a hidden calculation inside the form but will not work anywhere else in the commcare app.
you want to store that value in a property and pull it in the details screen

Dear Mazz,
Thank you for your suggestion. But, the value does not show in the details screen also like in ss photo. What would be this issue?

Screenshot 2024-03-01 161532

if you just added the case property, it won't have a value for the old cases - the calculation needs to run at data entry and then save the value as a property

so, try registering a new case and see if it's working.

for troubleshooting, to make sure that the calculation is throwing the right value, you can put it in a label question and see interactively that the values being returned are what you expect

Dear Mazz,
As you suggest, I tried with label whether the calculation is working, but unfortunately the value shows "itext:clinic_name-kyoe_wine-label". When I tried the formula for choice value which is not a question in lookuptable, it works.

Does it mean that I wrote the wrong path for lookuptable? If so, could you please tell me how to see the full path for lookuptable.Thank you.

oh
yeah
lookup tables. I did not realize you were using lookup type multiple choice questions. this formula will NOT work for lookup table types.

why?

the code your have looks for the value based on the display text id.

These do not get generated for lookup table type questions because it's dynamic. it can change based on the data in the lookup table. this means that it uses a slightly different internal structure.

so what do you do?

follow the instructions on this post

Dear Mazz,
I got it now, and thank you so much.

1 Like

If you are using the Organizations feature and are comfortable with custom expressions, you can also use the Custom Calculations in Case List add-on to resolve the location name directly

Dears,
I got choice value display text in single value.
for example,
jr:itext(concat('attendance_by_anc-', #form/attendance_by_anc, '-label'))
However, it does not work for multiple choice values.
Could you please guide me how to get display text for multiple choice values? Thank you.