Connector für Google Formulare

Workflows-Connector, der die integrierte Funktion für den Zugriff auf Google Formulare in einem Workflow definiert.

Weitere Informationen

Eine ausführliche Dokumentation, die dieses Codebeispiel enthält, finden Sie hier:

Codebeispiel

YAML

# This workflow demonstrates how to use the Google Forms connector:
# Create, update, get, and delete a Google Form
# Expected 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"

Nächste Schritte

Informationen zum Suchen und Filtern von Codebeispielen für andere Google Cloud-Produkte finden Sie im Google Cloud-Beispielbrowser.