FormResponse.getId() returns the wrong value right

2019-07-02 05:09发布

问题:

I am writing a program that requires the ID of various google form responses. My program first creates the form object and gets the responses:

var form = FormApp.openByUrl("...");
var allResponses = form.getResponses();

If the form response is a few hours old, it isn't an issue:

SpreadsheetApp.getUi().alert(allResponses[102].getId()); 
//Displays the correct value, 2_ABaOnufSugrHZ4swdyqxJ5hCxyDuFCdO5F_5glYgHsFCZotI99MFMX1IjGK3EQ

The problem occurs when I'm using a newer response (a few minutes old):

SpreadsheetApp.getUi().alert(allResponses[103].getId());
//Displays the wrong value, ChM3MDQ0MTQwMjIwNDQzOTcxNTczEO2B_fv-qeblbQ

Eventually, the second line displays the correct value, but it takes a little while. Is there a way to speed up this process?