Get Changed Records
Retrieves records from QuickBooks Online that have been modified since a specified timestamp, supporting pagination for large data sets.
Introduction
The "Get Changed Records" script facilitates the retrieval of records from QuickBooks Online (QBO) that have been modified since a specified timestamp. This script is particularly useful for synchronization processes where you need to fetch only records that have changed since your last sync operation.
The script handles query construction, filtering by modification timestamp, sorting, and pagination to make it easier to retrieve incremental changes from QBO efficiently.
Key Features
- Change Tracking: Filters records by their last modification timestamp
- Pagination Support: Allows fetching records in manageable batches
- Sorting Control: Orders results by modification timestamp for predictable sync sequences
- QBO Query Construction: Builds and executes proper QBO query syntax automatically
Usage
To use this script, call it using the FileMaker "Perform Script" step:
Script Parameter
The script accepts a single JSON object parameter with the following properties:
| Property | Type | Description |
|---|---|---|
entity | string | The QuickBooks Online entity to query (e.g., "Customer", "Invoice") |
lastModStamp | string | (Optional) The timestamp to filter records modified after this time |
startPosition | number | (Optional) The starting position for pagination |
maxResults | number | (Optional) The maximum number of results to return in a single request |
Return Value
On success, the script returns a JSON object with the following structure:
| Property | Type | Description |
|---|---|---|
noMoreRecords | boolean | Indicates if there are more records to fetch |
qboQueryTimestamp | string | The time on QBO's servers when this query was executed |
records | array | The array of records retrieved from QuickBooks Online |
Error Handling
If an error occurs during execution, the script returns an error object with:
| Property | Type | Description |
|---|---|---|
code | number | Error code |
message | string | A description of the error |
Implementation Details
The script follows this process flow:
- Parameter Extraction: Parses the input parameters from the script parameter
- Query Construction: Builds a QBO query with appropriate filtering and pagination
- API Request: Uses the "Send QBO HTTP Request" script to execute the query
- Response Processing: Extracts the relevant records and pagination information
- Result Formatting: Structures the result in a consistent format for the calling script
Dependencies
This script depends on:
- The "Send QBO HTTP Request" script for making the actual API call
- Proper QBO entity names matching those in the QuickBooks Online API
Send QBO HTTP Request
A specialized script for interacting with the QuickBooks Online API from FileMaker, handling authentication, token management, and error handling.
Get Record
Fetches a specific record from QuickBooks Online by entity type and ID, providing a clean interface for retrieving individual QBO records.