Get Presentation
Retrieves information about a Google Slides presentation.
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
- Presentation Id - The ID of the Google Slides presentation to retrieve information about.
Options
- Return Element IDs - If enabled, returns only the element IDs from a specific page rather than the full presentation details.
- Page Object Id - The ID of the specific page to retrieve element IDs from (required when "Return Element IDs" is enabled).
Output
- Response - The presentation data in JSON format. If "Return Element IDs" is enabled, this will contain only the page elements from the specified page.
How It Works
The Get Presentation node retrieves detailed information about a Google Slides presentation. When executed, the node:
- Validates the provided Presentation Id input
- Connects to the Google Slides API
- Retrieves either:
- Full presentation details including slides, layouts, and metadata
- Only the element IDs from a specific page (when Return Element IDs is enabled)
- Returns the retrieved data as a JSON response
Requirements
- A valid Google Slides presentation ID
- Valid Google Slides API credentials
- Proper permissions to access the presentation
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Presentation Id
- Empty or invalid Page Object Id (when Return Element IDs is enabled)
- Google Slides API authentication errors
- Insufficient permissions to access the presentation
- Invalid presentation ID
- Google Slides service errors
Usage Notes
- The Presentation Id can be found in the URL of the Google Slides presentation
- When "Return Element IDs" is disabled, the node returns complete presentation information
- When "Return Element IDs" is enabled, you must specify a Page Object Id to retrieve elements from
- The output Response contains the presentation data in JSON format which can be used in subsequent nodes
- This node is useful for inspecting presentation structure or retrieving specific page elements
- The retrieved data can be parsed and used in other nodes for further processing
- This node does not require credentials as it uses a previously opened presentation context
Examples
Example 1: Get Full Presentation Metadata
Retrieve complete information about a presentation:
Presentation Id: "1A2B3C4D5E6F7G8H9I0J"
Return Element IDs: false
Output includes slides, layouts, page size, title, and all presentation metadata in JSON format.
Example 2: Get Page Elements
Retrieve element IDs from a specific slide:
Presentation Id: "1A2B3C4D5E6F7G8H9I0J"
Return Element IDs: true
Page Object Id: "p1" (the first slide's ID)
Output contains an array of all elements on that slide with their IDs, types, and properties.
Example 3: Inspect Presentation Structure
Get presentation metadata to understand its structure:
- Open or Create a presentation
- Get Presentation with Return Element IDs disabled
- Parse the JSON response to extract:
- Number of slides
- Slide IDs
- Page dimensions
- Master slide information
Tips for Effective Use
- Metadata First: Get full presentation metadata first to understand structure before getting specific elements
- Element Discovery: Use "Return Element IDs" to find object IDs needed for other operations
- JSON Parsing: Use a JS node to parse the JSON response and extract specific information
- Slide Indexing: Slides are returned in order, use the index to access specific slides
- Element Types: The response includes element types (shapes, images, text boxes) for filtering
- Caching: Store presentation structure if you'll reference it multiple times
Common Use Cases
Use Case 1: Find Text Boxes for Replacement
Get all elements to identify which ones contain text:
// After Get Presentation with Return Element IDs
const elements = msg.response;
const textBoxes = elements.filter(el => el.shape && el.shape.shapeType === 'TEXT_BOX');
// Use these IDs for targeted text replacement
Use Case 2: Dynamic Slide Processing
Get presentation metadata to process slides dynamically:
// After Get Presentation (full metadata)
const presentation = msg.response;
const slideCount = presentation.slides.length;
const slideIds = presentation.slides.map(slide => slide.objectId);
// Process each slide
for (let i = 0; i < slideCount; i++) {
msg.currentSlideId = slideIds[i];
// Process this slide with other nodes
}
Use Case 3: Validate Presentation Structure
Check if a presentation has the expected structure:
// After Get Presentation
const presentation = msg.response;
// Validate
if (presentation.slides.length < 5) {
throw new Error('Presentation must have at least 5 slides');
}
// Check for specific layouts
const hasTitle = presentation.slides.some(slide =>
slide.slideProperties.layoutObjectId.includes('TITLE')
);
Use Case 4: Extract Image Placeholders
Find all image placeholders on a slide for replacement:
// After Get Presentation with Return Element IDs
const elements = msg.response;
const imagePlaceholders = elements.filter(el =>
el.shape &&
el.shape.placeholder &&
el.shape.placeholder.type === 'PICTURE'
);
msg.placeholderIds = imagePlaceholders.map(p => p.objectId);
Understanding the Response
Full Presentation Response Structure
{
"presentationId": "1ABC...",
"pageSize": {
"width": { "magnitude": 960, "unit": "PT" },
"height": { "magnitude": 540, "unit": "PT" }
},
"slides": [
{
"objectId": "p1",
"pageElements": [...],
"slideProperties": {...}
}
],
"title": "Presentation Title",
"masters": [...],
"layouts": [...]
}
Page Elements Response Structure
[
{
"objectId": "element1",
"size": {...},
"transform": {...},
"shape": {
"shapeType": "TEXT_BOX",
"text": {...}
}
}
]
Common Errors and Solutions
| Error | Cause | Solution |
|---|---|---|
| "Presentation ID cannot be empty" | No ID provided or ID is "_" | Ensure Presentation Id input contains a valid presentation ID |
| "Page Object ID cannot be empty when Return Element IDs is selected" | Return Element IDs enabled but no Page Object Id | Provide a valid page/slide ID when getting elements |
| Invalid presentation ID | Presentation doesn't exist or ID is wrong | Verify the presentation ID from the URL or previous node output |
| Authentication errors | Missing or expired credentials | Ensure proper authentication with Google Slides API |
| Page not found | Page Object Id doesn't exist in presentation | Get full metadata first to find valid page IDs |
Best Practices
- Two-Step Process: Get full metadata first, then get specific page elements as needed
- Error Handling: Wrap in try-catch for presentations that might not exist
- Response Storage: Store the full response if you'll query it multiple times
- Selective Retrieval: Only get page elements when you need detailed element information
- ID Mapping: Create a map of slide indices to slide IDs for easier access