# Check Field Entry against Database or File Contents

**URL:** <https://community.gravityforms.com/t/check-field-entry-against-database-or-file-contents/8999>\
**Category:** Get Help\
**Tags:** gform\_field\_validation, gravity-wiz, gravity-flow, gform\_validation\
**Created:** [May 5, 2021, 10:13am UTC](https://community.gravityforms.com/t/check-field-entry-against-database-or-file-contents/8999 "2021-05-05T10:13:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerothehero](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/zerothehero/32/2904_2.png) [@zerothehero](https://community.gravityforms.com/u/zerothehero)\
**Post date:** [May 5, 2021, 10:13am UTC](https://community.gravityforms.com/t/check-field-entry-against-database-or-file-contents/8999/1 "2021-05-05T10:13:38Z")

</div>

Hello - I’m hoping someone can point me in the right direction with regards to a problem I am trying to solve.

Is it possible to have a Gravity Form which takes a field entry (such as a number), which upon submission checks to see if the number exists in a specified local database or file and then either populates the 2nd page of the form with the matching retrieved details for the record number or displays an error message?

I think this could be achieved using the gform\_validation hook but I don’t have a clue where to start ☹

So I’d be really grateful for any help or pointers if possible please.

---

<div class="post-metadata">

**Author:** ![JamieO](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/jamieo/32/2521_2.png) [@JamieO](https://community.gravityforms.com/u/JamieO)\
**Post date:** [May 8, 2021, 4:08pm UTC](https://community.gravityforms.com/t/check-field-entry-against-database-or-file-contents/8999/2 "2021-05-08T16:08:41Z")

</div>

Hello,

The gform\_validation hook would be useful to confirm that the number does/not exist within the local database/file - i.e. to present a validation error to user when the value doesn’t exist. If you want to store values into the entry from that db/file you would want to use [gform\_pre\_submission](https://docs.gravityforms.com/gform_pre_submission/) which docs page shows some examples of updating the $\_POST values.

Depending on your use case, and how much data is being presented on different pages of the form, you might consider using [Gravity Flow and its’ user input step type to break apart the form into discrete tasks](https://docs.gravityflow.io/article/23-configuring-user-input-step) for the user:

- Provide order number + contact info as initial form submission with low engagement barrier
- User Input step to review/edit the retrieved order details
- [Approval step](https://docs.gravityflow.io/article/22-approval-process) to confirm they want to update/place new order

Regards,  
Jamie

---

<div class="post-metadata">

**Author:** ![zerothehero](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/zerothehero/32/2904_2.png) [@zerothehero](https://community.gravityforms.com/u/zerothehero)\
**Post date:** [May 10, 2021, 8:35am UTC](https://community.gravityforms.com/t/check-field-entry-against-database-or-file-contents/8999/3 "2021-05-10T08:35:01Z")

</div>

Hello Jamie,

Many thanks for answering my question and for the guidance.

I will take a look at what you have suggested to see if it provides the solution that I am looking for in this case.

Thanks for your help again 😀

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 5, 2022, 8:36am UTC](https://community.gravityforms.com/t/check-field-entry-against-database-or-file-contents/8999/4 "2022-01-05T08:36:36Z")

</div>


