fieldsFromApi method transforms raw API responses into the format defined by your collection’s fieldsSchema. This method is called automatically when retrieving records from the external API.
Implementation Examples
Mapping Implementation (Recommended)
File:fields-from-api.map.yml
JavaScript Implementation
File:fields-from-api.js
Input
| Property | Type | Description |
|---|---|---|
fields | object | Raw fields from the API response |
parameters | object | Collection parameters |
Return Value
The method should return an object matching the collection’sfieldsSchema.