Training Day
Simple Ledger Scripts

Get Record

Fetches a specific record from QuickBooks Online by entity type and ID, providing a clean interface for retrieving individual QBO records.

Introduction

The "Get Record" script provides a streamlined method for retrieving a specific record from QuickBooks Online (QBO) based on its entity type and unique identifier. This script simplifies the process of fetching individual records from QBO by handling the API path construction, authentication, and response processing.

Unlike more complex query operations, this script focuses on retrieving a single, specific record when you already know its QBO ID, making it ideal for lookups and reference operations.

Key Features

  • Direct Record Access: Retrieves a specific record by its unique QBO ID
  • Entity Type Flexibility: Works with any QBO entity type (Customer, Invoice, etc.)
  • Clean Response Format: Returns just the requested record data, without additional metadata
  • Standardized Error Handling: Provides consistent error reporting across QBO operations

Usage

To use this script, call it using the FileMaker "Perform Script" step:

Perform Script [ "Get Record (entity, qbo_id)" ; JSONObject ]

Script Parameter

The script accepts a single JSON object parameter with the following properties:

PropertyTypeDescription
entitystringThe QuickBooks Online entity type (e.g., "Customer", "Invoice")
qbo_idstringThe primary ID for the record in QuickBooks Online

Return Value

On success, the script returns the requested record as a JSON object containing all fields from QuickBooks Online for that entity type.

Error Handling

If an error occurs, the script returns an error object with the following structure:

PropertyTypeDescription
codenumberError code
messagestringA description of the error

Implementation Details

The script follows this process flow:

  1. Parameter Validation: Verifies that required parameters are present
  2. Path Construction: Builds the appropriate API endpoint path for the requested entity and ID
  3. API Request: Uses the "Send QBO HTTP Request" script to execute the API call
  4. Response Processing: Extracts the specific entity data from the response
  5. Result Formatting: Returns just the entity data without additional wrapping

Dependencies

This script depends on:

  • The "Send QBO HTTP Request" script for making the actual API call
  • The "Go To Entities Layout" script for layout navigation during execution

On this page