Hi everyone,
I would like to import data from a CSV file, but only those records that already exist in my table. So, I checked (ticked) the "Update matching table records (using primary key) check box." Despite this, the application adds records where the primary key does not match.
To test, I created a CSV file with three lines: the header line, one line with an existing primary key, and one line with a primary key that does not exist in the table.
This results in updating the record with the existing primary key, but also creating a new record with the new primary key.
What am I doing wrong?
Thanks
Import CSV data does not work as expected
-
- Veteran Member
- Posts: 54
- Joined: 2016-03-21 19:33
Re: Import CSV data does not work as expected
Hmmm, I think this is exactly the way it works (and should work for many use cases).
I'm afraid there is no standard way nor hook for importing (=updating) ONLY existing and skipping new records unless you code your own CSV-reader which eliminates "unknown" records before importing. Or you can delete "new" records afterwards (which I think is not good).
I'm afraid there is no standard way nor hook for importing (=updating) ONLY existing and skipping new records unless you code your own CSV-reader which eliminates "unknown" records before importing. Or you can delete "new" records afterwards (which I think is not good).
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
-
- Veteran Member
- Posts: 54
- Joined: 2016-03-21 19:33
Re: Import CSV data does not work as expected
Thanks jsetzer.
I ended up writing an excel macro that highlights the rows that don’t exist, and deleting them before the import.
That works fine.
I ended up writing an excel macro that highlights the rows that don’t exist, and deleting them before the import.
That works fine.