Modules@robinpath/google-forms
google-forms

@robinpath/google-forms

0.1.1Node.jsPublic

Google 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.getForm to perform this operation
  • createForm -- Use google-forms.createForm to perform this operation
  • updateForm -- Use google-forms.updateForm to perform this operation
  • listResponses -- Use google-forms.listResponses to perform this operation
  • getResponse -- Use google-forms.getResponse to perform this operation

Quick Reference

FunctionDescriptionReturns
setCredentialsConfigure google-forms credentials.object
getFormgetFormobject
createFormcreateFormobject
updateFormupdateFormobject
listResponseslistResponsesobject
getResponsegetResponseobject
addQuestionaddQuestionobject
updateQuestionupdateQuestionobject
deleteQuestiondeleteQuestionobject
addSectionaddSectionobject
getFormInfogetFormInfoobject
batchUpdatebatchUpdateobject
convertToQuizconvertToQuizobject

Functions

setCredentials

Configure google-forms credentials.

Module: google-forms | Returns: object -- API response.

google-forms.setCredentials
ParameterTypeRequiredDescription
accessTokenstringYesaccessToken

getForm

getForm

Module: google-forms | Returns: object -- API response.

google-forms.getForm
ParameterTypeRequiredDescription
inputstringNoInput parameter

createForm

createForm

Module: google-forms | Returns: object -- API response.

google-forms.createForm
ParameterTypeRequiredDescription
inputstringNoInput parameter

updateForm

updateForm

Module: google-forms | Returns: object -- API response.

google-forms.updateForm
ParameterTypeRequiredDescription
inputstringNoInput parameter

listResponses

listResponses

Module: google-forms | Returns: object -- API response.

google-forms.listResponses
ParameterTypeRequiredDescription
inputstringNoInput parameter

getResponse

getResponse

Module: google-forms | Returns: object -- API response.

google-forms.getResponse
ParameterTypeRequiredDescription
inputstringNoInput parameter

addQuestion

addQuestion

Module: google-forms | Returns: object -- API response.

google-forms.addQuestion
ParameterTypeRequiredDescription
inputstringNoInput parameter

updateQuestion

updateQuestion

Module: google-forms | Returns: object -- API response.

google-forms.updateQuestion
ParameterTypeRequiredDescription
inputstringNoInput parameter

deleteQuestion

deleteQuestion

Module: google-forms | Returns: object -- API response.

google-forms.deleteQuestion
ParameterTypeRequiredDescription
inputstringNoInput parameter

addSection

addSection

Module: google-forms | Returns: object -- API response.

google-forms.addSection
ParameterTypeRequiredDescription
inputstringNoInput parameter

getFormInfo

getFormInfo

Module: google-forms | Returns: object -- API response.

google-forms.getFormInfo
ParameterTypeRequiredDescription
inputstringNoInput parameter

batchUpdate

batchUpdate

Module: google-forms | Returns: object -- API response.

google-forms.batchUpdate
ParameterTypeRequiredDescription
inputstringNoInput parameter

convertToQuiz

convertToQuiz

Module: google-forms | Returns: object -- API response.

google-forms.convertToQuiz
ParameterTypeRequiredDescription
inputstringNoInput parameter

Error Handling

All functions throw on failure. Common errors:

ErrorCause
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)

VersionTagPublished
0.1.1latest1 months ago
Install
$ robinpath add @robinpath/google-forms

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.1
LicenseMIT
Unpacked Size4.3 KB
Versions1
Weekly Downloads26
Total Downloads26
Stars0
Last Publish1 months ago
Created1 months ago

Category

productivity