- Get a list of the current fields (including standard and custom fields)
- Create or update custom fields
- Detect when fields have been created, deleted, or have their types changed
Fetch existing fields
Using headless UI
Use theuseManifest hook to retrieve existing fields from your customer’s SaaS instance. The getCustomerFieldsForObject function returns all fields for a given object, including both standard and custom fields.
Using API
Use the Ampersand API to get object metadata that includes all fields for an object:- Get object metadata for installation - Use this when you have an installation
- Get object metadata for connection - Use this when you only have a connection, this is helpful if you need to retrieve fields while a customer is setting up their integration.
Create or update custom fields
You can programmatically create or update custom fields in your customer’s SaaS instance using Ampersand’s API. This is useful when you need to ensure specific custom fields exist before writing data to them. Please note that only Salesforce and HubSpot support this feature at the moment. Ampersand provides two endpoints for managing custom fields:- Upsert custom fields for installation - Use this when you already have an installation
- Upsert custom fields for connection - Use this when you only have a connection (useful during installation setup)
Provider-specific behavior
Salesforce
When creating custom fields in Salesforce, Ampersand automatically handles field permissions to ensure your integration can access the newly created fields:- Permission Set: Ampersand creates a managed Permission Set named
IntegrationCustomFieldVisibilitythat grants read and edit access to custom fields - Field Permissions: View and write permissions for the new custom fields are automatically added to this Permission Set
- User Assignment: The Permission Set is automatically assigned to the user that provided their credentials for the Connection
HubSpot
When creating custom fields in HubSpot, Ampersand automatically organizes them into a property group:- Property Group: Ampersand creates a managed property group named
integrationcreatedproperties(displayed as “Integration Created Properties”) - Field Organization: All custom fields created through Ampersand are organized under this group for easy management
Watch schema changes
Ampersand allows you to monitor changes to the schema of objects in your customers’ SaaS applications. This enables your application to react when fields are created, deleted, or have their types changed, helping you keep your integration in sync with your customers’ evolving data structures. To do this, addwatchSchema as a key in your integration defined in amp.yaml & deploy the integration using amp deploy. You need to specify:
- The name of the destination where you want to receive schema change notifications.
- The schedule frequency for Ampersand to check for schema changes. The most frequent schedule you can set is once per hour, and the default is once every 24 hours.
- The type of schema changes to monitor (fields added, removed, or changed)
watchSchema key from your integration definition & redeploy the integration using amp deploy.
Event types
You can configure which types of schema changes to monitor:- fieldCreated: triggers when a new field is added to an object.
- fieldDeleted: triggers when a field is removed from an object.
- fieldChanged: triggers when a field’s data type, label, or description is modified.
enabled: always to be notified of that type of change.
Receiving schema change events
You will receive webhook messages when schema changes are detected in your customers’ SaaS instances. These webhooks are sent to the destination you specified in yourwatchSchema configuration.
Depending on the types of schema change events you’ve enabled, the webhook payload can contain different arrays in the result object:
- createdFields: fields that have been added to the object.
- deletedFields: fields that have been removed from the object.
- changedFields: fields that have been modified, including both the old and new field definitions.

