# Display response for Checkbox Lookup Table

**URL:** <https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789>\
**Category:** Users\
**Created:** [April 27, 2023, 2:51pm UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789 "2023-04-27T14:51:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![segadu](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/segadu/32/2202_2.png) [@segadu](https://forum.dimagi.com/u/segadu)\
**Post date:** [April 27, 2023, 2:51pm UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/1 "2023-04-27T14:51:18Z")

</div>

Dear Dimagi Forum,

It is possible to do the same as we know on KoboToolBox like "Display Response for Multiple Choice" but using "Checkbox Lookup Table"?

I'm using this formula for the "Multiple Choice Lookup Table" and works perfectly, but using multiple answers not shows anything:

**Commcare formula:**

concat(instance('table\_id')/table\_list/table[name = question]/label[@lang = jr:itext('lang-code-label')], "")

**KoBo Toolbox Formula:**

jr:choice-name(selected-at(${Q2}, 0), '${Q2}')

if (jr:choice-name(selected-at(${Q2}, 1), '${Q2}') = '', '', concat('  
', jr:choice-name(selected-at(${Q2}, 1), '${Q2}')) )

if (jr:choice-name(selected-at(${Q2}, 2), '${Q2}') = '', '', concat('  
', jr:choice-name(selected-at(${Q2}, 2), '${Q2}')) )

Selected options:  
${Q2\_abc\_0} ${Q2\_abc\_1} ${Q2\_abc\_2}

Does someone know how I can resolve it?

Best regards,

---

<div class="post-metadata">

**Author:** ![Ethan\_Soergel](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/ethan_soergel/32/543_2.png) [@Ethan\_Soergel](https://forum.dimagi.com/u/Ethan_Soergel)\
**Post date:** [April 27, 2023, 4:41pm UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/2 "2023-04-27T16:41:51Z")

</div>

`concat` joins the arguments together, so that function you have above joins a string with the empty string, which doesn't do anything.

Does the expression you have above work if only one option is selected? The reason it doesn't work is because of the `[name = question]` filter. That will only match entries in the lookup table whose name is the stored value of the question, but if multiple entries are selected, the stored value will be a space-separated list. I think instead you could do something like this

`join(", ", instance('table_id')/table_list/table[selected(question, name)]/label[@lang = jr:itext('lang-code-label')])`

[`join`](https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-join) will combine multiple values into one, and the first argument is a separator - here I'm using a command and space, but you could use anything.  
[`selected(question, name)`](https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-Multi-SelectHelperFunctions) checks whether `name` is among the values selected in `question`.

---

<div class="post-metadata">

**Author:** ![segadu](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/segadu/32/2202_2.png) [@segadu](https://forum.dimagi.com/u/segadu)\
**Post date:** [April 27, 2023, 6:37pm UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/3 "2023-04-27T18:37:50Z")

</div>

Great! Works perfect! 🙂

Thank you so much @Ethan_Soergel for your valuable support! 👍

---

<div class="post-metadata">

**Author:** ![segadu](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/segadu/32/2202_2.png) [@segadu](https://forum.dimagi.com/u/segadu)\
**Post date:** [April 28, 2023, 1:42pm UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/4 "2023-04-28T13:42:05Z")

</div>

Dear @Ethan_Soergel

It is possible to show the "display label" or name (as Commcare is) of the previously selected question in the property case list?

When I call the "hidden value" in the property case doesn't show anything:

 ![40769b22a51faaeb605f6e036813f85ba6dfc1d6](https://dimagi.b-cdn.net/uploads/default/original/2X/2/2cc42043ed9b2bdd372db13be0f165bd9b555c1a.png)

Best regards,

---

<div class="post-metadata">

**Author:** ![Ethan\_Soergel](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/ethan_soergel/32/543_2.png) [@Ethan\_Soergel](https://forum.dimagi.com/u/Ethan_Soergel)\
**Post date:** [April 28, 2023, 4:38pm UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/5 "2023-04-28T16:38:13Z")

</div>

I'm not sure I follow exactly what you want to do, but you might be looking to use calculations in the case list:

[https://confluence.dimagi.com/display/commcarepublic/Calculations+in+the+Case+List+and+Details](https://confluence.dimagi.com/display/commcarepublic/Calculations+in+the+Case+List+and+Details)

---

<div class="post-metadata">

**Author:** ![segadu](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/segadu/32/2202_2.png) [@segadu](https://forum.dimagi.com/u/segadu)\
**Post date:** [April 28, 2023, 7:12pm UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/6 "2023-04-28T19:12:46Z")

</div>

Thank you @Ethan_Soergel for your response.

I'll check it! (Y)

Best regards,

---

<div class="post-metadata">

**Author:** ![segadu](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/segadu/32/2202_2.png) [@segadu](https://forum.dimagi.com/u/segadu)\
**Post date:** [June 29, 2023, 3:20pm UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/7 "2023-06-29T15:20:24Z")

</div>

Dear @Ethan_Soergel

How should this formula be calculated to show the Display Text Field ( **label3** ) properly?

**regst\_gmina\_label** : concat(instance('Gmina')/Gmina\_list/Gmina[name = #form/general\_information/regst\_gmina]/label[@lang = jr:itext('lang-code-label')], "")

These are the values that I'm using in my LookUp Table:

 ![image](https://dimagi.b-cdn.net/uploads/default/original/2X/f/f49a169f89111776f6b1950832cb73eabeae504f.png)

And this is the lookup table:

 ![image](https://dimagi.b-cdn.net/uploads/default/original/2X/0/0063372b7081f737b18c26264f8a1e0c7b0f2623.png)

 ![image](https://dimagi.b-cdn.net/uploads/default/original/2X/d/dee32fd39f7f5b6ba0ecb51ce6dbeb9a79d0c1ad.png)

Best regards,

---

<div class="post-metadata">

**Author:** ![Mazz](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/mazz/32/1004_2.png) [@Mazz](https://forum.dimagi.com/u/Mazz)\
**Post date:** [July 6, 2023, 8:48am UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/8 "2023-07-06T08:48:21Z")

</div>

Hi

follow the instructions here for setting up your lookup table correctly for more than one language.  
[https://confluence.dimagi.com/display/commcarepublic/Using+Lookup+Tables+with+Multiple+Languages](https://confluence.dimagi.com/display/commcarepublic/Using+Lookup+Tables+with+Multiple+Languages)

the code jr:itext('lang-code-label') basically is a token that grabs the current label value in the form for the question lang-code. lang-code is where Dimagi instructs you to store the codes of the different languages. these codes need to match with the field property in the lookup table

your current lookup table does not have different languages set up from what I can tell. if you are only using one language in your app, the remove this piece from your code [@lang = jr:itext('lang-code-label')]

give it a shot

---

<div class="post-metadata">

**Author:** ![segadu](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/segadu/32/2202_2.png) [@segadu](https://forum.dimagi.com/u/segadu)\
**Post date:** [July 6, 2023, 10:37am UTC](https://forum.dimagi.com/t/display-response-for-checkbox-lookup-table/9789/9 "2023-07-06T10:37:43Z")

</div>

Thank you so much for your support!

It was super useful.

Best,
