Display values from another table without VIEW

Hi Eugenio,

I have the following scenario:
TABLE "participants" with a lot of fields. One field is "employee" and it links to another table "employees" ("employee" contains the ID of the entry inside of "employees").
Another field in the table "participants" is address. My goal now is to get the address of the participant from the "employees"-table.
This should be done using the entry in the field "employee" of the "participants"-table.
But I don't want to create an individual VIEW for that. Is there another way to achieve this?

Thanks in advance!

Best wishes
Andreas

You are using DaDaBIK version 8.1-Lerici enterprise, installed on 11-12-2017 (installation code: 124685910a21b35192), the latest version of DaDaBIK is 8.2-Lerici released on 12-19-2017
You are not running the last release of DaDaBIK, the release you are running might have bugs and security holes, see the official change log for further information. You can upgrade DaDaBIK here.
PHP Version: 7.0.25
mysql version: 5.7.20
Web server: Apache/2.4.29 (Unix) PHP/7.0.25
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:59.0) Gecko/20100101 Firefox/59.0
 

eugenio

Administrator
Staff member
Hello Andreas,
I am not sure I have completely understood the question: if you need any field in a linked table (in this case employees), you just have to add the field as additional linked field in the form configurator. I am probably missing something, though, because I am not sure how the field "address" in participants is connected to the question.

Best,
 
Sorry, I think that I described it the wrong way.

Every member of the table "participants" is related to an entry in a table "companies". The relation is made by the field "company" in the table "participants". It displays the name of the related company. So for example the entry "company" of the participant would be "Test Company". Now, I would like to select the address of the related company and show it in the participants field "address" WITHOUT choosing the related company from the "companies"-table again but automatically get the address-value from the company that is related by the entry "company".
Pretty confusing, I know...

Example:
TABLE companies
ID: 1, address: Teststreet 1
TABLE participants
company: 1 <-- company ID from the table "companies"
address: ??? <-- get the address from the company with the ID chosen in "company"

Is this possible?

Best wishes
Andreas
 

eugenio

Administrator
Staff member
Ok, you didn't mention the table company in the first post; if I have understood, you want to fill a field (address) according to what has been chosen in another field: you can use calculated fields (see "How to use calculated fields" in documentation) and in the related function executes a query that gets the address.

Best,
 
Top