#
Using SheetPoet Operations
This guide explains how to use the different operations available in the SheetPoet Google Sheets Add-on.
#
Available Operations
SheetPoet offers three main types of operations:
#
Import Data to Sheet
Use this to fetch data from WordPress and display it in your spreadsheet. This operation runs recursively until you cancel it or the function returns an empty result.
#
Steps:
- Click Extensions > SheetPoet - WordPress Connector > Operations > Import data to sheet
- Select the WordPress site you want to connect to
- Select the Sheet in which you want to import the data (all data will be read and saved in this sheet)
- In the Function dropdown, select the function you created in WordPress
- Add Magic Parameters which are key-value pairs your function will have access to (e.g., if you add
test
as key and1
as value, the function can access it as$record['test']
with value1
) - Choose the batch size (number of rows fetched in each API call)
- Click Process
- Your WordPress data will start appearing in the spreadsheet
- You can stop the process at any time by clicking Stop
#
Default Parameters Available:
Your function automatically receives: index
, processed
, batchSize
The operation will continue running until:
- You click Stop
- Your function returns an empty array or value
- An error occurs
#
Update Data on Website
Use this to send data from your spreadsheet to WordPress for processing. This operation supports dynamic column values, allowing you to map any spreadsheet column to your function parameters.
#
Steps:
Click Extensions > SheetPoet - WordPress Connector > Operations > Update data on website
Select the WordPress site you want to connect to
Select the function you created in WordPress
Configure parameters and map your spreadsheet data using dynamic column values
Add Magic Parameters with column references. For example:
Click Process
#
Default Parameters Available:
Your function automatically receives: index
, batchSize
, identifier
#
Dynamic Column Mapping:
Use {{COLUMN}} syntax to reference spreadsheet columns:
- {{A}} = Column A value
- {{B}} = Column B value
- {{C}} = Column C value
- And so on...
Example: Set magic parameter title
with value {{A}} to pass Column A value as the "title" parameter to your function.
#
Run One-time Trigger
Use this to execute standalone functions on your WordPress site. This operation runs once and inserts the returned data into the selected sheet.
#
Steps:
- Click Extensions > SheetPoet - WordPress Connector > Operations > Run one-time trigger
- Select the WordPress site you want to connect to
- Select the function you want to trigger
- Configure any required parameters using Magic Parameters
- Click Process
#
Default Parameters Available:
No default parameters (only custom magic parameters you define)
The function will execute once on your WordPress site and return results to your spreadsheet. This is perfect for:
- Maintenance tasks
- Data analysis
- One-time data exports
- System status checks
#
Working with Magic Parameters
Magic Parameters are key-value pairs that your function will have access to. They provide additional context or configuration for your functions.
#
How to Add Magic Parameters:
- In the operation interface, locate the "Magic Parameters" section
- Click Add New Field
- Enter a key and value for your parameter
#
Examples:
Static Values:
If you add test
as the key and 1
as the value, your function can access it as $record['test']
and it will have the value of 1
.
Dynamic Column Values (Upload to Website only):
- Key:
title
, Value: {{A}} → Function receives Column A value as$record['title']
- Key:
content
, Value: {{B}} → Function receives Column B value as$record['content']
- Key:
category
, Value: {{C}} → Function receives Column C value as$record['category']
#
Default Parameters by Function Type:
- Import to Sheet:
index
,processed
,batchSize
- Upload to Website:
index
,batchSize
,identifier
- One-time Trigger: No default parameters
Common magic parameters include:
- id: Unique identifier for the data
- status: Content status (e.g., "publish", "draft")
- type: Content type
#
Saving Operations as Presets
To save an operation for future use:
- Configure your operation
- Click Save as Preset
- Enter a name for your preset
- Click Save
To use a saved preset:
- Click Extensions > SheetPoet - WordPress Connector > Presets
- Find your preset in the list
- Click Use
- Click Process to execute
#
Troubleshooting
#
Operation Errors
- Check the error message for specific issues
- Verify your data format matches what the function expects
- Try with a smaller dataset to isolate the issue
- Check execution history in WordPress for detailed error information
For more help, see our Troubleshooting Guide.