goal: when user selects row on Table, values from the DB are pulled and inserted into the different form fields for display, so if needed can edit the values and re-submit the values.
how i currently have managed to do it is:
i have created multiple event handlers (50+) for each individual field that is in the form to control each component and set the value based on the row from the table that the user selected. ETC i have fields "Collection", "SKU" .... and so on... So when the user chooses the Collection from the Table, it'll then add the data to the fields from the retoolDB to "Collection", "SKU".... It works.. but the load time is a bit of a problem. Is there a way to improve this , etc using a script to download data from DB and inserting to the required fields based on user selection from the table?
Might need to explain the outcome you're aiming for, I'm a little confused.
You have a table that shows data that comes from a database query?
When you select a row in the table you want a form with 50+ fields to populate and each field in the form is being filled with a value that is not something in the table row you clicked on?
So clicking a row should fire a query to get this data, and this is 1 query or 50?
And the edit/submit will populate different tables too?
I'm not sure about suggesting how to resolve it without knowing more detail. It feels like it should be a standard editable table component or a parent/child relationship. Can you maybe share a screenshot and explain more about where your data is coming from etc.
Thank you for the reply.
Context of app type: a product information management system
Current process: have a table which pulls all the data from the retool DB, the the table displays only couple of needed columns that are required, so the user can find the data from db by collection etc. Then I have a form with which users can add data into the retool db. What i want to achieve is that, users can download data from the database to the same fields that they used to submit data to the db for ease of editing and for displaying the data.
So currently how i have solved this is that i have created 50+ event handlers for the table component. Meaning, if an user selects a row in the table then it'll autofill the form fields based on the data that is in the DB for that collection.
So the question is, is using the event handlers the best option to do so, or are there better options?
Saadetud rakendusest Outlook Androidile
Thanks for explaining - it sounds like you would want to use a form component in this case and not need the event handlers.
There is a "form generator wizard" that will create the fields for you when you attach it to a data source too.