How to reload a whole table from csv

I am trying to work around another system that is impossible to use from a mobile device. I only need to browse the data so there is no real updates to perform. What I am doing to exporting the data in csv file from that other system and importing in to my appsheet app. Then I have a far better UI to work with.

Every so oftem I want to refresh my data from the proper system and this is where I am hitting a problem. I can run an import again using a new csv file and this will insert new rows and udpate existsing ones, but not delete others.

Plan A was to use a grouped action to:

  1. Delete all rows from the table
  2. Add a dummy row
  3. import a csv (i needed the dummy row to execute this action)
  4. Delete my dummy row.

The problem with Plan A is that the sync after the delete does not occur until after the new import given that this is a grouped action. Is there any way to force a sync before step 3 ?

Plan B would be to have a VC on each row that updates when the new csv is imported and any rows that did not update can be deleted. Not sure yet if that works either as I have not checked if the VC updates if no change occurs in the existing row. 

Is there a Plan C?

0 4 188
4 REPLIES 4

Hello @alphacp, I've got a few questions:

1- Why do you need a dummy row?
2- Why is this more complicated than just straight up importing the csv data from the original system?

Ah, I should explain. I actually have multiple tables so I have a screen that allows me to select which table to reload. Therefore I am using the action "Execute an action on a set of rows". To do that there needs to be a row in the table that i have just emptied. 

Even if i had an action on the table itself (which will remove the dummy row requirement), I believe I would still hit the issue that I need to force a sync before the import. 

BTW, Plan B does not work as I ChangeTimestamp cannot be a VC by the looks of things. 

I guess Plan D is to do everything as manual steps... shame.

Steve
Platinum 5
Platinum 5

Use a row in an otherwise uninvolved table to drive the process.

@Steve, this is what i am doing in my Plan A. I have a table called 'menu' and from there I am running the steps. The problem comes that the delete is not sync'd and the import is a direct write to the datasource hence the import is updating the rows before they are being deleted. I need to somehow delete, sync then import. As manual steps this is easy but I wanted to be clever and use a grouped action.