FormResponse.getId() returns the wrong value right after the response is submitted

别来无恙 提交于 2019-12-23 16:19:00

问题


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?

来源:https://stackoverflow.com/questions/40879271/formresponse-getid-returns-the-wrong-value-right-after-the-response-is-submitt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!