How can I display info from a lookup/relation in a form?

Hi, we are working on a form to entry information of the production line and also display information about the a product that is being under production for the benefit of the user that is entering the information in the form. So for example I have a “products” table with all the details of the production of each product (key) an a form table. I’ve created a form with a choice column that is linked to the “form” table and I have relations and lookups from the “products” table. Now if the user selects product A from the choice column of the form I need that some columns of the form autopopulate from the information that is listed in the products table. Is that possible in glide? Hope I was clear since is my first post thanks

Hi @Glideargext,

Welcome to the community :partying_face:

So you have a Products Table and a Forms Table. And then in your form that creates records in the forms table you have a choice component to select the product for that record and after creating you need to get that added product’s other details to the Forms table. Correct?

Thank you

Hi Dilon, thanks for the quick reply! Yes, basically the user selects the product in the form through the choice component. Once selected I need that some columns of the products table autopopulate to the form so the user can see for example suggested temperature and specific details of “X” product. Then the user knows if he needs to increase o decrease the temperature of the production line and also introduce the actual temperature once produced but for the actual temperatue for example I have an specific column in the form as a data entry field so once the form is submitted we can make our analysis. That’s a quick example

Hola

Unfortunately, the relations don’t work in a native form, I have suffered that pain/feeling before :innocent:

Your plan B is create a custom form, this thread can help you better (another $1 for Darren :rofl:) How do I create a custom form?

Saludos!

1 Like

Gustavo you beat me! :sweat_smile:

@Glideargext what Gustavo mentioned! :muscle: When you add the text property the lookup is not available. But one idea if you use the form screen is use a inline list and connect that to the products table and filter that by the screen value? :eyes:

1 Like

Thank you guys! I’ll try that. And based on your experience, is there any other app that can perform this relations in a native form? thanks again for the help!

As far as I know, not @Glideargext

The Choice component has the same problem if you try to use it with a relation inside a form.

The good news is that custom forms can give more options and freedom to do complex things if you want.

Bye!

HI @Glideargext,

the way I do it is via the users table. So lets say you want to choose a product for a production line that you just create through a form screen. The product would be added by adding the unique id of the product to a certain coloumn let’s say called “selected product id coloumn” in the production line table. That Id is filled by a choice component as you described.

So what you do here is directing the target of the choice component (currently called “value” in the “content section” of the choice component) to a text field in your users table, let’s say called “selected product id”. In the users table you create a relation from that “selected product id” to your product table. Then you create lookups for all the desired information you would like to show in the form screen e.g. the name and product category.
Now when you are in the form screen you can display all the information from the selected product in your users table right after selected it even in an unsubmitted form screen.
Finally you use the component “selected product id” from the section “values from user profile” and select the coloumn in the production line table where the final unique id of the selected product belongs. In our example the coloumn “selected product id coloumn”. That way the Id will be transferred there automatically after submitting the form.

Please let me know if you have further questions.

1 Like