Title: Custom Query Prepopulation: SELECT CASE
Last modified: February 4, 2019

---

# Custom Query Prepopulation: SELECT CASE

 *  Resolved [a608237](https://wordpress.org/support/users/a608237/)
 * (@a608237)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/custom-query-prepopulation-select-case/)
 * I am trying to get a dropdown field to dynamically prepopulate options using 
   different queries depending on the value of another field (fieldname7).
 * I was able to get CFF to return simple text values ala:
 * SELECT CASE WHEN (<%fieldname7%> = 1) THEN (“YES”) ELSE (“NO”) END as text
 * I want to replace the “YES” and the “NO” with a select query instead, like SELECT
   name FROM employees;, but doing this substitution yields blank. Similar queries
   not based on fieldnames work directly in mysql.

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/custom-query-prepopulation-select-case/#post-11164673)
 * Hello [@a608237](https://wordpress.org/support/users/a608237/)
 * If the query works in mysql, it works with the plugin too, because the plugin
   simply replaces the special tag `<%fieldname7%>` with the corresponding field’s
   value, and runs the query. If you need additional support about features in the
   Developer version of the plugin, you should contact me from my private website:
 * [https://cff.dwbooster.com/contact-us](https://cff.dwbooster.com/contact-us)
 * Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Custom Query Prepopulation: SELECT CASE’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

## Tags

 * [custom-query](https://wordpress.org/support/topic-tag/custom-query/)
 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/custom-query-prepopulation-select-case/#post-11164673)
 * Status: resolved