Form Response Edit URL (Ross, need some help/advice.)

856 views
Skip to first unread message

Craig Millsap

unread,
Jun 23, 2022, 7:17:39 AM6/23/22
to GAM for Google Workspace
GAM Advanced

I'm trying to automate a process where I'm using the responses from a form.  One problem I have is I need to validate the data before taking an action.  If I find there is an issue I need the original respondent to edit the form and change their response once I've provided the information regarding the error.

I'm using the command
gam user [emailaddress] show formresponses id $formId formatjson
to get the responses and to parse them.

What I need now is a way to get the edit response URL.  It appears to only be provided in the browser after they submit and/or in the response email.  I need a way to generate/store this edit URL so if I identify an error in the future I can send an email with the link and tell them to edit their response.  Looking at the URL in the email it appears to be a randomly generated URL.  It does not use the ResponseID from the "show formresponses".

It appears you have to query the API again to get this specific URL:
https://developers.google.com/apps-script/reference/forms/form-response#getEditResponseUrl()

Can this be added?

or can someone suggest a way to query the API myself using the existing authorization token that GAM used?

I'm working in PowerShell.

Thanks,

Craig Millsap

NEWMAN, P

unread,
Jun 23, 2022, 7:29:49 AM6/23/22
to google-ap...@googlegroups.com
Hi,
I saw this a few months ago and thought it may come in useful
I got it working but have never had to use it in anger...
hope it helps
Piers

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/12729d1d-89a9-4483-b308-516ff9d1a709n%40googlegroups.com.


--

Piers Newman

Network Technician

 

Craig Millsap

unread,
Jun 23, 2022, 8:02:21 AM6/23/22
to google-ap...@googlegroups.com
Thanks!

So my thought now is onFormSubmit I should be able to add the Form Response ID and the Response Edit URL to the response sheet.

So I will need to pull both the form responses and the sheet for cross reference but it should have the data I need.

Still hopeful it can be wrapped into GAM but this might be a functional work around. 

Thanks,

Craig Millsap
Network Administrator
Gentry Public Schools
cmil...@gentrypioneers.com

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/eGkypW8F1P8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CABzAEGkM5FU6QBbAFEZ1_3QVeuJ%2Brf%3DtvZn7_c%2BjQ4G%3D__p8Eg%40mail.gmail.com.

Ausbrooks, Darnelle

unread,
Jun 23, 2022, 8:27:08 AM6/23/22
to google-ap...@googlegroups.com
Ooh - this will be super helpful. Thanks!


Darnelle

Darnelle Ausbrooks
Technology Coordinator
Harmony Grove School District
Benton, AR






Ross Scroggs

unread,
Jun 23, 2022, 2:06:02 PM6/23/22
to google-ap...@googlegroups.com

The REST API does not plan to support:

  • Submitting form responses
Ross

Craig Millsap

unread,
Jun 23, 2022, 2:37:05 PM6/23/22
to google-ap...@googlegroups.com
I don't need to submit a form response. Google has been clear that they won't support that. I just need to provide a link to the end user so they can edit their previous response. 

Thanks,

Craig Millsap

Ross Scroggs

unread,
Jun 23, 2022, 2:48:15 PM6/23/22
to google-ap...@googlegroups.com
Craig,

$ gam user testsimple show forms 1thEfMdDs_4VWHFZljPSiGqUBfF2cgKpODYQDtbIaEpU

User: tests...@domain.com, Show 1 Form

  Form: 1thEfMdDs_4VWHFZljPSiGqUBfF2cgKpODYQDtbIwxyz

    formId: 1thEfMdDs_4VWHFZljPSiGqUBfF2cgKpODYQDtbIwxyz

    info:

      description: Simple Form

      documentTitle: Simple Form

      title: Simple Form

    items:

      itemId: 4a9cb31d

        questionItem:

          question:

            choiceQuestion:

              options:

                value: Who Knows

                value: Whatever

              type: RADIO

            questionId: 5df058dd

            required: True

        title: Whats' the meaning of life

      itemId: 36057a17

        questionItem:

          question:

            questionId: 0ff1c3ff

            required: True

            textQuestion:

        title: What was your first school

    responderUri: https://docs.google.com/forms/d/e/1FAIpQLSfkH7sdLooWulPaeGS1sfAlYkSm75kPYjcYnntAFoR3IGSc3Q/viewform

    revisionId: 00000021


See: https://developers.google.com/forms/api/reference/rest/v1/forms#Form


responderUri

string

Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the question.







--

James SEYMOUR

unread,
Jun 23, 2022, 8:02:08 PM6/23/22
to GAM for Google Workspace
I have used this solution https://support.google.com/docs/forum/AAAABuH1jm0LSKKCR3VHC8/?hl=en&gpf=%23!topic%2Fdocs%2FLSKKCR3VHC8, which is shorter. Just testing it again and the script can run without the "Allow response editing" enabled, but you have to enable this to view the completed form.

Not sure if the other script can run without the "Allow response editing" enabled, but I can see a use-case when you don't want everyone to be able to edit their responses, but be able to run script, enable, edit and then disable.

Cheers

James

Craig Millsap

unread,
Jun 24, 2022, 8:38:51 AM6/24/22
to GAM for Google Workspace
Ross,

I went and actually read the Forms API and it does not support doing what I was requesting. The link I sent was specific to AppScript so it appears that is what I will have to do then process the sheet itself.

Thank you Piers and James for the AppScript examples.

Craig
Reply all
Reply to author
Forward
0 new messages