Some small issues found

Javascript:
for (i=0; i<5;i++) (output…)
don´t works as i=0 makes i=undefined

Statistics using views need that you first klick in this view. by default you get empty statistics

Hey, welcome to the SeaTable Forum!

You have reported two issues, which both look quite odd, as they are basic and we have never encountered such issues.

Please:

  • Tell us which version are you using: Cloud, or on-premise
  • Tell us which browser you are using
  • Paste your JavaScript here, if it’s OK for you
  • Also, more details to the statistics. A screenshot would be better.

output.text(‘Start’);
for (var i=0; i<5;i++) output.text(i);
output.text(‘Stop’);
output.text(‘Start2’);
for (var i=1; i<5;i++) output.text(i);
output.text(‘Stop2’);

Result
Start
Stop
Start2
1
2
3
4
Stop2

Edge or Firefox on cloud makes no difference

I would recommend in this case use let instead of var:

output.text('Start');
for (let i=0; i<5; i++) {
  output.text(i);
};

output.text('Stop');
output.text('Start2');

for (let i=1; i<5; i++) {
  output.text(i);
};

output.text('Stop2')

How’s the result now?

2
After moving to the table and changing to the view the data will appear.
Even requesting view by script “const viewRes3 = base.getViewByName(tableres, ‘Team Steffen’);” don´t helps

in case i use let in the for declaration it works !
thanks

This is strange, we never saw this happening. Normally when you are in a base, you could see statistics and the figures without changing to the exact table or view.

Would you make a screenshot of your statistics’ configuration? Like this: