Locally delete from table which is populated from CSV

I want to delete a row in a table whose data source is a uploaded csv file. Basically I'm checking if values from a certain email column already exists in my database, if value exists then I want to delete it locally from the table itself, how can I do this. I was thinking table.data.splice() should work but it is not working.
(I do not want to delete from the DB but from the table itself locally)

I don't believe you can manipulate the table data in this way. The data is read from a source and then displayed... there are several ways for you to get the results you are looking for though.

One way is to process the CSV via script or transformer, generate the data for the e-mail column, and then query your database filter out the already existing e-mails. The results of this processing step would be the table data you want to display.

But i'm uploading csv via the file upload component, how can I process the CSV then
Also the csv cannot be processed directly via the upload component, i.e by this method:-> filebutton.parsedValue[0].

If you setup a Javascript query you can use the filebutton.parsedValue[0] data in your code to then compare to your other queries. Something like this:

CSV Uploaded --> Triggers Javascript Query to extract emails: (triggers DB Query with list of emails to see which ones are new-->returns filtered list of only new emails) --> Javascript Query results populate table.

Then you can modify/review that data and setup another query if that data needs to be inserted into your DB.

yeah but the table does not have only email, email is like the primary field which uniquely identifies a record. Thanks for the help man, really appreciate it.

1 Like