Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Autofill dropdown from another dropdown

Issue

I'm having trouble figuring out how to auto-update a second dropdown based on the option chosen in the first dropdown, which is populated from a MySQL database. Additionally, I'm trying to autofill some dynamic table columns and add them up based on the selected item in the dropdown. It seems like I need to convert the dropdown values into an array of objects that is accepted in a table format, but it's proving to be a challenging task.

Resolution

The solution involves retrieving data from a MySQL database and populating it into a dropdown using JavaScript. Once an option is chosen, it will trigger another dropdown to auto-update its contents based on the selected value.

Additionally, the selected item from the second dropdown will need to autofill some dynamic table columns and calculate their total. The table should also add a new row once a new item is added. To achieve this, the values in the second dropdown should be in the format accepted by a table, which is an array of objects.

One way to approach this is by using a sample app like Appsmith, which provides a similar concept that can be adapted to fit the specific requirements of the project.