How to insert a csv to Grist remotely?

Hi,
How to import a csv to Grist from a remote server?

Best

In a document, click “Add New” on the left. Then you can either:

  1. Import from file to upload a CSV from your computer
  2. Import from URL if the CSV is at some publicly accessible address, e.g. https://raw.githubusercontent.com/datasets/world-cities/master/data/world-cities.csv
  3. Import from Google Drive if the CSV is stored there
2 Likes

Hi,

  1. If I import from URL, the content will be added to the existing Grist sheet or it will “create” a new one on each import?
  2. If I import from Google Sheets, the content will be added to the existing Grist sheet or it will “create” a new one on each import?

https://support.getgrist.com/imports/#import-to-an-existing-table

You can choose to create a new table or you can select an existing table and it will add to it. We’re currently working on extending imports to also allow updating existing records, not just appending. Is that what you need? Can you describe your use case?

1 Like

So, right now all imports are “cleanly”? That means the existing content should be deleted and only the new one will be added. Correct?

I think the best option would be to choose if I want a clean import OR if I want to add to existing content. :pray:

My use case is that I have a file that needs to be updated daily. I am looking for an automated way to add new rows if they do not exist already…

It may be helpful for you to duplicate your important document and experiment with imports in the copy so that you can see exactly what happens without risking damaging your main document.

If you import into an existing table, it will add rows to the table. No rows will be deleted or updated.

What we’re working on is a way to be able to say something like “If a record with this FullName exists, update that record (change other values like phone number), otherwise add a new record”.

Will be possible to say: “if the existed record has different values, then update it. If the record does not exist, then add the record.” ?

Any ETA available?!

Will be possible to say: “if the existed record has different values, then update it. If the record does not exist, then add the record.” ?

That’s essentially what I’m saying, but you’ll need to specify one or more columns as ‘keys’ so that the system can identify ‘the existing record’ that is meant to match an imported record even if some values are different and need updating. Does that make sense?

No ETA at the moment, but hearing what users need is helpful.

2 Likes

Is updating a table possible with the Python API? Can you provide an example script?