I have an issue with script execution. I need help:
I want to set the script name "datasu" & "su" to execute after the previous script execution is completed. Because the script behind will base on the result of the previous script. I have tried using return but it has not worked. Are there any solutions to run & finish the scripts base on order? Please help me to solve this issue, Thank you so much!
var team_num = team_ss.filter(String).length;
ss.getRange(2,1,ss.getLastRow(),23).clearContent();
var dataena = ss.getRange(2,1,ena.getLastRow(),22).setValues(valueena);
console.log(team_num);
var ena = ss.getRange(team_num+1,23,(ss.getLastRow()-team_num),1).setValue('Ena');
var datasu = ss.getRange(ss.getLastRow()+1,1,su.getLastRow(),22).setValues(valuesu);
var su = ss.getRange(team_num+1,23,(ss.getLastRow()-team_num),1).setValue('SU');```
It's not super clear what you're trying to do here but try adding SpreadsheetApp.flush() after the line of code you want to make sure has written to your spreadsheet.