# Lookup table as a validation condition

**URL:** <https://forum.dimagi.com/t/lookup-table-as-a-validation-condition/8039>\
**Category:** Users\
**Created:** [February 22, 2021, 9:24am UTC](https://forum.dimagi.com/t/lookup-table-as-a-validation-condition/8039 "2021-02-22T09:24:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mustafa\_Obeid](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@Mustafa\_Obeid](https://forum.dimagi.com/u/Mustafa_Obeid)\
**Post date:** [February 22, 2021, 9:24am UTC](https://forum.dimagi.com/t/lookup-table-as-a-validation-condition/8039/1 "2021-02-22T09:24:52Z")

</div>

Dear All ,

I was trying to check if its possible to attach a .csv file with my form in order to validate the value entered by the user to check if the entered value exists in the .csv file. In XLS forms , we use the pull data function inside the constraint field which will check if the entered value by the user exists in the .csv file. I have done some research on this and understood that this could be done using "Lookup tables" but there wasn't a clear explanation on this. as an example. I want the user to enter a pin number which has 4 digits but I want the form to check if this pin number exists in the .csv file that I have.

Thanks in advance.

Best,  
Mustafa

---

<div class="post-metadata">

**Author:** ![zijunliu](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/z/85f322/32.png) [@zijunliu](https://forum.dimagi.com/u/zijunliu)\
**Post date:** [June 2, 2021, 9:16pm UTC](https://forum.dimagi.com/t/lookup-table-as-a-validation-condition/8039/2 "2021-06-02T21:16:17Z")

</div>

I wonder the same thing and hope someone can help answer it.

---

<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:** [June 2, 2021, 10:06pm UTC](https://forum.dimagi.com/t/lookup-table-as-a-validation-condition/8039/3 "2021-06-02T22:06:56Z")

</div>

The approach you are describing can definitely be accomplished via lookup tables.

Lookup tables uploaded to HQ are available to all users as an instance object, which can be queried and filtered with XPath to produce powerful workflows.

I put together a quick sample of the process [on our wiki](https://confluence.dimagi.com/display/commcarepublic/Example%3A+Basic+Lookup+Table+Querying) that should cover the basics. Let me know if you have any questions on building your workflow once you've given it a shot.

-Clayton

---

<div class="post-metadata">

**Author:** ![akwein](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@akwein](https://forum.dimagi.com/u/akwein)\
**Post date:** [July 13, 2026, 8:46pm UTC](https://forum.dimagi.com/t/lookup-table-as-a-validation-condition/8039/4 "2026-07-13T20:46:34Z")

</div>

The link to the wiki is broken

---

<div class="post-metadata">

**Author:** ![sprakash](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/sprakash/32/2716_2.png) [@sprakash](https://forum.dimagi.com/u/sprakash)\
**Post date:** [July 14, 2026, 2:37pm UTC](https://forum.dimagi.com/t/lookup-table-as-a-validation-condition/8039/5 "2026-07-14T14:37:16Z")

</div>

Hello Andy,

Here is the updated link to the [wiki](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143955074/Lookup+Tables#In-Form-Lookup-Table-Querying).

Best,  
Shiv
