Lookup field shows data from another field

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
dlee
Veteran Member
Posts: 137
Joined: 2020-04-14 00:21
Location: South Carolina, USA
Contact:

Lookup field shows data from another field

Post by dlee » 2021-04-29 18:57

I have a table named employees that has a field named dept. I set the employees.dept field to link with the departments.name field. Instead of showing the department name it is showing the department.id field data. I hope this is clear enough for you guys to help.

Employees:
id
name
dept

Department:
id
name

Thanks,TD

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Lookup field shows data from another field

Post by jsetzer » 2021-04-29 19:19

In employees.dept double check lookup options. Especially check value of caption 1.

Can you please upload a screenshot of the field settings of employees.dept

Note that the primary key (id) will be stored in database. The field(s) you define as caption are just for display. The primary key defines the relation between those two records.

I recommend naming such lookup fields dept_id which gives more flexibility for future autofill fields like dept_description etc.. but this is just my personal opinion and experience.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

dlee
Veteran Member
Posts: 137
Joined: 2020-04-14 00:21
Location: South Carolina, USA
Contact:

Re: Lookup field shows data from another field

Post by dlee » 2021-04-30 02:00

Thank you jsetzer for helping. This is my first full app I have built with Appgini so I probably have something wrong. The attached screen capture shows how I have things configured in Appgini. Please review and advise on how to properly link tables within Appgini

TD

https://adsi-sc.com/accommodations/imag ... apture.jpg

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Lookup field shows data from another field

Post by jsetzer » 2021-04-30 06:40

Everything looks fine. Did you re-generate all files and upload all necessary files to your webserver?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

dlee
Veteran Member
Posts: 137
Joined: 2020-04-14 00:21
Location: South Carolina, USA
Contact:

Re: Lookup field shows data from another field

Post by dlee » 2021-04-30 16:07

Hi jsetzer, I just finished uploading everything to the web server. I have tried everything I know to do including deleting the employees table in Appgini and then recreating it again; same issue. This is the only place in the app where this occurs so I have decided for now to just live with it although I might ask tech support to look at it. Anyways, thank you for your help!
TD

pfrumkin
Veteran Member
Posts: 157
Joined: 2020-02-18 17:58
Location: Albuquerque, New Mexico USA

Re: Lookup field shows data from another field

Post by pfrumkin » 2021-05-03 22:18

Hi,

A shot in the dark:
Is there anything funny in the Advanced section for the employees.dept lookup field? It should be something like

Code: Select all

SELECT `departments`.`id`, `departments`.`name` FROM `departments` ORDER BY 2
~Paul

dlee
Veteran Member
Posts: 137
Joined: 2020-04-14 00:21
Location: South Carolina, USA
Contact:

Re: Lookup field shows data from another field

Post by dlee » 2021-05-05 01:43

I just checked the Advanced section for employees.dept and it had exactly the same thing you posted so no joy there, but thanks for trying to help
TD

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Lookup field shows data from another field

Post by pbottcher » 2021-05-05 05:55

Hi,

just a short question. Is this a single lookup you are using, or is this somehow a nested lookup? There is an issue with nested lookup not showing the data, but the id.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply