Category: Question and Answers
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.

Inline Edit Custom Mode with MYSQL batch update

Issue

I am working on an in-house app with a MYSQL database and I want to implement inline editing with batch update/updateAll. However, I'm struggling to find good documentation on how to do this. I have managed to implement single row inline editing but I'm stuck on how to write the JS query for custom inline editing with multiple rows. I'm not very experienced with JavaScript, so I'm unsure what a good approach would be. I would appreciate more examples on how to do this with MYSQL or similar databases.

Resolution

The user is working on an in-house app with a MYSQL database and trying to implement inline editing. They have successfully implemented it for single row updates but are facing an issue for custom inline editing with multiple rows. They are looking for help on how to dynamically pass values to the MYSQL update query using JS.

The Appsmith Support team suggested using a sample app that shows how to do it with Google Sheets but the user was specifically looking for a MYSQL solution. The Support team provided a different sample app that demonstrates the approach for PostgreSQL.

The user can use a loop or forEach function in JS to call the MYSQL update query dynamically for multiple rows. They can pass the values using template literals in the query. The sample app for PostgreSQL should provide a good starting point for understanding the approach and the user can modify it according to their MYSQL setup.