Sources provide dynamic dropdown options in action forms. Define them at the miniapp root level under source, and reference them in parameters via x-source.
// MiniApp root level
source: {
// Each key must start with "rpc_"
rpc_channels_list: {
url: 'https://slack.com/api/conversations.list?limit=1000&types=public_channel,private_channel',
method: 'GET',
headers: {
Authorization: 'Bearer [[accessToken]]',
},
dataPath: 'channels', // JSONPath to the array in the response
valueField: 'id', // Field to use as the option value
labelField: 'name', // Field to use as the option label
},
rpc_users_list: {
url: 'https://slack.com/api/users.list?limit=1000',
method: 'GET',
headers: {
Authorization: 'Bearer [[accessToken]]',
},
dataPath: 'members',
valueField: 'id',
labelField: 'profile.real_name', // Supports nested paths
},
},
// Then reference from action parameters:
actions: [{
parameters: {
properties: {
channel: {
type: 'string',
title: 'Channel',
'x-source': 'rpc_channels_list', // ← Matches key in source
'x-fallback': 'input',
},
},
},
}]Source definition fields:
| Field | Type | Required | Description |
|---|---|---|---|
url | string | ✅ | API endpoint URL (supports [[cred]] placeholders) |
method | string | ✅ | HTTP method (GET or POST) |
headers | object | — | Request headers |
queryParams | object | — | Additional query parameters |
dataPath | string | ✅ | Path to the array in the API response |
valueField | string | ✅ | Field name to use as the option value |
labelField | string | ✅ | Field name to use as the option label |
valueFields | object | — | Alternative value fields per sourceRef context |
How it works at runtime:
- User opens the action form
- Frontend calls
miniAppsActionSourcesGraphQL query with thesourceKey - Backend fetches the source URL with the user's credentials injected
- Response array is extracted from
dataPath - Each item is mapped to
{ value, label }usingvalueFieldandlabelField - Dropdown renders with the options