Define foreign key drop downs

Given the following table in a postgresql database:

CREATE TABLE IF NOT EXISTS public.mf_shift_outputs
(
id bigint NOT NULL DEFAULT nextval(‘mf_shift_outputs_id_seq’::regclass),
mf_shift_id bigint NOT NULL,
stitem_id bigint NOT NULL,
uom_id bigint NOT NULL,
output numeric NOT NULL,
planned_time numeric NOT NULL,
run_time_speed numeric NOT NULL,
operators numeric NOT NULL,
work_order_id bigint,
usercompanyid bigint NOT NULL,
created timestamp without time zone DEFAULT now(),
createdby character varying COLLATE pg_catalog.“default”,
alteredby character varying COLLATE pg_catalog.“default”,
lastupdated timestamp without time zone DEFAULT now(),
CONSTRAINT mf_shift_outputs_pkey PRIMARY KEY (id),
CONSTRAINT mf_shift_outputs_shift_id_fkey FOREIGN KEY (mf_shift_id)
REFERENCES public.mf_shifts (id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT mf_shift_outputs_stitem_id_fkey FOREIGN KEY (stitem_id)
REFERENCES public.st_items (id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT mf_shift_outputs_uom_id_fkey FOREIGN KEY (uom_id)
REFERENCES public.st_uoms (id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT mf_shift_outputs_usercompanyid_fkey FOREIGN KEY (usercompanyid)
REFERENCES public.system_companies (id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT mf_shift_outputs_work_order_id_fkey FOREIGN KEY (work_order_id)
REFERENCES public.mf_workorders (id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
)

Can Appsmith auto generate a form and resolve the foregn keys from the constraints so that, say, a description for a referenced id could be shown in a drop down?

I am guessing not because form generation from a query on the table presents the foreign key ‘lookups’ as id columns.

Thanks
Martyn

Hi Martyn, we currently don’t have such a feature. However, it could be a great addition to Appsmith. I have created a Github issue to track it: [Feature]: auto generate form from SQL query and identify foreign key constraints · Issue #13750 · appsmithorg/appsmith · GitHub . Can you please add a small example SQL query on the Github issue and what kind of form should be generated out of it - so that it gives us a better idea of what you are looking for ?