Graphrt

Google Forms

Baca form dan respons (per halaman, filter waktu), buat form, edit batch serta publish dan tutup form harus diizinkan, watch Pub/Sub hanya lewat node (OAuth atau service account)

Beta v0.1.0 Node.js 11 aksi
Pakai di Graphrt Desktop

Tentang

Plugin Graphrt untuk Google Forms API v1. Baca form dan responsnya, buat form, edit pertanyaan dengan batch update, publish atau tutup form, dan kelola watch Pub/Sub untuk respons baru. Untuk mencari form berdasarkan nama pakai google-drive (mimeType application/vnd.google-apps.form), untuk menyalin respons ke sheet pakai google-sheets.

Yang bisa dilakukan

  • get_form: title, description, settings, questions (items[] with questionId), publishSettings and the respondent link responderUri
  • list_responses: submitted responses (answers keyed by questionId), up to 5,000 per page with limit and cursor, filter takes only timestamp > T or timestamp >= T (RFC 3339 UTC)
  • get_response: one response by responseId
  • create_form: a new empty form with a title (form_title, optionally unpublished, closed to responses)
  • batch_update: raw batchUpdate requests (createItem, updateItem, moveItem, deleteItem, updateFormInfo, updateSettings), with required_revision_id to fail when the form changed meanwhile
  • set_publish_settings: is_published and is_accepting_responses (accepting needs published)
  • list_watches, create_watch, renew_watch, delete_watch: Pub/Sub notifications for new responses (RESPONSES) or edits (SCHEMA), a watch lasts 7 days and each Cloud project may have one per event type per form
  • api_request: any other endpoint (GET only for agents)

Aksi

Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.

  • Get form google-forms.get_form
  • Create form google-forms.create_form
  • Batch update form google-forms.batch_update
  • Publish or close form google-forms.set_publish_settings
  • List responses google-forms.list_responses
  • Get response google-forms.get_response
  • List watches google-forms.list_watches
  • Create watch google-forms.create_watch
  • Renew watch google-forms.renew_watch
  • Delete watch google-forms.delete_watch
Tampilkan semua 11 aksi
  • Google Forms API request google-forms.api_request

Pengaturan

Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.

  • GOOGLE_REFRESH_TOKEN
    OAuth refresh trio
  • GOOGLE_SERVICE_ACCOUNT_JSON
    Path to a service account key file (scopes forms.body and forms.responses.readonly), share each form with the service account's email
  • GOOGLE_ACCESS_TOKEN
    A ready access token (used only when neither of the above is set)
  • GOOGLE_FORMS_TOOL_ALLOW_EDIT
    1 lets agent tools call batch_update
  • GOOGLE_FORMS_TOOL_ALLOW_PUBLISH
    1 lets agent tools call set_publish_settings
  • GOOGLE_CLIENT_ID
  • GOOGLE_CLIENT_SECRET
  • GOOGLE_FORMS_TOOL_TOKEN_SOURCE

Cara memakainya

Di Graphrt Desktop

  1. Buka Plugins dan cari Google Forms.
  2. Klik Install lalu setujui.
  3. Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
  4. Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Plugin di Graphrt Desktop

Dengan CLI

terminal
$ graphrt plugin install google-forms
workflow.yaml
# New responses since a time, e.g. in a scheduled workflow
- id: fresh
  type: google-forms.list_responses
  form_id: "{{#start.form_id#}}"
  filter: "timestamp > {{#start.since#}}"
# Add a question to a form
- id: add_question
  type: google-forms.batch_update
  form_id: "{{#start.form_id#}}"
  requests:
    - createItem:
        item: { title: "Your email", questionItem: { question: { required: true, textQuestion: {} } } }
        location: { index: 0 }
Plugin di docs