-
Goal:
-
I am trying to delete multiple items from my table component, "customerLookup_Table". The data source for this component is just a SQL resource query that gets all items from a table in my retool DB called "lumberaidcustomer".
-
Steps:
-
So far, my approach has been to combine a couple of queries (one JS one SQL), along with the use of a JS variable, "customerIDsForDeletion", to hold temporary values (this variable is initially set to ).
-
I have a JS query, "getIDsForDeletion", designed to dynamically grab the customer_id values of each selected row, and plant them into the value of "customerIDsForDeletion" (SS of code below).
-
I also have a SQL Resource query, "deleteCustomers", that is meant to delete any row in the table where the customer_id is in "customerIDsForDeletion" (SS of code below).
-
Details:
-
Right now when running "getIDsForDeletion", it runs without errors on its own, but when it calls "deleteCustomers.trigger()", I have the following error showing as part of the SQL query's output (from when I tried to delete 3 customers with ID's of 69, 1, and 13):
invalid input syntax for type integer: "{"69","1","13"}"
-
Screenshots:
-
Code and Error of "deleteCustomers":
-
Code of "getIDsForDeletion":
-
Console output of "getIDsForDeletion" from the aforementioned example:
-
App json export: (here's how to get a json export)