Search code examples
google-apps-scriptspreadsheetgoogle-docsgoogle-docs-api

How to open programatically a Form for selected SpreadSheet in Google Docs?


I have a form that populates the spreadsheet. If someone puts wrong data i need to correct it in spreadsheet. But i have a lots of columns. I want to edit it with the form that user uses. How to open a form for a selected row in Google Spreadsheet?


Solution

  • Yes from apps script you can use getEditResponseUrl() (link)

    Exemple of code

    var line = 5; //Line in the spreadsheet you want url
    var form = FormApp.openByUrl("URLOfForm");
    var reps = form.getResponses();
    Logger.log(reps[(line-2)].getEditResponseUrl());
    

    Stéphane