My script is here:
// get data from the CSV file
var file = File('c:/scripts/id/update_from_csv/prices.csv');
file.open('r');
var data = file.read().split('\n');
file.close();
// convert the data into the object = {id1:price1, id2:price2, id3:price3, ...}
var obj = {};
for (var i = 0; i < data.length; i++) {
var row = data[i].split(',');
var id = row[0];
var price = row[1];
if (id != '') obj[id] = price; // <------------------ here the update
}
// loop through IDs of the object and change cells in the document
var doc = app.activeDocument;
app.findTextPreferences = null;
for (var id in obj) {
app.findTextPreferences.findWhat = id;
var founds = doc.findText();
for (var f = 0; f < founds.length; f++) {
var cell = founds[f].texts[0].parent;
if (cell.constructor.name == "Cell")
cell.parent.cells[cell.index + 1].contents = obj[id];
}
}
Here is my csv file prices.csv
:
1234567890,100
1234567891,200
1234567892,50
Here are two screenshots from my indd
file.
Before:

After:

Basically it works about in the same way as the script by the link in the question, except it handles all IDs, even if there are several identical IDs in the document.
But the error in your question tells me that you probably have no tables in your documents (!), in this case my code will not work.