Continuing the discussion from Prepopulating a select field on a form embedded by function call :
I am running into this issue as well. You’d say it’s possible to pre-populate a dropdown with the gravity_form()-function, since the dropdown has the option te be pre-populated. But documentation is missing.
sacom
(Samuel Aguilera (Gravity Forms))
October 25, 2021, 2:38pm
2
You can’t pre-populate a drop down field using the gravity_form() function, using this you can only pre-select existing choices of your drop down.
If you want to pre-populate the drop down you need to use a different approach:
First ensure that your field is already configured to accept dynamic population: Dynamically Populating a Field - Gravity Forms Documentation
The following tutorial describes a full working example: Dynamically Populating Drop Down, Radio Buttons or Multi-Select Fields - Gravity Forms
Here’s another example: gform_pre_render - Gravity Forms Documentation
2 Likes
Yeah, I’m sorry. I totally messed things up in my head and already found out (again) that I needed to use a filter.