# Set a hidden field value based on values selected in another field

**URL:** <https://community.gravityforms.com/t/set-a-hidden-field-value-based-on-values-selected-in-another-field/5361>\
**Category:** Get Help\
**Tags:** gravity-wiz\
**Created:** [July 9, 2020, 5:52pm UTC](https://community.gravityforms.com/t/set-a-hidden-field-value-based-on-values-selected-in-another-field/5361 "2020-07-09T17:52:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5d1bae172f85a841](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user5d1bae172f85a841](https://community.gravityforms.com/u/user5d1bae172f85a841)\
**Post date:** [July 9, 2020, 5:52pm UTC](https://community.gravityforms.com/t/set-a-hidden-field-value-based-on-values-selected-in-another-field/5361/1 "2020-07-09T17:52:41Z")

</div>

I am trying to populate a hidden number field (4 digit budget code) to pass it along to Stripe in a transaction. I cannot figure out how to set this 4 digit code based on the product that is selected on that form. i.e Product 1 and product 2 might be budget code 1000. Product 3 is budget code 1050. Product 4 through 6 are budget code 1175.

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [July 9, 2020, 8:20pm UTC](https://community.gravityforms.com/t/set-a-hidden-field-value-based-on-values-selected-in-another-field/5361/2 "2020-07-09T20:20:45Z")

</div>

If you have just a few possibilities, you can configure fields to be shown (or hidden) based on the product that is selected. If you have more than a couple, then configuring conditional logic to do this will be extremely time-consuming. I recommend taking a look at this plugin to help with your task:

> **[Gravity Forms Populate Anything - Gravity Wiz](https://gravitywiz.com/documentation/gravity-forms-populate-anything/)**
>
> Dynamically filter and populate field choices and values with posts, users, taxonomies, terms, Gravity Forms entries, and databases. Pretty much anything!

---

<div class="post-metadata">

**Author:** ![user5d1bae172f85a841](https://avatars.discourse-cdn.com/v4/letter/u/eada6e/32.png) [@user5d1bae172f85a841](https://community.gravityforms.com/u/user5d1bae172f85a841)\
**Post date:** [July 9, 2020, 9:18pm UTC](https://community.gravityforms.com/t/set-a-hidden-field-value-based-on-values-selected-in-another-field/5361/3 "2020-07-09T21:18:54Z")

</div>

OK I will look at it again. We are already licensed for it. I wish the documentation made more sense to me. Thank you!

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [July 10, 2020, 2:58am UTC](https://community.gravityforms.com/t/set-a-hidden-field-value-based-on-values-selected-in-another-field/5361/4 "2020-07-10T02:58:25Z")

</div>

I had trouble setting it up the first time as well! You can reach out the Gravity Wiz support. They’re great and I’m certain they can help you.

---

<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 4, 2022, 6:01pm UTC](https://community.gravityforms.com/t/set-a-hidden-field-value-based-on-values-selected-in-another-field/5361/5 "2022-01-04T18:01:38Z")

</div>


