Hi everyone,
I’m creating a form (in a modal) to view and update the user details. The input fields are populated by a query that fetches all rows from the table “Users”. I have a column named “Type_ContractID” in the table “Users” that is related to another column named “ID” in the table “Contracts” (the relationship is one to many). The type of column “Type_ContractID” is an integer since it has to be related to “ContractID” in the table “Contracts” (an integer, primary key with auto increment). I need to create a select widget that fetches all the values from the table “Contracts” (namely, “ContractID” and “Contract_Name”) and, when the form is updated, the select widget writes the value selected by the user into the related column “Type_ContractID” in the table “Users”. Also it would be great if, when the form is opened, the select widget could take the existing value from the table “Users” (“Type_ContractID”) as a reference and display the related value from the table “Contracts” (“Contract_Name”).
Does anyone know how can I achieve this in Appsmith?