Connector for Google Forms

Workflows connector that defines the built-in function used to access Google Forms within a workflow.

Explore further

For detailed documentation that includes this code sample, see the following:

Code sample

YAML

# This workflow creates, updates, gets, and deletes a Google Form
# using the Google Forms connector.
#
# Features included in this test:
# - Google Forms connector
#
# Expected successful output: "SUCCESS"
- init:
    assign:
      - form_title: "sample-form"
- create_form:
    call: googleapis.forms.v1.forms.create
    args:
      body:
        info:
          title: ${form_title}
    result: create_form_resp
- update_form:
    call: googleapis.forms.v1.forms.batchUpdate
    args:
      formId: ${create_form_resp.formId}
      body:
        requests:
          - updateFormInfo:
            info:
              title: "new-title"
              updateMask: title
- get_form:
    call: googleapis.forms.v1.forms.get
    args:
      formId: ${create_form_resp.formId}
- list_responses:
    call: googleapis.forms.v1.forms.responses.list
    args:
      formId: ${create_form_resp.formId}
      pageSize: 10
- delete_form:
    call: http.delete
    args:
      url: ${"https://www.googleapis.com/drive/v3/files/" + create_form_resp.formId}
      auth:
        type: OAuth2
        scope: https://www.googleapis.com/auth/drive
- the_end:
    return: "SUCCESS"

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.