i have made a little google-script with GESI to update transactions
now it does work quite well but i did reach my urlfetch-limit pretty fast
my guess is, the way i wrote the script, it does invoke a client-call with every loop
but i’m not sure if it does, and i have no idea how to avoid it
thanks for any help
grad
the important part of the script
function updateTrans() {
var client = GESI.getClient().setFunction(‘corporations_corporation_wallets_division_transactions’);
var type_data = client.execute({division: 6});
…
for (var i=data_length-1; i>-1; i–) {
new_id = type_data[i][6];
if (new_id>last_id) {
trans_sheet.insertRowAfter(1);
for (var j=0; j<data_width; j++) {
trans_sheet.getRange(2,1+j,1,1).setValue(type_data[i][j]);
}
}
}
}
i also get lots of timeout-errors - at least sometimes - with my GESI-requests in the table cells - probably because they are now several hundred - that’s why i’m working on invoking everything through script to have more control over it
maybe google updated my GESI-calls in the cells to often… no idea
in the cells i use things like this:
QUERY(markets_region_history(A5; $B$1; FALSE); “Select avg(Col5), avg(Col6) LABEL avg(Col5) ‘’, avg(Col6) ‘’”; FALSE)
To be clear if you’re fetching orders for a single item from jita that’s going to be more than 1 request as each page is its own request. You would be better off fetching all the data and filtering it down. I.e. load in market history data in a dedicated sheet, then vlookup what you need in other cells, versus using the function with the cell itself.
It would also be more efficient if you used a custom function to fetch price data. I.e. fetch the entire market, keep track of the specific orders you want and output it to a dedicated sheet, then again, vlookup what you need from there.
i know what you mean in general (and i do use data tables with lookups already at some points) - just have to check what that means in detail in this case