Jump to content

Set a container field based on another field


Recommended Posts

Hello, 

(1) I have a ready set value list table with the following fields:

-ID

-Name

-Photo (Container)

(2) I would like to do the following:

when I choose field (Name) from a dropdown menu, I would like another container field (Photo) to auto populate automatically and show the photo based on the same (Name) in the value list.

any help is greatly appreciated.

Thanks

Link to post
Share on other sites

Define a relationship between the table where you select the name and the "value list table", matching on Name (or - preferably - on ID, and define your value list to use values from the ID field while showing the name).

Then place the Photo field from the "value list table" on the layout of the table where you select the name. There is no need for another container field.

 

Link to post
Share on other sites

Thank you comment,

I tried what you recommended but it is not working with me, maybe because: I am using a global table to manage my Value list, as follows:

1) I'm using a global table (GLOBALS) connected to a value list table (VL Items) where I make my value lists.

2) than I made a "VL items" Table Occurrence  and connected it to the  Main table "Main" (Main::Name) --> (VL items TO:: IDf VL items). Here I am getting my unique Value List in the "MAIN" dropdown that I need using the connected relationship with the globals.

3) Now, when I use the "Photo field" in "MAIN" layout from:

- "Globals" table --> I get unrelated table (as expected)

"VL items" Table Occurrence  --> the photo doesn't show up.

Please advise me if I missed anything, or a script is the other solution.

Thank you again.

Link to post
Share on other sites

I am afraid you have lost me somewhere on the way ...

Not sure why you need the GLOBALS table. Perhaps it's used to reduce the items appearing in the value list? If so, it's irrelevant to your question.

What is the table where you are populating the Name field by selecting from a drop-down? This table need to be related to a TO of the VL Items table by matching on the Name (or - as I suggested - by matching on the ID, provided you change your value list accordingly). Then place the Photo field from this TO onto your layout. Once you have selected an item from the drop-down, the selected item's record in the VL Items table will become related - and the container field will show the content from the related record.

 

Link to post
Share on other sites
4 hours ago, comment said:

I am afraid you have lost me somewhere on the way ...

Not sure why you need the GLOBALS table. Perhaps it's used to reduce the items appearing in the value list? If so, it's irrelevant to your question.

What is the table where you are populating the Name field by selecting from a drop-down? This table need to be related to a TO of the VL Items table by matching on the Name (or - as I suggested - by matching on the ID, provided you change your value list accordingly). Then place the Photo field from this TO onto your layout. Once you have selected an item from the drop-down, the selected item's record in the VL Items table will become related - and the container field will show the content from the related record.

 

Thank you comment, it is working great now  

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.