# Using merge tags inside choices values

**URL:** <https://community.gravityforms.com/t/using-merge-tags-inside-choices-values/12212>\
**Category:** Get Help\
**Tags:** merge-tags, custom-field, embed\_post, gravity-wiz\
**Created:** [March 17, 2022, 10:41pm UTC](https://community.gravityforms.com/t/using-merge-tags-inside-choices-values/12212 "2022-03-17T22:41:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![elearningwp](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@elearningwp](https://community.gravityforms.com/u/elearningwp)\
**Post date:** [March 17, 2022, 10:41pm UTC](https://community.gravityforms.com/t/using-merge-tags-inside-choices-values/12212/1 "2022-03-17T22:41:43Z")

</div>

Hi there!

For a client’s project I’m trying to have a dropdown field with Labels and Values, and inside the values use merge tags, [specifically custom\_field](https://docs.gravityforms.com/custom-field-merge-tags/) to pull data from the post where the form is embedded.

The thing is that the custom\_field and embed\_post merge tags are not applied/replaced for the values of the dropdown.

Digging a bit in the code, seems like the method replace\_variables\_prepopulate, which does that job, is not applied to the choices (common.php → get\_select\_choices function)

Anyone has an idea if this is intentional or a defficiency, and/or if there’s any other way to have those merge tags available for a dropdown value?

Cheers!  
S

---

<div class="post-metadata">

**Author:** ![samuel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/samuel/32/2539_2.png) [@samuel](https://community.gravityforms.com/u/samuel)\
**Post date:** [March 18, 2022, 9:20am UTC](https://community.gravityforms.com/t/using-merge-tags-inside-choices-values/12212/2 "2022-03-18T09:20:15Z")

</div>

Hi Serafin,

This should be possible with our [GP Populate Anything Perk](https://gravitywiz.com/documentation/gravity-forms-populate-anything/). This will allow you to populate any field on the form with data in custom fields from the current post. This doesn’t require coding and you will be able to set it up within the form editor. If you have any questions, you can get in [touch here](https://gravitywiz.com/have-a-question-about-gravity-perks/).

Best,

---

<div class="post-metadata">

**Author:** ![elearningwp](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@elearningwp](https://community.gravityforms.com/u/elearningwp)\
**Post date:** [March 18, 2022, 1:44pm UTC](https://community.gravityforms.com/t/using-merge-tags-inside-choices-values/12212/3 "2022-03-18T13:44:38Z")

</div>

Thanks Samuel, but I don’t think installing a whole new plugin for something like this is the best approach.

It seems to me like it should be something supported by GF natively, since the core plugin provides that merge tag initially.

Cheers!

---

<div class="post-metadata">

**Author:** ![sacom](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/sacom/32/53_2.png) [@sacom](https://community.gravityforms.com/u/sacom)\
**Post date:** [March 18, 2022, 3:40pm UTC](https://community.gravityforms.com/t/using-merge-tags-inside-choices-values/12212/4 "2022-03-18T15:40:52Z")

</div>

Serafin, using merge tags to populate field values is only supported for fields having the Default Value setting. This is not the case for choice based fields like the drop down field. As you found already, adding the merge to the choice value is not going to change this.

Using the GP Populate Anything Perk would be the only ready to use solution that we’re aware of for an use case like this.

If that doesn’t fit your needs, you can create your own custom dynamic population code to get the values from your post custom field and populate the drop down choices accordingly. The following tutorial shows you how to start with a customization like this: [Dynamically Populating Drop Down, Radio Buttons or Multi-Select Fields - Gravity Forms](https://docs.gravityforms.com/dynamically-populating-drop-down-or-radio-buttons-fields/)

---

<div class="post-metadata">

**Author:** ![elearningwp](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@elearningwp](https://community.gravityforms.com/u/elearningwp)\
**Post date:** [March 21, 2022, 2:24pm UTC](https://community.gravityforms.com/t/using-merge-tags-inside-choices-values/12212/5 "2022-03-21T14:24:43Z")

</div>

Thanks for your time, Samuel.

I’ll check it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [April 20, 2022, 2:25pm UTC](https://community.gravityforms.com/t/using-merge-tags-inside-choices-values/12212/6 "2022-04-20T14:25:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
