# How To Reference Lookup Table Value In a Hidden Value

**URL:** <https://forum.dimagi.com/t/how-to-reference-lookup-table-value-in-a-hidden-value/8445>\
**Category:** Users\
**Created:** [September 21, 2021, 10:31am UTC](https://forum.dimagi.com/t/how-to-reference-lookup-table-value-in-a-hidden-value/8445 "2021-09-21T10:31:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JZUser95](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/j/71c47a/32.png) [@JZUser95](https://forum.dimagi.com/u/JZUser95)\
**Post date:** [September 21, 2021, 10:31am UTC](https://forum.dimagi.com/t/how-to-reference-lookup-table-value-in-a-hidden-value/8445/1 "2021-09-21T10:31:41Z")

</div>

Hi! I am trying to reference a value from a column in a lookup table using a hidden value. In other words, for this lookup table, if a user enters a certain ID, the hidden value would pull the corresponding value from that column. In this scenario, I'm trying to pull the value for outcome. Here are the details of my lookup table:

 ![lookup](https://dimagi.b-cdn.net/uploads/default/original/2X/5/5a07c4d1008249d71cb57465569fbf9efc1a7b2f.png)

Any advice?

---

<div class="post-metadata">

**Author:** ![Clayton\_Sims](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/clayton_sims/32/496_2.png) [@Clayton\_Sims](https://forum.dimagi.com/u/Clayton_Sims)\
**Post date:** [September 21, 2021, 1:03pm UTC](https://forum.dimagi.com/t/how-to-reference-lookup-table-value-in-a-hidden-value/8445/2 "2021-09-21T13:03:01Z")

</div>

Hi,

There's some documentation about reference lookup tables in your forms on [this wiki page](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143955074/Lookup+Tables#In-Form-Lookup-Table-Querying) that should cover how to construct this query.

I think in your case it would be something like

```auto
instance('item-list:missingrace')/missingrace_list/missingrace[id= #form/user_entered_id]/VALUE_FIELD

```

---

<div class="post-metadata">

**Author:** ![JZUser95](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/j/71c47a/32.png) [@JZUser95](https://forum.dimagi.com/u/JZUser95)\
**Post date:** [September 24, 2021, 5:28am UTC](https://forum.dimagi.com/t/how-to-reference-lookup-table-value-in-a-hidden-value/8445/3 "2021-09-24T05:28:13Z")

</div>

> [@Clayton\_Sims](#):
>
> `instance('item-list:missingrace')/missingrace_list/missingrace[id= #form/user_entered_id]/VALUE_FIELD`

Thanks so much @Clayton_Sims ! I had actually used similar syntax and could not seem to get it to work at the time. I think I might have just missed something, perhaps the brackets around id. It works now!

---

<div class="post-metadata">

**Author:** ![Ali\_Agha](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/a/ecae2f/32.png) [@Ali\_Agha](https://forum.dimagi.com/u/Ali_Agha)\
**Post date:** [October 23, 2024, 11:24am UTC](https://forum.dimagi.com/t/how-to-reference-lookup-table-value-in-a-hidden-value/8445/4 "2024-10-23T11:24:48Z")

</div>

Hi  
I hope you are well  
Please can you explain to me the parameters of this equation  
And what should I replace with my data to make it work  
The existing link that you posted is not working  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![Aashima1](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/aashima1/32/2688_2.png) [@Aashima1](https://forum.dimagi.com/u/Aashima1)\
**Post date:** [October 28, 2024, 8:24am UTC](https://forum.dimagi.com/t/how-to-reference-lookup-table-value-in-a-hidden-value/8445/5 "2024-10-28T08:24:47Z")

</div>

Hello Ali,

Please find the explanation of each part of the equation:

`**instance('item-list:missingrace')**` : This is referencing a **lookup table named**'missingrace'. You should replace 'missingrace' with the **name of your lookup table**.

- ` **/missingrace_list/missingrace** ` : This is the **path to the data in the lookup table**. Typically, this follows the format of ` **/{table_name}_list/{table_name}** `. You should replace both instances of 'missingrace' with your table name.

- `**[id= #form/user_entered_id]**` : This is a condition that filters the data from the lookup table. It's looking for a **row in the table where the 'id' matches the value entered by the user in the 'user\_entered\_id' field of the form**. If your table uses a different field name for the id, or if the form field where the user enters the id is different, you should replace those parts accordingly.

- ` **/VALUE_FIELD** ` : This is the **field from the lookup table that you want to retrieve**. You should replace 'VALUE\_FIELD' with the name of the field you want to retrieve from your lookup table.

Could you clarify what happens when you try to access the link? Are you seeing any error messages? I just checked it, and it seems to be working fine on my end.
