Title: Nested lookups
Last modified: February 13, 2025

---

# Nested lookups

 *  Resolved [johans](https://wordpress.org/support/users/johanselbing/)
 * (@johanselbing)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/nested-lookups/)
 * I have three tables: **Locations, Products** and **Companies**. For the sake 
   of simplicity, each one has an ID and a name column, and **Products** also has
   a a column called company_ID. **Locations** and **Products** has a many-to-many
   relationship (via a join table that also includes Amount) and** Companies** and**
   Products** has a one-to-many relationship.
 * The idea of the database is that the user per **Location** can add many different**
   Products** that are being manufactured by **Companies**.
 * But, I’ve run into a problem concerning the form builder and lookups. It would
   be very handy if when a user wants to add a product to a location, also the company
   name can be seen. If I add a lookup for the Product.ID in the form builder, I
   can’t access the name of the company, only Product.company_ID and this is not
   very readable.
 * I would like a kind of ‘nested’ lookup possibility; a lookup inside another lookup.
   Or, another way of structuring the database that would make this possible.
 * Thank you for a great plugin!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Kim L](https://wordpress.org/support/users/kimmyx/)
 * (@kimmyx)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/nested-lookups/#post-18306729)
 * Hi [@johanselbing](https://wordpress.org/support/users/johanselbing/),
 * Thanks for the post and for using our plugin!
 * You should be able to add a lookup to another table on your `Product.company_ID`
   field as long as they’re in the Form Builder.
 * Could you show us a screenshot of your current setup so we can have a clear view
   of your use case?
 * You can also send us a message via [Contact | WP Data Access](https://wpdataaccess.com/contact/)
   if you want to share more details privately.
 * We’ll wait for your update!
 *  Thread Starter [johans](https://wordpress.org/support/users/johanselbing/)
 * (@johanselbing)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/nested-lookups/#post-18316827)
 * Hi Kim,
 * Thank you for the reply. I must have done something wrong specifying the many-
   to-many relationship, because when I defined it again, everything worked as expected.
 *  Plugin Contributor [Kim L](https://wordpress.org/support/users/kimmyx/)
 * (@kimmyx)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/nested-lookups/#post-18317463)
 * Hi [@johanselbing](https://wordpress.org/support/users/johanselbing/).
 * Thanks for the update. We’re glad it’s now working for you. 😊
 * Feel free to message us again if you have new questions.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Nested lookups’ is closed to new replies.

 * ![](https://ps.w.org/wp-data-access/assets/icon-256x256.png?rev=3299063)
 * [WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards](https://wordpress.org/plugins/wp-data-access/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-data-access/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-data-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-data-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-data-access/reviews/)

## Tags

 * [lookup](https://wordpress.org/support/topic-tag/lookup/)

 * 3 replies
 * 2 participants
 * Last reply from: [Kim L](https://wordpress.org/support/users/kimmyx/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/nested-lookups/#post-18317463)
 * Status: resolved