iterate over rows

Hi,
I need to iterate over multiple rows to get a 'complete' (yes/no) value, corresponding to a userid.

I am using the variable sencilsheetstoken to iterate over all the rows

The javascript could be like:

var player = GetPlayer();
var row = player.GetVar('stencilsheetstoken');
var i;
for (i = 0; i < row.length(); i++) { if (SheetsGet('user_id', 'bruger_id') == '4') { SheetsGet('complete', 'bruger_complete') } row++; } My question is: Does it with this solution count 1 api call for each row, eg. if I have 1000 rows, it is 1000 api calls and 1$? And if that's the case, is there a better solution? Thanks. Morten

May 14, 2021, 9:26 am

Click for thumbs down.0Click for thumbs up.1#1

Morten, you are correct. Every time you call SheetsGet or SheetsSet, each call counts as one API call.

May 16, 2021, 9:17 pm

Click for thumbs down.0Click for thumbs up.0#2