Get Form
Retrieves the metadata and structure of a Google Form.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Form Id - The unique identifier of the Google Form to retrieve.
Output
- form - The complete form object containing metadata and structure information, including:
- FormId - The unique identifier of the form
- Title - The title of the form
- Description - The description of the form
- Items - An array of questions and sections in the form
- Settings - Form settings such as quiz options, confirmation message, etc.
- RevisionId - The revision ID of the form
- ResponderUri - The URL for respondents to access the form
How It Works
The Get Form node retrieves the complete metadata and structure of an existing Google Form. When executed, the node:
- Validates the required input (Form Id)
- Retrieves the Google Form using the provided Form Id
- Uses the Google Forms API to fetch the complete form object
- Returns the form object with all metadata and structure information
Requirements
- A valid Google Forms form ID
- Appropriate permissions to view the form
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Form Id
- Google Forms API errors during form retrieval
- Insufficient permissions to view the form
- Form with the specified ID does not exist
Usage Notes
- The returned form object contains comprehensive information about the form's structure
- This node is useful for inspecting form content or programmatically analyzing forms
- The form object can be used with other nodes that process form data
- The output includes all questions, sections, and form settings
- This node does not modify the form in any way
- The form object structure follows the Google Forms API specification
- You must use OpenForm or CreateForm node before this node to establish a connection
- Use this node to verify form structure before adding or deleting questions
Example Use Cases
Form Structure Inspection
Form Id: {{form_id}}
Output: form object with complete structure
Use Case: Inspect form structure to understand question types, order, and settings before making modifications
Question Count Validation
Form Id: {{form_id}}
Output: form object
Calculate: total_questions = form.items.length
Use Case: Verify the number of questions before deciding where to insert a new question
Form Metadata Extraction
Form Id: {{form_id}}
Output: form object
Extract:
- Title: {{form.info.title}}
- Description: {{form.info.description}}
- Is Quiz: {{form.settings.quizSettings.isQuiz}}
- Responder URL: {{form.responderUri}}
Use Case: Extract form metadata for documentation or inventory purposes
Question ID Mapping
Form Id: {{form_id}}
Output: form object
For each item in form.items:
- Question Title: {{item.title}}
- Question ID: {{item.questionItem.question.questionId}}
- Question Type: {{item.questionItem.question type}}
Use Case: Create a mapping of question IDs to titles for response processing
Tips for Effective Use
- Structure Analysis: Use GetForm before making modifications to understand the current state
- Question IDs: Extract question IDs to properly map responses to questions
- Index Planning: Check the number of items to determine valid index values for adding questions
- Settings Review: Examine form settings to determine if it's a quiz, if email collection is enabled, etc.
- Validation: Use GetForm after modifications to confirm changes were applied correctly
- Documentation: Generate form documentation by extracting all questions and their properties
Form Object Structure
The form output contains a comprehensive object following this structure:
{
"formId": "1ABC123xyz",
"info": {
"title": "Customer Satisfaction Survey",
"documentTitle": "Customer Satisfaction Survey",
"description": "Please help us improve our services"
},
"settings": {
"quizSettings": {
"isQuiz": false
}
},
"items": [
{
"itemId": "item1",
"title": "How satisfied are you?",
"questionItem": {
"question": {
"questionId": "q1",
"required": true,
"choiceQuestion": {
"type": "RADIO",
"options": [
{"value": "Very Satisfied"},
{"value": "Satisfied"},
{"value": "Neutral"}
]
}
}
}
}
],
"revisionId": "000001",
"responderUri": "https://docs.google.com/forms/d/e/1ABC123xyz/viewform"
}
Common Errors and Solutions
Error: "Form not found. Please use Open Form node first"
Cause: The form_id doesn't exist in the current session or OpenForm/CreateForm wasn't called first. Solution: Use OpenForm or CreateForm node before GetForm to establish a connection.
Error: "Form ID cannot be empty"
Cause: The Form Id input is empty or not set. Solution: Pass the form_id from CreateForm or OpenForm node output to this input.
Error: "Failed to get form"
Cause: API error when retrieving the form. Solution:
- Verify you have permission to view the form
- Check that the form exists and hasn't been deleted
- Ensure the Google Forms API is enabled in your project
- Verify your credentials have the necessary scopes
Error: "Insufficient permissions to view the form"
Cause: Credentials don't have permission to access the form. Solution:
- For Service Accounts: Share the form with the service account email
- For OAuth2: Verify the user owns or has access to the form
- Check that credentials include the Forms Body Read scope
Integration Examples
Pre-Modification Validation
1. Open Form
- URL: "https://docs.google.com/forms/d/abc123/edit"
- Output: form_id
2. Get Form
- Form Id: {{form_id}}
- Output: form
3. Validate:
- Current question count: {{form.items.length}}
- Is Quiz: {{form.settings.quizSettings.isQuiz}}
4. If form.items.length < 10:
- Add new question at index {{form.items.length + 1}}
- Else:
- Log: "Form already has maximum questions"
Form Documentation Generator
1. Query Database: SELECT form_id, form_name FROM forms
2. For Each form in database:
- Open Form
- Form URL: {{form.url}}
- Output: form_id
- Get Form
- Form Id: {{form_id}}
- Output: form_details
- Generate Documentation:
- Form Name: {{form_details.info.title}}
- Description: {{form_details.info.description}}
- Total Questions: {{form_details.items.length}}
- Form Type: {{form_details.settings.quizSettings.isQuiz ? 'Quiz' : 'Form'}}
- Responder URL: {{form_details.responderUri}}
- For Each item in form_details.items:
- Question: {{item.title}}
- Type: {{item.questionItem.question type}}
- Required: {{item.questionItem.question.required}}
- Export to PDF or markdown file
Question Type Analysis
1. Open Form
- URL: "https://docs.google.com/forms/d/survey/edit"
- Output: form_id
2. Get Form
- Form Id: {{form_id}}
- Output: form
3. Initialize counters:
- text_questions = 0
- choice_questions = 0
- other_questions = 0
4. For Each item in form.items:
- If item.questionItem.question.textQuestion exists:
- text_questions++
- Else If item.questionItem.question.choiceQuestion exists:
- choice_questions++
- Else:
- other_questions++
5. Report:
- Text Questions (Open-ended): {{text_questions}}
- Choice Questions (Closed-ended): {{choice_questions}}
- Other: {{other_questions}}
Form Comparison
Compare two versions of a form:
1. Open Form
- URL: "https://docs.google.com/forms/d/version1/edit"
- Output: form_id_v1
2. Get Form
- Form Id: {{form_id_v1}}
- Output: form_v1
3. Open Form
- URL: "https://docs.google.com/forms/d/version2/edit"
- Output: form_id_v2
4. Get Form
- Form Id: {{form_id_v2}}
- Output: form_v2
5. Compare:
- Title Changed: {{form_v1.info.title != form_v2.info.title}}
- Question Count: {{form_v1.items.length}} vs {{form_v2.items.length}}
- Questions Added: {{form_v2.items.length - form_v1.items.length}}
6. Generate comparison report
Dynamic Index Calculation
Safely add questions to the end of a form:
1. Open Form
- URL: {{form_url}}
- Output: form_id
2. Get Form
- Form Id: {{form_id}}
- Output: form
3. Calculate next index:
- next_index = form.items.length + 1
4. Add Open-Ended Question
- Form Id: {{form_id}}
- Question Title: "New question"
- Index: {{next_index}}
- Type: Short Answer
This ensures the question is added at the end without hardcoding index values
Form Health Check
Automated form validation workflow:
1. For Each form_url in monitored_forms:
- Open Form
- URL: {{form_url}}
- Output: form_id
- Try:
- Get Form
- Form Id: {{form_id}}
- Output: form
- Validate:
- Has title: {{form.info.title != ""}}
- Has questions: {{form.items.length > 0}}
- Has description: {{form.info.description != ""}}
- Responder URL active: {{form.responderUri exists}}
- If all valid:
- Status: "✓ Healthy"
- Else:
- Status: "⚠ Issues found"
- Details: {{validation_errors}}
- Catch:
- Status: "✗ Cannot access form"
- Error: {{error.message}}
2. Generate health report and send to admins