Google 表单连接器

Workflows 连接器,用于定义用于在工作流中访问 Google 表单的内置函数。

深入探索

如需查看包含此代码示例的详细文档,请参阅以下内容:

代码示例

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"

后续步骤

如需搜索和过滤其他 Google Cloud 产品的代码示例,请参阅 Google Cloud 示例浏览器