@robinpath/google-forms
0.1.1Node.jsPublicGoogle Forms module for RobinPath.
Google Forms
Google Forms module for RobinPath.
Package: @robinpath/google-forms | Category: Productivity | Type: Integration
Authentication
google-forms.setCredentials "your-credentials"
Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.
Use Cases
Use the google-forms module when you need to:
- getForm -- Use
google-forms.getFormto perform this operation - createForm -- Use
google-forms.createFormto perform this operation - updateForm -- Use
google-forms.updateFormto perform this operation - listResponses -- Use
google-forms.listResponsesto perform this operation - getResponse -- Use
google-forms.getResponseto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
setCredentials | Configure google-forms credentials. | object |
getForm | getForm | object |
createForm | createForm | object |
updateForm | updateForm | object |
listResponses | listResponses | object |
getResponse | getResponse | object |
addQuestion | addQuestion | object |
updateQuestion | updateQuestion | object |
deleteQuestion | deleteQuestion | object |
addSection | addSection | object |
getFormInfo | getFormInfo | object |
batchUpdate | batchUpdate | object |
convertToQuiz | convertToQuiz | object |
Functions
setCredentials
Configure google-forms credentials.
Module: google-forms | Returns: object -- API response.
google-forms.setCredentials
| Parameter | Type | Required | Description |
|---|---|---|---|
accessToken | string | Yes | accessToken |
getForm
getForm
Module: google-forms | Returns: object -- API response.
google-forms.getForm
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
createForm
createForm
Module: google-forms | Returns: object -- API response.
google-forms.createForm
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
updateForm
updateForm
Module: google-forms | Returns: object -- API response.
google-forms.updateForm
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listResponses
listResponses
Module: google-forms | Returns: object -- API response.
google-forms.listResponses
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getResponse
getResponse
Module: google-forms | Returns: object -- API response.
google-forms.getResponse
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
addQuestion
addQuestion
Module: google-forms | Returns: object -- API response.
google-forms.addQuestion
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
updateQuestion
updateQuestion
Module: google-forms | Returns: object -- API response.
google-forms.updateQuestion
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
deleteQuestion
deleteQuestion
Module: google-forms | Returns: object -- API response.
google-forms.deleteQuestion
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
addSection
addSection
Module: google-forms | Returns: object -- API response.
google-forms.addSection
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getFormInfo
getFormInfo
Module: google-forms | Returns: object -- API response.
google-forms.getFormInfo
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
batchUpdate
batchUpdate
Module: google-forms | Returns: object -- API response.
google-forms.batchUpdate
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
convertToQuiz
convertToQuiz
Module: google-forms | Returns: object -- API response.
google-forms.convertToQuiz
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
GoogleForms API error (${res.status}): ${t} | Check the error message for details |
google-forms.setCredentials requires accessToken. | Check the error message for details |
google-forms.updateForm requires an ID. | Check the error message for details |
google-forms.updateQuestion requires an ID. | Check the error message for details |
google-forms.deleteQuestion requires an ID. | Check the error message for details |
GoogleForms: "..." not configured. Call google-forms.setCredentials first. | Check the error message for details |
@desc "Validate result"
do
set $result as google-forms.getForm
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate Form
Retrieve all items and loop through them.
@desc "Iterate results"
do
google-forms.setCredentials $token
set $result as google-forms.getForm
each $item in $result
print $item
end
enddo
2. Create a new item with createForm
Create a new resource and capture the result.
@desc "Execute operation"
do
google-forms.setCredentials $token
set $result as google-forms.createForm
print "Created: " + $result
enddo
3. Create and update workflow
Create an item and then update it.
@desc "Execute operation"
do
google-forms.setCredentials $token
set $created as google-forms.createForm
# Update the created item
google-forms.updateForm
enddo
4. Check before creating
List existing items and only create if needed.
@desc "Validate result"
do
google-forms.setCredentials $token
set $existing as google-forms.getForm
if $existing == null
google-forms.createForm
print "Item created"
else
print "Item already exists"
end
enddo
5. Multi-step Google Forms workflow
Chain multiple google-forms operations together.
@desc "Execute operation"
do
google-forms.setCredentials $token
set $r_getForm as google-forms.getForm
set $r_createForm as google-forms.createForm
set $r_updateForm as google-forms.updateForm
print "All operations complete"
enddo
6. Safe getForm with validation
Check results before proceeding.
@desc "Validate result"
do
google-forms.setCredentials $token
set $result as google-forms.getForm
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- google-sheets -- Google Sheets module for complementary functionality
- google-calendar -- Google Calendar module for complementary functionality
- google-contacts -- Google Contacts module for complementary functionality
- gmail -- Gmail module for complementary functionality
- outlook -- Outlook module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | 1 months ago |
Related Modules
rightplace
JS@robinpathv0.1.3
RightPlace integration — 130 functions for projects, WordPress, WooCommerce, email, files, git, spreadsheets, stages, docs, automations via rightplace-cli
asana
JS@robinpathv0.1.2
Asana module for RobinPath.
google-sheets
JS@robinpathv0.1.1
Google Sheets module for RobinPath.
airtable
JS@robinpathv0.1.2
Airtable module for RobinPath.
$ robinpath add @robinpath/google-forms
