Perfect timing to document the complete solution for BTP custom fields and OData API integration. This is a multi-step configuration issue that catches many developers.
BTP Extensibility Wizard Configuration:
When creating custom fields through the BTP extensibility wizard, there are THREE API-related settings that must all be enabled:
- API Enabled: Basic flag that makes the field available through API (checked by default)
- Include in OData $select: Advanced setting that allows explicit field selection via $select parameter (NOT checked by default)
- Include in Metadata: Ensures field appears in $metadata endpoint (usually auto-enabled with API Enabled)
The ‘Include in OData $select’ toggle is under Advanced Settings in the wizard and is the most commonly missed configuration. Without it, fields appear when querying all fields (*) but disappear when explicitly requested.
API Metadata Cache Refresh:
After deploying BTP extensions, the OData metadata cache must be manually refreshed:
- Navigate to Admin Center > System Configuration > OData API Configuration
- Find the OnboardingCandidateInfo entity
- Click ‘Refresh Metadata Cache’
- Wait 5-10 minutes for propagation across all API nodes
This step is MANDATORY - the API layer caches entity schemas and won’t recognize new fields until explicitly refreshed.
OData $select Usage with Custom Fields:
Custom fields added via BTP use a namespace prefix. Check the $metadata endpoint to get exact field names:
GET /odata/v2/$metadata
Look for your entity and note the custom field names. They typically use format:
- Standard BTP custom: `cust_fieldname
- Extension-specific: `cust_ExtensionName/fieldname
Correct query syntax:
GET /odata/v2/OnboardingCandidateInfo?$select=firstName,lastName,cust_custom_division,cust_custom_costcenter
Or with navigation for complex extensions:
GET /odata/v2/OnboardingCandidateInfo?$select=firstName,cust_OnboardingExtension/custom_division
H2 2023 Specific Behavior:
In H2 2023, SF changed how $select handles custom fields for security reasons. If ‘Include in OData $select’ is disabled:
- Query without $select: Custom fields INCLUDED in response
- Query with $select=*: Custom fields INCLUDED
- Query with explicit $select: Custom fields EXCLUDED (even if listed)
This prevents accidental exposure of sensitive custom data through poorly constructed API queries.
Verification Steps:
- Confirm all three wizard toggles enabled
- Refresh metadata cache and wait 10 minutes
- Query $metadata endpoint to verify field names
- Test query without $select to confirm fields appear
- Use exact field names from metadata in $select query
After following these steps, your custom fields should be fully accessible via OData API with proper $select support.