Get Field History for a Record
sf_get_field_historyRetrieve field-level change history for a Salesforce record, displaying changed field, old/new values, timestamp, and the user who made the change.
Instructions
Queries the {Object}History object to retrieve a field-level change history for a specific record. Shows what changed, when, the old and new values, and who made the change.
Returns records with: date, field, oldValue, newValue, changedBy
objectApiName: the SObject with history tracking enabled, e.g. 'Account', 'Opportunity', 'Case' recordId: the specific record to retrieve history for
Note: Field history tracking must be enabled for the object and for each field you want to track (Setup → Object Manager → {Object} → Fields & Relationships → Field History Tracking). History is retained for up to 18 months.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum history records to return | |
| fields | No | Optional field names to filter — returns all tracked fields if omitted | |
| recordId | Yes | Record ID to fetch history for (15 or 18 characters) | |
| objectApiName | Yes | Object API name, e.g. 'Account', 'Case', 'Opportunity' |